MicrobiomeStat
MicrobiomeStat copied to clipboard
qiime2 style metadata import error
When importing a qiime2 style metadata file, the function mStat_import_qiime2_as_data_obj() does not remove the annotation row "q2:types" specifing the data type
data.obj <- mStat_import_qiime2_as_data_obj( otu_qza = "qiime2_mp_data/rarefied_table.qza", taxa_qza = "qiime2_mp_data/taxonomy.qza", sam_tab = "qiime2_mp_data/sample_metadata.tsv", tree_qza = "qiime2_mp_data/rooted-tree.qza" )
head(data.obj$meta.dat) sample.id barcode.sequence body.site year month day subject reported.antibiotic.usage days.since.experiment.start #q2:types #q2:types categorical categorical numeric numeric numeric categorical categorical numeric L1S8 L1S8 AGCTGACTAGTC gut 2008 10 28 subject-1 Yes 0 L1S57 L1S57 ACACACTATGGC gut 2009 1 20 subject-1 No 84 L1S76 L1S76 ACTACGTGTGGT gut 2009 2 17 subject-1 No 112 L1S105 L1S105 AGTGCGATGCGT gut 2009 3 17 subject-1 No 140 L2S155 L2S155 ACGATGCGACCA left palm 2009 1 20 subject-1 No 84
Hi @magicprotoss,
Thank you for bringing this to our attention. It seems that the issue you're experiencing is due to the mStat_import_qiime2_as_data_obj()
function not stripping the "q2:types" annotation row that specifies data types in the metadata file. This row is necessary for qiime2 but should not be included in the data object created for analysis.
We'll look into updating the function to automatically remove this row during the import process. In the meantime, you can manually adjust the metadata file to remove the "q2:types" row before importing it, or you could use a line of code to exclude it after the data is loaded into R.
We appreciate your feedback and will notify you once we have an update on this issue. If you have any more details or specific examples you could share, that would help us ensure the solution fully addresses your needs.
Best regards, Caffery Yang