LebeerLab / tidytacos

Functions to manipulate and visualize microbial community data
https://lebeerlab.github.io/tidytacos/
GNU General Public License v3.0
9 stars 1 forks source link

expanding on taxonlist_per_condition #16

Closed wsmets closed 1 year ago

wsmets commented 1 year ago

Hi,

I like the concept of the taxonlist_per_condition function, but it doesn't seem to work for either the URT dataset or one of my own list<-taxonlist_per_condition(urt,condition="location") Error in any_samples_left(ta) : No samples left after filtering

Furthermore, I think it would be useful to immediately add the taxonomy of the taxon_ids to the tables. Finally, optionally, a read cut-off option would be nice, as I suspect some cross-contamination has occurred in my dataset and to exclude false positive presence of taxa I would set the read cut-off a bit higher at 3. Although the latter can also be achieved by filtering the counts table before executing the taxonlist_per_condition function.

TheOafidian commented 1 year ago

Hey Wenke,

For the error you had; you're supposed to supply the condition as a symbol (i.e. not in "quotes"). I've changed the function a bit in dev so it will translate any "condition" to condition (the symbol not the string) so now either way off declaring the column can work.

I've also added an optional read_treshold parameter to set a minimum amount of counts for the taxa. Adding to the taxa table could be done as follows:

tl <- urt %>% taxonlist_per_condition(location, read_treshol=300)
urt %>% mutate_taxa(presence_in_N=ifelse(taxon_id %in% tl$N, TRUE, FALSE)

Not sure if we should include this as default step