Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to test abundance difference #951

Open
Dandydane opened this issue Jun 3, 2018 · 2 comments
Open

How to test abundance difference #951

Dandydane opened this issue Jun 3, 2018 · 2 comments

Comments

@Dandydane
Copy link

Library phyoloseq Data= Globalpatterns
GP = filter_taxa(GlobalPatterns, function(x) sum(x > 3) > (0.2*length(x)), TRUE)
Define a human versus non-human categorical variable, and add this new variable to sample data:
sample_data(GP)$human = factor( get_variable(GP, "SampleType") %in% c("Feces", "Mock", "Skin", "Tongue") )
Standardize abundances to the median sequencing depth

total = median(sample_sums(GP))
standf = function(x, t=total) round(t * (x / sum(x)))
gps = transform_sample_counts(GP, standf)

Filter the taxa using a cutoff of 3.0 for the Coefficient of Variation

gpsf = filter_taxa(gps, function(x) sd(x)/mean(x) > 3.0, TRUE)
Subset the data to Bacteroidetes, used in some plots
gpsfb = subset_taxa(gpsf, Phylum=="Bacteroidetes")Plotting the the data

title = "plot_bar; Bacteroidetes-only"
plot_bar(gpsfb, "SampleType", "Abundance", title=title)

Question: What code do i need to write, to test difference in abundance of Bacteroidetes for specific sampletype like feces with ect ANOVA with current example?

@MSMortensen
Copy link

If you are looking for differential abundance of all OTUs, I recommend that you try using the DAtest (github.com/Russel88/DAtest). It is easy to use and has a very thorough description.
The package is published on BiorXciv, but I don't have the link...

Regards,
Martin

@spholmes
Copy link
Contributor

spholmes commented Jun 5, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants