ByrumLab / proteoDA

GNU General Public License v3.0
12 stars 11 forks source link

Error in `validate_DAList()`: ! The row names of the metadata do not match the column names of the data #253

Open James-E-Clark opened 5 months ago

James-E-Clark commented 5 months ago

However, the col and row names are the same:

setequal(rownames(sample_metadata),colnames(intensity_data)) [1] TRUE

colnames(intensity_data) == rownames(sample_metadata) [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE

Names are a mixture of numbers and letters e.g. H8417

Even after making sure the names are the same it does not work:

rownames(sample_metadata) = c("C1","C2","C3","A1","B1","B2","B3","B4","G1","G2") colnames(intensity_data) = c("C1","C2","C3","A1","B1","B2","B3","B4","G1","G2")

create DAList object

raw <- DAList(data=intensity_data,

  • annotation=annotation_data,
  • metadata=sample_metadata,
  • design = NULL,
  • eBayes_fit = NULL,
  • results=NULL,
  • tags=NULL) Error in validate_DAList(): ! The row names of the metadata do not match the column names of the data Run rlang::last_trace() to see where the error occurred.
tjthurman commented 5 months ago

Odd error, thanks for filing an issue! From the code you sent, it does seem like the colnames and rownames are equal and should be fine. So I'll need a little more context to figure out what is triggering the error. Can you show the code you used to generate the intensity_data and sample_metadata dataframes, their initial colnames and rownames, and their dimensions?

glycohezhu commented 4 months ago

I had the same error and got it fixed using the code below before creating the DAList. You can give it a try.

INDEX=sort(intersect(colnames(intensity_data),rownames(sample_metadata))) sample_metadata=sample_metadata[INDEX,] intensity_data=intensity_data[,INDEX]