From 6e8d047705de50d1ae46899698a201915da64c73 Mon Sep 17 00:00:00 2001 From: mbcole Date: Mon, 14 Nov 2016 16:18:36 -0800 Subject: [PATCH] Added example for factor sample filter --- R/sample_filtering.R | 9 +++++++++ man/factor_sample_filter.Rd | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/R/sample_filtering.R b/R/sample_filtering.R index a9f5fa0..03e700b 100644 --- a/R/sample_filtering.R +++ b/R/sample_filtering.R @@ -426,6 +426,15 @@ metric_sample_filter = function(expr, nreads = colSums(expr), ralign = NULL, #' @importFrom diptest dip.test #' @import gplots #' @export +#' +#' @examples +#' mat <- matrix(rpois(1000, lambda = 5), ncol=10) +#' colnames(mat) <- paste("X", 1:ncol(mat), sep="") +#' qc = as.matrix(cbind(colSums(mat),colSums(mat > 0))) +#' rownames(qc) = colnames(mat) +#' colnames(qc) = c("NCOUNTS","NGENES") +#' mfilt = factor_sample_filter(expr = mat,qc, plot = TRUE,qual_select_q_thresh = 1) +#' factor_sample_filter = function(expr, qual, gene_filter = NULL, max_exp_pcs = 5, qual_select_q_thresh = 0.01, force_metrics = NULL, good_metrics = NULL, min_qual_variance = 0.7, zcut = 1, diff --git a/man/factor_sample_filter.Rd b/man/factor_sample_filter.Rd index cbe93b9..1717d63 100644 --- a/man/factor_sample_filter.Rd +++ b/man/factor_sample_filter.Rd @@ -49,4 +49,13 @@ describing whether it passed filtering by factor-based filtering, using PCA of q \details{ None } +\examples{ +mat <- matrix(rpois(1000, lambda = 5), ncol=10) +colnames(mat) <- paste("X", 1:ncol(mat), sep="") +qc = as.matrix(cbind(colSums(mat),colSums(mat > 0))) +rownames(qc) = colnames(mat) +colnames(qc) = c("NCOUNTS","NGENES") +mfilt = factor_sample_filter(expr = mat,qc, plot = TRUE,qual_select_q_thresh = 1) + +}