joey711 / shiny-phyloseq

An interactive web application for demonstrating and using phyloseq.
http://joey711.github.io/shiny-phyloseq
GNU General Public License v3.0
58 stars 45 forks source link

Mapping file import #55

Closed CarlyMuletzWolz closed 9 years ago

CarlyMuletzWolz commented 9 years ago

I'm a bit confused on how I get my mapping file or meta-data file into Shiny-phyloseq. When I upload my .biom files I have no metadata associated with them, and I don't see any issues discussing this or any button to upload a separate environmental data file. I do some other pre-processing after QIIME outputs the first otu-table.biom file, specifically I use UPARSE to cluster my OTUs and delete OTUs that I believe are contamination, and so I create a 'different' biom file than what is originally outputted by QIIME. Is this what is causing the problem?

joey711 commented 9 years ago

There's two parts to this, and lots of options for you.

First, I don't think I've added a separate feature to allow uploading of a sample data table. Totally possible. Not a big deal. This would be a feature request.

Second, the biom-format was always designed and intended to include sample data ("column metadata") as well as feature/row/otu covariate data ("row metadata"). So with the right tools you would have a biom file that already has that information, and if you uploaded that file to shiny-phyloseq, it would read and include it in your session. My QIIME experience is a bit rusty at this point, but I think I recall that they don't include the sample "metadata" with the biom file exported by QIIME, even though it's totally possible, and most people provide this sample data as part of the mapping file at the beginning of a QIIME session. Long story short, one solution to this problem is to ask the QIIME developers to include the sample metadata in the biom file, since you're already providing it to QIIME anyway. Alternatively, the python tools for biom-format might already include something for importing data from a mapping file and adding it to a biom-formatted file without it. I'm not sure.

Alternatively still, this is already possible in phyloseq (there's a mapping-file import function), and you can just save your phyloseq object as an .RData file using the save function. I like this option the best.

save(myphyseq1, file = "myphyseq1.RData")

Separately, you might also ask me to add that as a specific capability as part of the "biom" package for R (which I also maintain, but it has its own issue tracker), and then finish-off the biom-writing function in that package, which I've been procrastinating on finishing for quite some time.

Hope one or more of these helps! I will close for now. If you decide to initiate a feature request for one of these options, I can re-open and rename the title, or you can just post it as a new issue on the relevant github issue tracker.

Cheers