Skip to contents

UpSet Plot shows intersections by DE indications

Usage

upSetPlotTools(
  df,
  condition = "condition_default",
  pathOut = ".",
  writeData = TRUE
)

Arguments

df

data.frame: output by 'listDeByTool' function.

condition

string: name of analysed experminet (default: "condition_default")

pathOut

string: path to write a pdf file with upset Plot (default: ".")

writeData

boolean: TRUE if want write a PDF file (default: TRUE)

Value

data.frame with row sum by input df

Examples

set.seed(42)
counts <- matrix(
  as.integer(c(
    rnbinom(200, mu = 10, size = 1),
    rnbinom(200, mu = 100, size = 1)
  )),
  nrow = 100,
  dimnames = list(
    paste0("gene", seq_len(100)),
    paste0("sample", seq_len(4))
  )
)
groups_info <- c("control", "control", "treated", "treated")
treats <- c("control", "treated")
cons_result <- runExpression(2, treats,
  rDataFrameCount = counts,
  sepCharacter = ",", experimentName = "test_cons",
  outDirPath = "."
)
#> calcNormFactors has been renamed to normLibSizes
#> Using classic mode.
#> baySeq libsizes
#> baySeq getPriors
#> Finding priors...
#> Warning: The '@replicates' slot is not a factor; converting now.
#> done.
#> Finding posterior likelihoods...
#> Length of priorReps:0
#> Length of priorSubset:100
#> Length of subset:100
#> Length of postRows:100
#> Analysing part 1 of 1
#> Preparing data...
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> .
#> done.
#> Estimating likelihoods...
#> ...done!
#> .
#> done.
#> Available columns in results_raw:
#> Warning: ‘>=’ not meaningful for factors
#> calcNormFactors has been renamed to normLibSizes
#> Removing intercept from test coefficients
#> [1] "Computing (M,D) values..."
#> [1] "Computing probability of differential expression..."
#> Warning: `expect_is()` was deprecated in the 3rd edition.
#> ℹ Use `expect_type()`, `expect_s3_class()`, or `expect_s4_class()` instead
#> Warning: `expect_is()` was deprecated in the 3rd edition.
#> ℹ Use `expect_type()`, `expect_s3_class()`, or `expect_s4_class()` instead
#> Warning: `expect_is()` was deprecated in the 3rd edition.
#> ℹ Use `expect_type()`, `expect_s3_class()`, or `expect_s4_class()` instead
#> Initial number of DE patterns = 2
#> Final number of DE patterns = 2
#> Warning: DESeq2 skipped: controlGroup='' and/or contrastGroup='' not found in groupName.
#> Estimating sequencing depths...
#> Resampling to get new data matrices...
#> perm= 1
#> perm= 2
#> perm= 3
#> perm= 4
#> perm= 5
#> perm= 6
#> perm= 7
#> perm= 8
#> perm= 9
#> perm= 10
#> perm= 11
#> perm= 12
#> perm= 13
#> perm= 14
#> perm= 15
#> perm= 16
#> perm= 17
#> perm= 18
#> perm= 19
#> perm= 20
#> perm= 21
#> perm= 22
#> perm= 23
#> perm= 24
#> Number of thresholds chosen (all possible thresholds) = 11
#> Getting all the cutoffs for the thresholds...
#> Getting number of false positives in the permutation...
#> Differential expression analysis completed.
expDef_result <- expressionDefinition(resultTool = cons_result, groups = treats)
deByTool <- listDeByTool(
  consexpressionList = cons_result,
  geneNames = rownames(counts),
  deList = expDef_result
)
if (requireNamespace("UpSetR", quietly = TRUE)) {
  upSetPlotData <- upSetPlotTools(
    df = deByTool, condition = "Control_vs_Treat",
    pathOut = ".", writeData = FALSE
  )
}
#> Warning: `aes_string()` was deprecated in ggplot2 3.0.0.
#> ℹ Please use tidy evaluation idioms with `aes()`.
#> ℹ See also `vignette("ggplot2-in-packages")` for more information.
#> ℹ The deprecated feature was likely used in the UpSetR package.
#>   Please report the issue at <https://github.com/hms-dbmi/UpSetR/issues>.
#> Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
#> ℹ Please use `linewidth` instead.
#> ℹ The deprecated feature was likely used in the UpSetR package.
#>   Please report the issue at <https://github.com/hms-dbmi/UpSetR/issues>.
#> Warning: The `size` argument of `element_line()` is deprecated as of ggplot2 3.4.0.
#> ℹ Please use the `linewidth` argument instead.
#> ℹ The deprecated feature was likely used in the UpSetR package.
#>   Please report the issue at <https://github.com/hms-dbmi/UpSetR/issues>.