Description Usage Arguments Value Author(s) Examples
generate the dataset for upset of UpSetR
1 2 3 4 5 6 7 |
obj |
object, phyloseq or data.frame, if it is data.frame, the shape of it should be row sample * columns features. |
..., |
additional parameters. |
sampleda |
data.frame, if the obj is data.frame, the sampleda should be provided. |
factorNames |
character, the column names of factor in sampleda |
threshold |
integer, default is 0. |
a data.frame for the input of 'upset' of 'UpSetR'.
Shuangbin Xu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | data(test_otu_data)
upsetda <- get_upset(test_otu_data, factorNames="group")
otudafile <- system.file("extdata", "otu_tax_table.txt",
package="MicrobiotaProcess")
samplefile <- system.file("extdata","sample_info.txt",
package="MicrobiotaProcess")
otuda <- read.table(otudafile, sep="\t", header=TRUE,
row.names=1, check.names=FALSE,
skip=1, comment.char="")
sampleda <- read.table(samplefile,sep="\t",
header=TRUE, row.names=1)
head(sampleda)
otuda <- otuda[sapply(otuda, is.numeric)]
otuda <- data.frame(t(otuda), check.names=FALSE)
head(otuda[1:5, 1:5])
upsetda2 <- get_upset(obj=otuda, sampleda=sampleda,
factorNames="group")
#Then you can use `upset` of `UpSetR` to visualize the results.
#library(UpSetR)
#upset(upsetda, sets=c("B","D","M","N"), sets.bar.color = "#56B4E9",
# order.by = "freq", empty.intersections = "on")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.