HCBravoLab / metagenomeSeq

Statistical analysis for sparse high-throughput sequencing
64 stars 20 forks source link

Adding metadata to a biom-loaded MRexperiment object #57

Open Jgruetzke opened 6 years ago

Jgruetzke commented 6 years ago

Hey,

I used kraken to get the taxonomic abbundance estimations for my shotgun data. The output I get from kraken contains both counts and taxonomy. This format is however not supported to set up an MRexperiment object for that I would need an OTU table and a taxonomy table. As a workaround I created a biom-file with kraken and was able to set up a MRexperiment object with the biom2MRexperiment function. Both however, the biom-file and MRexperiment object do not contain any phenotypic information. I would like to use the fitTimeSeries function to analyze my data but to do this I need the PhenoData information in my MRexperiment object. I there any chance to extend the MRexperiment object with phenoData or do you have another solution for me?

Thank you in advance!

hcorrada commented 6 years ago

Assuming you have phenotype data in a data.frame, you can assign the phenoData slot of the MRexperiment object:

phenoData(mrobj) <- AnnotatedDataFrame(my_pheno_data)

Jgruetzke commented 6 years ago

It worked fine! Thank you!