<p>The problem was I should use ENTREZ rather than gene symbols</p>

CC BY-SA 4.0
2019-04-07T16:47:51.710Z
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.
M__
CC BY-SA 4.0
2019-04-07T12:54:34.700Z
2019-04-07T12:54:34.700Z
Zizogolu
<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>

CC BY-SA 4.0
2019-04-07T17:49:07.617Z
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.
M__
CC BY-SA 4.0
2019-04-07T16:40:12.933Z
2019-04-07T20:23:46.790Z
2019-04-07T20:23:46.790Z
M__
<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>

CC BY-SA 4.0
2019-04-06T22:52:19.127Z
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.
M__
CC BY-SA 4.0
2019-04-07T10:39:46.230Z
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?
llrs
CC BY-SA 4.0
2019-04-07T12:50:54.037Z
I have done all but very complicated
Zizogolu
<r><rna-seq><networks><modelling>
How I debug this code?
# How I debug this code?

(Asked by: username_0 on 2019-04-06)

I am trying to run CMSclassifier::classifyCMSfunction 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
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
Example data

**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.  

---

