eMetaboHUB / MS-CleanR

25 stars 8 forks source link

Error in rowMeans: 'x' must be numeric [No stack trace available] #1

Closed tbento2015 closed 3 years ago

tbento2015 commented 4 years ago

I'm having this issue over and over after many attempts.

I'm following the tutorial Tutorial-MS-CleanR-v1.00e.pdf. I have R version 3.6.1 and MS-Dial 4.16.

I suspect this error is being raised in line 202 of file R/msdial_functions.Rsince it's the only place that function rowMeans is being called. It appears variable x is not being cast as numeric before the rowMeans is called.

This is what is shown in the R console:

Warning: Error in `rowMeans`: 'x' must be numeric
  [No stack trace available]

I changed all my class names to address the concerns. I also see the same message in the Shiny GUI. See screenshots below:

Screenshot 2020-10-22 111050 Screenshot 2020-10-22 111118

Would you know a solution for this problem?

Please advise.

josemarfdc commented 4 years ago

I'm facing the same issue @guikool any idea of what is going on?

guikool commented 3 years ago

This issue arise when no MS/MS has been found in the dataset (Normalized and Height MS-Dial file).Your data must be acquired in DDA or DIA mode since all features without MS/MS will be discarded during this step. If its not the case, please send me your "height" file from MS-Dial so I can have a look at your data structure G.

QizhiSu commented 3 years ago

I have the same problem now. Actually, I did not have this problem before. After re-processing my data in MS-DIAL, I try to use MScleanR using the same settings, and I got the issues. No matter how I try (e.g. run on another computer), the issue persists. The issue possibly raise from the negative mode data because when I disable the "pos" folder, the issue appears, while disabling "neg" folder, it works.

guikool commented 3 years ago

Try to check your data order in MSDIAL between pos and neg mode, it should be exactly the same (same number of samples, blk, QCs).

QizhiSu commented 3 years ago

Yes, I have check many times file type, class ID, analytical order between pos and neg mode. they are exactly the same. But I think the problem is not here, because running "neg" folder gives the same problem, while "pos" does not. I have tried with different projects, the errors could be "[M-H]- not found" or "Error in rowMeans: 'x' must be numeric".

guikool commented 3 years ago

Please send me your "normalized" and "height" outputs from MSdial to guillaume.marti@univ-tlse3.fr so I'll check your error.

QizhiSu commented 3 years ago

I'm having this issue over and over after many attempts.

I'm following the tutorial Tutorial-MS-CleanR-v1.00e.pdf. I have R version 3.6.1 and MS-Dial 4.16.

I suspect this error is being raised in line 202 of file R/msdial_functions.Rsince it's the only place that function rowMeans is being called. It appears variable x is not being cast as numeric before the rowMeans is called.

This is what is shown in the R console:

Warning: Error in `rowMeans`: 'x' must be numeric
  [No stack trace available]

I changed all my class names to address the concerns. I also see the same message in the Shiny GUI. See screenshots below:

Screenshot 2020-10-22 111050 Screenshot 2020-10-22 111118

Would you know a solution for this problem?

Please advise.

Hi tbento2015, Did you solve the issue?

tbento2015 commented 3 years ago

Hi Sukis123, I haven't solved the issue yet, but my samples were not acquired in DDA mode. I'm trying to run my samples on DDA mode to test it again.

Best, Thiara

QizhiSu commented 3 years ago

Well, waiting for your update.

guikool commented 3 years ago

I don't understand why you have such error in neg

However, the number of features detected by MSdial is really low for an untargeted metabolomic experiment. It seems also that your blank samples height is in the same range as the other sample. Its possible that all features in neg are removed by "generic filters" (see paper for details). I advise you to continue with pos mode only or to carefully inspect all your chromatograms before launching the MSdial/MScleanR workflow. This is a mandatory step to define the minimum feature height, peak duration QCs reapetability...

QizhiSu commented 3 years ago

Hi Guikool, I think you are right. I am not doing metabolomic experiments. They were chemical migration from plastics. It is true that the number of features in neg mode is small when I check the chromatograms manually. I now set a lower minimum peak value (1000), the number of features increases, and MScleanR works very well.

Thanks a lot for your help.

Best, Sukis

guikool commented 3 years ago

You're welcome don't forget to cite MS-CleanR in your future communications Best G.

QizhiSu commented 3 years ago

Of course!!! For sure, it is an excellent tool!

QizhiSu commented 3 years ago

Hi Guikool, As we discussed before, the problem was that the number of features in neg mode was too small. when I manually check the chromatogram and MSdial, I found that some features are really significant in samples (see the screenshot below). my confusion is why they are still removed by mscleanr? image

by the way, I wanna ask if it is possible to integrate MS-DIAL annotations through library match?

guikool commented 3 years ago

Check the intermediary data directory created by MS-cleanR. For each filter, a dataset is created with removed feature. It should help you to tune the MS-CleanR parameters (windows for RMD, RSD...).

QizhiSu commented 3 years ago

OK, I am gonna check.

QizhiSu commented 3 years ago

For example, I have 49 and 106 features in negative and positive mode, respectively. After applying blank (0.8) and RSD filters (30), there were only 10 and 60 features deleted, respectively. It should have 30 features left for negative mode, so my confusion is why [M-H]- error persists.

guikool commented 3 years ago

I advise you to carefully read and understand the associated paper with this package. In your post, you speak about generic filters, but MS-C will also apply a filtering based on cluster calculated by MS-Dial PCE.

QizhiSu commented 3 years ago

Sorry about that. I will try. Thanks for your kindness.