grunwaldlab / metacoder

Parsing, Manipulation, and Visualization of Metabarcoding/Taxonomic data
http://grunwaldlab.github.io/metacoder_documentation
Other
135 stars 28 forks source link

Creation of different heat trees by treatments definded in sample data file #350

Open kazpa-kay opened 1 year ago

kazpa-kay commented 1 year ago

Hi Grunewaldlab-members and coders,

thank you so much for the metacodeR package and the great documentation provided with it. I am playing with it for the last days to nicely display my community data. I am running in a, maybe very simple, problem while doing so.

Fungal community data was achieved from three locations (=treatments, lets say Right, Center, Left), which I´d like to plot as three individual heat trees (OTU counts). The information which location the samples (sample_ID) were obtained from are stored in a separate sample data-file.

I tried so much to filter (filter_taxa) the data according to the location information but was not succesful with it. Also searching for the issue didn´t bring the solution (that I could understand and implement).

If I use filter on the sample data (sample_data <- filter(sample_data, location == "Center") ) and continue with that, my heat tree will end up exactly like if I had used another sample data filter (sample_data <- filter(sample_data, location == "Right") ) - and that even though the community is pretty different between "Center" and "Right" locations. Also, i could´t find the command in which information from sample_data is provided to the taxmap object (obj) - which generates the quesiton "how to make the above used filter criteria affect the taxmap object on which the heat tree is constructed?"

My question: Could you provide me the option how to filter tax data by information from the "location" column in the sample data file and then how to use this to plot the data for only one of the locations (e.g. Center)?

I am happy to share files with you, if necessary - but I believe, that there´s probably a pretty common solution for it?

Many thanks and all the best, Karl