Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in .check_sample_annotation(data, annot) #58

Open
mgaleas opened this issue Sep 4, 2023 · 1 comment
Open

Error in .check_sample_annotation(data, annot) #58

mgaleas opened this issue Sep 4, 2023 · 1 comment

Comments

@mgaleas
Copy link

mgaleas commented Sep 4, 2023

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants