ahmohamed / lipidr

Data Mining and Analysis of Lipidomics datasets in R
https://www.lipidr.org/
Other
27 stars 13 forks source link

Error in .check_sample_annotation(data, annot) #58

Open mgaleas opened 1 year ago

mgaleas commented 1 year ago

I am new to lipidR (and R, tbh). I created a csv file for my MS lipid profile data and another for annotation following the guidelines. LipidR object was created with no issues. Annotation table has 1st column titled "Sample" and sample names match data table.

When running d <- add_sample_annotation(d, "data_clin.csv") I get the following error: Error in .check_sample_annotation(data, annot) : All sample names must be in the first column or a column named "Sample"

First column is samples and is named "Sample". Still can't get past this error because I don't know how to fix this. I am losing my mind. What can I do to annotate my table? I am screaming.

If this is not the right place to ask this, I would appreciate if anyone can point me to the right direction. Thanks.

ahmohamed commented 12 months ago

It's not about what the first column is named, but the records (rows) should match the samples you have in your dataset. Common issues come from non-syntactic names (ones that contain spaces, start with a number, etc) as these can be transformed by R during parsing. Check the following two items:

colnames(d)
read.csv("data_clin.csv")$Sample

Both should overlap.