Answers.Body: <p>The problem was I should use ENTREZ rather than gene symbols</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-07T16:47:51.710Z
Answers.Text: Geee, I don't know ... your code and approach looks very solid to me. I thought maybe the classification was using a different name to the training/test set.
Answers.UserDisplayName: M__
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-07T12:54:34.700Z
Answers.LastActivityDate: 2019-04-07T12:54:34.700Z
Answers.UserDisplayName: Zizogolu
Answers.Body: <p>I see what you mean but I'm not sure that is the source of the error. I kinda suspect that the example data set you provided works fine. What I think is happening is the labels between the classifier, test and training data are different at some point and so classification ceases.</p>
  
  <p>Your code (albeit I rarely use R) and approach and data look fine. In fact very professional, the data appears scaled (not shown). It looks good.</p>
  
  <p>Perhaps what you refer to is the row name consistency in labelling against the example data set. For example row name, ARHGEF19, this is a gene ID rather than a NCBI code, viz.</p>
  
  <pre><code>efetch -db nucleotide -format gpc -id "LS482351" | xtract -insd gene gene
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <pre><code>LS482351.1  ARHGEF19
  </code></pre>
  
  <p>Elsewhere you use an AL590644.1 as the label, I assume this is the genomic region for PADI4</p>
  
  <pre><code>efetch -db nucleotide -format gpc -id "AL590644" | xtract -insd source organism
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <pre><code>AL590644.14 Homo sapiens
  </code></pre>
  
  <p>(There appears to be version 14 for this subgenomic locus).</p>
  
  <p>So the labelling is a bit mixed and you can feasible convert between them using efetch and scripting a hash/dictionary. However, I don't think its the problem here because its a random forest classification and a label is a label.</p>
  
  <p>It is possible the package you are using is buggy and some of the labels are not getting parsed properly e.g. with a XXX-1 tag or even if a XXX.1 tag. The example data set uses "nice whole" integers. I don't know about R but if regex approaches are used for label parsing things can easily go wrong (its not a good approach). Just a guess however and its easy to check.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-07T17:49:07.617Z
Answers.Text: If this was Python Sci-Kit learn I'd give the full debugging a whirl. I don't want to get caught up in R machine learning, but recognise you are using R as your ML approach.
Answers.UserDisplayName: M__
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-07T16:40:12.933Z
Answers.LastActivityDate: 2019-04-07T20:23:46.790Z
Answers.LastEditDate: 2019-04-07T20:23:46.790Z
Answers.UserDisplayName: M__
Body: <p>I am trying to run <code>CMSclassifier::classifyCMS</code>function on my data but I am getting this error</p>
  
  <pre><code>library(CMSclassifier)
  
  &gt; Rfcms &lt;- CMSclassifier::classifyCMS(my_data,method="RF")[[3]]
  Error in match.names(clabs, names(xi)) : 
    names do not match previous names
  </code></pre>
  
  <p>This code classifies gene expression data</p>
  
  <p><a href="https://github.com/Sage-Bionetworks/CMSclassifier/blob/master/R/cmsClassifier.R" rel="nofollow noreferrer">Code</a></p>
  
  <p>But on example data code works</p>
  
  <p>I have attached my data and example data here</p>
  
  <p>Could somebody please help me in solving this error?</p>
  
  <p><a href="https://www.dropbox.com/s/g684pg5izjrqs8w/my_data.txt?dl=0" rel="nofollow noreferrer">My data</a></p>
  
  <p><a href="https://www.dropbox.com/s/m4mxpise8fsiito/example_data.txt?dl=0" rel="nofollow noreferrer">Example data</a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-04-06T22:52:19.127Z
