get_upset: generate the dataset for upset of UpSetR

Description Usage Arguments Value Author(s) Examples

Description

generate the dataset for upset of UpSetR

Usage

1
2
3
4
5
6
7
get_upset(obj, ...)

## S4 method for signature 'data.frame'
get_upset(obj, sampleda, factorNames, threshold = 0)

## S4 method for signature 'phyloseq'
get_upset(obj, ...)

Arguments

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.

Value

a data.frame for the input of 'upset' of 'UpSetR'.

Author(s)

Shuangbin Xu

Examples

 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")

MicrobiotaProcess documentation built on April 18, 2021, 6 p.m.