Question: How do I look for shared OTUs in an abundance matrix?
1
gravatar for Ming
20 months ago by
Ming60
Ming60 wrote:

Dear all,

Let's assume I have an abundance matrix that looks like this:

             SampleA SampleB SampleC
OTU1         5               6              0
OTU2         3               1              2
OTU3         1               0              1
OTU4         0               0              2

If I have a large abundance matrix, what software or scripts will you recommend constructing a Venn diagram that can look for shared OTUs, or OTUs that are unique to each sample? The software / script should also produce an output that denotes the number of unique and shared OTUs.

Thank you!

venn diagram R • 1.1k views
ADD COMMENTlink modified 20 months ago by zx87549.9k • written 20 months ago by Ming60

For more than three sets, Euler diagrams quickly become unreadable. You may want to explore alternatives such as UpSetR.

ADD REPLYlink written 20 months ago by Jean-Karim Heriche24k
0
gravatar for zx8754
20 months ago by
zx87549.9k
London
zx87549.9k wrote:

Transpose the dataframe/matrix so that OTUs are the sets, then convert into logical, then plot:

# example data
df1 <- read.table(text = "SampleA SampleB SampleC
OTU1         5               6              0
OTU2         3               1              2
OTU3         1               0              1
OTU4         0               0              2", header = TRUE, stringsAsFactors = FALSE)


library(gplots)

venn(t(df1 > 0))
ADD COMMENTlink written 20 months ago by zx87549.9k

Note that the venn() function from gplots is limited to a small number of sets

ADD REPLYlink modified 20 months ago • written 20 months ago by Jean-Karim Heriche24k

True, not sure what OP wants, OTUs as sets or samples as sets, in their example both less than 5 sets. So 4 set Venn should be OK. Agreed, UpSet is more suitable when sets are more than 4.

ADD REPLYlink written 20 months ago by zx87549.9k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2219 users visited in the last hour
_