From 07ffa0417b3b5ace2b26641799c953d8b9aa399f Mon Sep 17 00:00:00 2001 From: QingfeiPan Date: Fri, 18 Oct 2024 19:42:58 -0500 Subject: [PATCH] check() passed --- DESCRIPTION | 4 +++- NAMESPACE | 6 ++++++ R/differential_analysis.R | 2 ++ R/manipulate_sparseEset.R | 4 ++-- R/network_analysis.R | 4 ++++ man/createSparseEset.Rd | 2 +- man/updateSparseEset.Rd | 2 +- 7 files changed, 19 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5c3246e..50cf012 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -17,6 +17,7 @@ Description: scMINER is a mutual information-based framework for single-cell/nuc License: Apache License (>= 2) Encoding: UTF-8 LazyData: TRUE +LazyDataCompression:xz Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.2 Depends: @@ -36,7 +37,8 @@ Imports: pheatmap (>= 1.0.12), reshape2 (>= 1.4.4), rmarkdown (>= 2.8), - sessioninfo (>= 1.2.2) + sessioninfo (>= 1.2.2), + RColorBrewer Suggests: knitr, kableExtra, diff --git a/NAMESPACE b/NAMESPACE index fdb20d2..ed8354a 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,7 +2,10 @@ export(MICAplot) export(addMICAoutput) +export(cal_Activity) +export(combinePvalVector) export(combineSparseEset) +export(compare2groups) export(createProjectSpace) export(createSparseEset) export(drawNetworkQC) @@ -24,12 +27,15 @@ export(getDA) export(getDE) export(getDriverList) export(getTopFeatures) +export(get_net2target_list) +export(get_target_list2matrix) export(normalizeSparseEset) export(readInput_10x.dir) export(readInput_10x.h5) export(readInput_h5ad) export(readInput_table) export(updateSparseEset) +export(z_normalization) exportClasses(SparseExpressionSet) import(Biobase) import(ggplot2) diff --git a/R/differential_analysis.R b/R/differential_analysis.R index a93a6b5..bef2edb 100644 --- a/R/differential_analysis.R +++ b/R/differential_analysis.R @@ -10,6 +10,7 @@ #' @param twosided Logical, whether the input P values are two-sided. If FALSE, the input P values will be treated as one-tailed. Default: `TRUE`. #' #' @return A vector containing "Z-statistics" and "P.Value". +#' @export #' #' @examples #' ## 1. combine P values from a vector @@ -99,6 +100,7 @@ combinePvalVector <- function(pvals, #' #' @return A data frame. Rows are genes/drivers, and columns are 11 statistics of differential analysis. #' @import limma +#' @export #' #' @examples #' ## to call this function diff --git a/R/manipulate_sparseEset.R b/R/manipulate_sparseEset.R index 34d82c1..9025115 100644 --- a/R/manipulate_sparseEset.R +++ b/R/manipulate_sparseEset.R @@ -43,7 +43,7 @@ methods::setClass(Class = "SparseExpressionSet", #' #' ## 2. Create SparseEset with customized meta data #' true_label <- read.table(system.file("extdata/demo_pbmc14k/PBMC14k_trueLabel.txt.gz", package = "scMINER"), -#' header = T, row.names = 1, sep = "\t", quote = "", stringsAsFactors = FALSE) +#' header = TRUE, row.names = 1, sep = "\t", quote = "", stringsAsFactors = FALSE) #' pbmc14k_raw.eset <- createSparseEset(input_matrix = pbmc14k_rawCount, #' cellData = true_label, #' featureData = NULL, @@ -304,7 +304,7 @@ combineSparseEset <- function(eset_list, #' pbmc14k_raw.eset <- updateSparseEset(input_eset = pbmc14k_expression.eset, addMetaData = TRUE) #' #' ## 2. Update the meta data of cells: with this, the user can add more information of cells, like clustering results, cell type. -#' true_label <- read.table(system.file("extdata/demo_pbmc14k/PBMC14k_trueLabel.txt.gz", package = "scMINER"), header = T, row.names = 1, sep = "\t", quote = "", stringsAsFactors = FALSE) +#' true_label <- read.table(system.file("extdata/demo_pbmc14k/PBMC14k_trueLabel.txt.gz", package = "scMINER"), header = TRUE, row.names = 1, sep = "\t", quote = "", stringsAsFactors = FALSE) #' pbmc14k_raw.eset <- updateSparseEset(input_eset = pbmc14k_expression.eset, cellData = true_label, addMetaData = TRUE) #' updateSparseEset <- function(input_eset, diff --git a/R/network_analysis.R b/R/network_analysis.R index 18f8c32..668f195 100644 --- a/R/network_analysis.R +++ b/R/network_analysis.R @@ -617,6 +617,7 @@ drawNetworkQC <- function(network_file = NULL, #' @param x a vector of numbers for z-normalization #' #' @return a vector of numbers with z-normalized +#' @export #' #' @examples z_normalization(c(1,2,3,4,5,NA,6,7,8,9)) z_normalization <- function(x) { @@ -634,6 +635,7 @@ z_normalization <- function(x) { #' @param net_dat a data frame generated from SJARANCe network file. These columns are needed: "`source`", "`target`", "`MI`" and "`spearman`". #' #' @return A list of source genes, for each source gene, the value is a data frame with "`target`", "`MI`" and "`spearman`" as the columns +#' @export #' #' @examples #' net_data <- read.table(system.file("extdata/demo_pbmc14k/SJARACNe/B/TF/bt100_pc001/consensus_network_ncol_.txt", package = "scMINER"), @@ -676,6 +678,7 @@ get_net2target_list <- function(net_dat = NULL) { #' #' @return If "`weightedmean`" is given, it returns a matrix of signed (by Spearman correlation coefficient) mutual information, the sign of which will be used for activity calculation. For #' all the other methods ("`mean`", "`absmean`" or "`maxmean`"), it returns a matrix of 1. +#' @export #' #' @examples #' net_data <- read.table(system.file("extdata/demo_pbmc14k/SJARACNe/B/TF/bt100_pc001/consensus_network_ncol_.txt", package = "scMINER"), @@ -710,6 +713,7 @@ get_target_list2matrix <- function(target_list = NULL, activity_method = 'mean') #' @param do.std Logical, whether to do the z-normalization on the gene expression values in each sample. Default: `TRUE`. #' #' @return a matrix of activities, drivers by cells +#' @export #' #' @examples #' net_data <- read.table(system.file("extdata/demo_pbmc14k/SJARACNe/B/TF/bt100_pc001/consensus_network_ncol_.txt", package = "scMINER"), diff --git a/man/createSparseEset.Rd b/man/createSparseEset.Rd index 9ea49b6..47f5160 100644 --- a/man/createSparseEset.Rd +++ b/man/createSparseEset.Rd @@ -53,7 +53,7 @@ pbmc14k_raw.eset <- createSparseEset(input_matrix = pbmc14k_rawCount, ## 2. Create SparseEset with customized meta data true_label <- read.table(system.file("extdata/demo_pbmc14k/PBMC14k_trueLabel.txt.gz", package = "scMINER"), - header = T, row.names = 1, sep = "\t", quote = "", stringsAsFactors = FALSE) + header = TRUE, row.names = 1, sep = "\t", quote = "", stringsAsFactors = FALSE) pbmc14k_raw.eset <- createSparseEset(input_matrix = pbmc14k_rawCount, cellData = true_label, featureData = NULL, diff --git a/man/updateSparseEset.Rd b/man/updateSparseEset.Rd index c4bc978..12052a6 100644 --- a/man/updateSparseEset.Rd +++ b/man/updateSparseEset.Rd @@ -36,7 +36,7 @@ data("pbmc14k_expression.eset") pbmc14k_raw.eset <- updateSparseEset(input_eset = pbmc14k_expression.eset, addMetaData = TRUE) ## 2. Update the meta data of cells: with this, the user can add more information of cells, like clustering results, cell type. -true_label <- read.table(system.file("extdata/demo_pbmc14k/PBMC14k_trueLabel.txt.gz", package = "scMINER"), header = T, row.names = 1, sep = "\t", quote = "", stringsAsFactors = FALSE) +true_label <- read.table(system.file("extdata/demo_pbmc14k/PBMC14k_trueLabel.txt.gz", package = "scMINER"), header = TRUE, row.names = 1, sep = "\t", quote = "", stringsAsFactors = FALSE) pbmc14k_raw.eset <- updateSparseEset(input_eset = pbmc14k_expression.eset, cellData = true_label, addMetaData = TRUE) }