Click here to Skip to main content
14,392,909 members
Rate this:
Please Sign up or sign in to vote.
See more:
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?

What I have tried:

Currently gpsfb is phylseq object, so now i am lost

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100