benjjneb / dada2

Accurate sample inference from amplicon data with single nucleotide resolution
http://benjjneb.github.io/dada2/
GNU Lesser General Public License v3.0
469 stars 142 forks source link

library(phyloseq) #1283

Closed marco2985 closed 3 years ago

marco2985 commented 3 years ago

Hi Benjamin, I have got different warning errors when I running the phyloseq package: 1) > day <- as.integer(sapply(strsplit(samples.out, "D"), [, 2)) Warning message: NAs introduced by coercion

plot_richness(ps, x="Day", measures=c("Shannon", "Simpson"), color="When")

Warning message: In estimate_richness(physeq, split = TRUE, measures = measures) : The data you have provided does not have any singletons. This is highly suspicious. Results of richness estimates (for example) are probably unreliable, or wrong, if you have already trimmed low-abundance taxa from the data. We recommended that you find the un-trimmed data and retry.

plot_bar(ps.top20, x="Day", fill="Family") + facet_wrap(~When, scales="free_x") Warning messages: 1: In min(x) : no non-missing arguments to min; returning Inf 2: In max(x) : no non-missing arguments to max; returning -Inf 3: In min(diff(sort(x))) : no non-missing arguments to min; returning Inf 4: Removed 400 rows containing missing values (position_stack).

I cannot visualize any plot , only the Bray NMDS but only at "early" not "late":(unfortunately and I do not now know how to fix it...

I hope you can help me, Thank you in advance, Kind regards, Maria//

benjjneb commented 3 years ago

You can basically ignore the first two warnings. The commands are still running, they are just warning you about some aspect, e.g. that one of the samples was named "Mock" and so didn't have a day encoded in the sample name after the letter D.

As for the plot_bar error, possibly your taxonomy table wasn't included in the phyloseq object? what does head(tax_table(ps)) return?

marco2985 commented 3 years ago

So, it means the "Mock" data do not have a day encoded. Then, it is why I do not have any value of diversity on "late" ? What happens if I change the letter D by other one? Could it work by then...?

head(tax_table(ps)) Taxonomy Table: [6 taxa by 8 taxonomic ranks]:

Seems to work fine now.

The code for plot_bar I use is the following: plot_bar(ps, fill="Phylum") + geom_bar(aes(color = Phylum, fill = Phylum), stat="identity", position="stack") + labs(x = "", y = "Relative Abundance\n") + theme(panel.background = element_blank())

and now it is working :)

benjjneb commented 3 years ago

So, it means the "Mock" data do not have a day encoded. Then, it is why I do not have any value of diversity on "late" ? What happens if I change the letter D by other one? Could it work by then...?

Yeah, the mock community is just a postive control, it has no "Day" associated. So all the NAs and warnings there are fine.

marco2985 commented 3 years ago

Thanks Benjamin,

Do you know how I can add a table to the otu table with the alpha index and beta diversity index?

Thank you very much, Maria//

El lun., 1 mar. 2021 18:47, Benjamin Callahan notifications@github.com escribió:

So, it means the "Mock" data do not have a day encoded. Then, it is why I do not have any value of diversity on "late" ? What happens if I change the letter D by other one? Could it work by then...?

Yeah, the mock community is just a postive control, it has no "Day" associated. So all the NAs and warnings there are fine.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/benjjneb/dada2/issues/1283#issuecomment-788534525, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS62L5QA3XHYFBF5I3MM4YLTBRGUVANCNFSM4YKUOHLA .

benjjneb commented 3 years ago

You probably want to take a look at the phyloseq page for more guidance here. Alpha diversity can be added to the sample_data, but betadiversity (or the dissimilarities between each measured community) is used in a different way. A lot more information and examples at the phyloseq page under the tutorials menu: https://joey711.github.io/phyloseq/