I am trying to run CMSclassifier::classifyCMSfunction on my data but I am getting this error


> 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


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

  • 1
    $\begingroup$ 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. $\endgroup$
    – M__
    Apr 6, 2019 at 22:52
  • $\begingroup$ 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? $\endgroup$
    – llrs
    Apr 7, 2019 at 10:39
  • $\begingroup$ I have done all but very complicated $\endgroup$
    – Zizogolu
    Apr 7, 2019 at 12:50

2 Answers 2


The problem was I should use ENTREZ rather than gene symbols

  • $\begingroup$ 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. $\endgroup$
    – M__
    Apr 7, 2019 at 16:47

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


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


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.

  • 1
    $\begingroup$ 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. $\endgroup$
    – M__
    Apr 7, 2019 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.