Comments.Text: Interesting question. Its a random forest (ML) algorithm. In truth I'd look to directly code this algorithm via Sci-Kit learn rather than use a forumulation in an R library. Just my thoughts.
Comments.UserDisplayName: M__
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-04-07T10:39:46.230Z
Comments.Text: How did you do to debug this error? Did you try with the example data and you got the same result? Did you try to find what is causing the trouble on the example data? Did you searched how to debug this ? Have you used `traceback()` to locate the source of the error?
Comments.UserDisplayName: llrs
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-04-07T12:50:54.037Z
Comments.Text: I have done all but very complicated
Comments.UserDisplayName: Zizogolu
Tags: <r><rna-seq><networks><modelling>
Title: How I debug this code?
ThreadText: # How I debug this code?
  
  (Asked by: username_0 on 2019-04-06)
  
  I am trying to run `CMSclassifier::classifyCMS`function on my data but I am getting this error
  
  ```
  library(CMSclassifier)
  
  > Rfcms <- CMSclassifier::classifyCMS(my_data,method="RF")[[3]]
  Error in match.names(clabs, names(xi)) : 
    names do not match previous names
  
  ```
  
  This code classifies gene expression data
  
  [Code](https://github.com/Sage-Bionetworks/CMSclassifier/blob/master/R/cmsClassifier.R)
  
  But on example data code works
  
  I have attached my data and example data here
  
  Could somebody please help me in solving this error?
  
  [My data](https://www.dropbox.com/s/g684pg5izjrqs8w/my_data.txt?dl=0)
  
  [Example data](https://www.dropbox.com/s/m4mxpise8fsiito/example_data.txt?dl=0)
  
  **Tags:** r, rna-seq, networks, modelling
  
  > **Comments:**
  > **username_1**: Interesting question. Its a random forest (ML) algorithm. In truth I'd look to directly code this algorithm via Sci-Kit learn rather than use a forumulation in an R library. Just my thoughts.  
  > **username_2**: How did you do to debug this error? Did you try with the example data and you got the same result? Did you try to find what is causing the trouble on the example data? Did you searched how to debug this ? Have you used `traceback()` to locate the source of the error?  
  > **username_0**: I have done all but very complicated  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2019-04-07. Score: 2 | Accepted answer
  
  The problem was I should use ENTREZ rather than gene symbols
  
  > **Comments:**
  > **username_1**: Geee, I don't know ... your code and approach looks very solid to me. I thought maybe the classification was using a different name to the training/test set.  
  
  ---
  
  ### Answer by username_1 on 2019-04-07. Score: 0
  
  I see what you mean but I'm not sure that is the source of the error. I kinda suspect that the example data set you provided works fine. What I think is happening is the labels between the classifier, test and training data are different at some point and so classification ceases.
  
  Your code (albeit I rarely use R) and approach and data look fine. In fact very professional, the data appears scaled (not shown). It looks good.
  
  Perhaps what you refer to is the row name consistency in labelling against the example data set. For example row name, ARHGEF19, this is a gene ID rather than a NCBI code, viz.
  
  ```
  efetch -db nucleotide -format gpc -id "LS482351" | xtract -insd gene gene
  
  ```
  
  **Output**
  
  ```
  LS482351.1  ARHGEF19
  
  ```
  
  Elsewhere you use an AL590644.1 as the label, I assume this is the genomic region for PADI4
  
  ```
  efetch -db nucleotide -format gpc -id "AL590644" | xtract -insd source organism
  
  ```
  
  **Output**
  
  ```
  AL590644.14 Homo sapiens
  
  ```
  
  (There appears to be version 14 for this subgenomic locus).
  
  So the labelling is a bit mixed and you can feasible convert between them using efetch and scripting a hash/dictionary. However, I don't think its the problem here because its a random forest classification and a label is a label.
  
  It is possible the package you are using is buggy and some of the labels are not getting parsed properly e.g. with a XXX-1 tag or even if a XXX.1 tag. The example data set uses "nice whole" integers. I don't know about R but if regex approaches are used for label parsing things can easily go wrong (its not a good approach). Just a guess however and its easy to check.
  
  > **Comments:**
  > **username_1**: If this was Python Sci-Kit learn I'd give the full debugging a whirl. I don't want to get caught up in R machine learning, but recognise you are using R as your ML approach.  
  
  ---
  
  