joey711 / phyloseq

phyloseq is a set of classes, wrappers, and tools (in R) to make it easier to import, store, and analyze phylogenetic sequencing data; and to reproducibly share that data and analysis with others. See the phyloseq front page:
http://joey711.github.io/phyloseq/
567 stars 187 forks source link

What is the difference between prune_samples, rarefy and rarefy_even_depth functions? #1693

Open Ecotone23 opened 11 months ago

Ecotone23 commented 11 months ago

Hello phyloseq community,

Can anyone help clear my confusion regarding some similar functions?

I would like to rarefy my samples using the sampling depth of 500 reads. Can I use either prune_samples(sample_sums(my_phyloseq_object)>500, my_phyloseq_object), or rarefy(my_phyloseq_object, 500), or rarefy_even_depth(my_phyloseq_object, sample.size=500, replace=FALSE) to achieve the same goal?

What's major difference among these functions? Thank you.

Best,

Gabriel

samd1993 commented 11 months ago

Prune samples will literally just filter out samples with less than 500 reads while rarefying will normalize all your samples to have exactly 500 reads. In my experience I use rarefy_even_depth.. not sure how rarefy is different.

Ecotone23 commented 10 months ago

Thanks! That is really helpful.