diff --git a/.Rbuildignore b/.Rbuildignore index e683635..58508a7 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -8,4 +8,5 @@ ^.Rhistory$ ^.RData$ ^.gitignore$ -^.travis.yml$ \ No newline at end of file +^.travis.yml$ +^_gh_pages$ diff --git a/DESCRIPTION b/DESCRIPTION index 82a31f6..d6d9364 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: chromVAR Type: Package Title: Chromatin Variation Across Regions -Version: 0.99.0.9999 +Version: 0.99.1 Date: 2016-12-20 Authors@R: c( person("Alicia", "Schep", email = "aschep@gmail.com", role = c("aut","cre")), @@ -52,8 +52,6 @@ Suggests: rmarkdown, pheatmap, motifmatchr -Remotes: - GreenleafLab/motifmatchr biocViews: SingleCell, Sequencing, GeneRegulation LazyData: TRUE LinkingTo: Rcpp, RcppArmadillo diff --git a/NAMESPACE b/NAMESPACE index 927e777..2a59c99 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,33 +1,19 @@ # Generated by roxygen2: do not edit by hand export(addGCBias) -export(add_gc_bias) export(annotationMatches) -export(annotation_matches) export(assembleKmers) -export(assemble_kmers) export(chromVAR_theme) export(computeDeviations) export(computeExpectations) export(computeVariability) -export(compute_deviations) -export(compute_expectations) -export(compute_variability) -export(deviation_scores) export(deviationsCovariability) export(deviationsTsne) -export(deviations_covariability) -export(deviations_tsne) export(differentialDeviations) export(differentialVariability) -export(differential_deviations) -export(differential_variability) export(filterPeaks) export(filterSamples) export(filterSamplesPlot) -export(filter_peaks) -export(filter_samples) -export(filter_samples_plot) export(getAnnotationCorrelation) export(getAnnotationSynergy) export(getAnnotations) @@ -43,37 +29,14 @@ export(getSampleCorrelation) export(getSampleDepths) export(getSampleDistance) export(getTotalFragments) -export(get_annotation_correlation) -export(get_annotation_synergy) -export(get_annotations) -export(get_background_peaks) -export(get_cis_groups) -export(get_counts) -export(get_fragments_per_peak) -export(get_fragments_per_sample) -export(get_jaspar_motifs) -export(get_peaks) -export(get_permuted_data) -export(get_sample_correlation) -export(get_sample_depths) -export(get_sample_distance) -export(get_total_fragments) export(makeBiasBins) export(makePermutedSets) -export(make_bias_bins) -export(make_permuted_sets) export(matchKmers) -export(match_kmers) export(plotDeviationsTsne) export(plotKmerMismatch) export(plotVariability) -export(plot_deviations_tsne) -export(plot_kmer_mismatch) -export(plot_variability) export(pwmDistance) -export(pwm_distance) export(readNarrowpeaks) -export(read_macs2_narrowpeaks) exportMethods("annotationMatches<-") exportMethods('counts<-') exportMethods(addGCBias) diff --git a/R/deprecated.R b/R/deprecated.R deleted file mode 100644 index f4cea0d..0000000 --- a/R/deprecated.R +++ /dev/null @@ -1,365 +0,0 @@ -#' Deprecated functions in chromVAR -#' -#' chromVAR has moved functions and methods to camelCase from snake_case. -#' The following functions have been deprecated and replaced with a different -#' name: -#' \itemize{ -#' \item get_annotation_synergy is now \code{\link{getAnnotationSynergy}} -#' \item make_bias_bins is now \code{\link{makeBiasBins}} -#' \item make_permuted_sets is now \code{\link{makePermutedSets}} -#' \item pwm_distance is now \code{\link{pwmDistance}} -#' \item plot_variability is now \code{\link{plotVariability}} -#' \item plot_deviations_tsne is now \code{\link{plotDeviationsTsne}} -#' \item get_jaspar_motifs is now \code{\link{getJasparMotifs}} -#' \item match_kmers is now \code{\link{matchKmers}} -#' \item deviations_covariability is now \code{\link{deviationsCovariability}} -#' \item plot_kmer_mismatch is now \code{\link{plotKmerMismatch}} -#' \item get_total_fragments is now \code{\link{getTotalFragments}} -#' \item get_fragments_per_peak is now \code{\link{getFragmentsPerPeak}} -#' \item get_fragments_per_sample is now \code{\link{getFragmentsPerSample}} -#' \item get_peaks is now \code{\link{getPeaks}} -#' \item get_counts is now \code{\link{getCounts}} -#' \item get_sample_depths is now \code{\link{getSampleDepths}} -#' \item read_macs2_narrowpeaks is now \code{\link{readNarrowpeaks}} -#' \item get_annotations is now \code{\link{getAnnotations}} -#' \item filter_samples is now \code{\link{filterSamples}} -#' \item filter_samples_plot is now \code{\link{filterSamplesPlot}} -#' \item filter_peaks is now \code{\link{filterPeaks}} -#' \item annotation_matches is now \code{\link{annotationMatches}} -#' \item deviations_tsne is now \code{\link{deviationsTsne}} -#' \item differential_deviations is now \code{\link{differentialDeviations}} -#' \item differential_variability is now \code{\link{differentialVariability}} -#' \item compute_variability is now \code{\link{computeVariability}} -#' \item compute_expectations is now \code{\link{computeExpectations}} -#' \item computeDeviations is now \code{\link{computeDeviations}} -#' \item deviation_scores is now \code{\link{deviationScores}} -#' \item get_sample_distance is now \code{\link{getSampleDistance}} -#' \item get_sample_correlation is now \code{\link{getSampleCorrelation}} -#' \item get_cis_groups is now \code{\link{getCisGroups}} -#' \item add_gc_bias is now \code{\link{addGCBias}} -#' \item get_background_peaks is now \code{\link{getBackgroundPeaks}} -#' \item get_permuted_data is now \code{\link{getPermutedData}} -#' \item assemble_kmers is now \code{\link{assembleKmers}} -#' } -#' @author Alicia Schep -#' @rdname chromVAR_deprecated -#' @param ... arguments passed to new function -#' @return calls the replacement functions -#' @name chromVAR_deprecated -NULL - -#' @rdname chromVAR_deprecated -#' @export -assemble_kmers <- function(...) -{ - .Deprecated("assembleKmers") - assembleKmers(...) -} - -#' @rdname chromVAR_deprecated -#' @export -get_annotation_synergy <- function(...) -{ - .Deprecated("getAnnotationSynergy") - getAnnotationSynergy(...) -} - -#' @rdname chromVAR_deprecated -#' @export -get_annotation_correlation <- function(...) -{ - .Deprecated("getAnnotationCorrelation") - getAnnotationCorrelation(...) -} - -#' @rdname chromVAR_deprecated -#' @export -make_bias_bins <- function(...) -{ - .Deprecated("makeBiasBins") - makeBiasBins(...) -} - -#' @rdname chromVAR_deprecated -#' @export -make_permuted_sets <- function(...) -{ - .Deprecated("makePermutedSets") - makeBiasBins(...) -} - -#' @rdname chromVAR_deprecated -#' @export -pwm_distance <- function(...) -{ - .Deprecated("pwmDistance") - makeBiasBins(...) -} - -#' @rdname chromVAR_deprecated -#' @export -plot_variability <- function(...) -{ - .Deprecated("plotVariability") - plotVariability(...) -} - -#' @rdname chromVAR_deprecated -#' @export -plot_deviations_tsne <- function(...) -{ - .Deprecated("plotDeviationsTsne") - plotDeviationsTsne(...) -} - -#' @rdname chromVAR_deprecated -#' @export -get_jaspar_motifs <- function(...) -{ - .Deprecated("getJasparMotifs") - getJasparMotifs(...) -} - -#' @rdname chromVAR_deprecated -#' @export -match_kmers <- function(...) -{ - .Deprecated("matchKmers") - matchKmers(...) -} - -#' @rdname chromVAR_deprecated -#' @export -deviations_covariability <- function(...) -{ - .Deprecated("deviationsCovariability") - deviationsCovariability(...) -} - -#' @rdname chromVAR_deprecated -#' @export -plot_kmer_mismatch <- function(...) -{ - .Deprecated("plotKmerMismatch") - plotKmerMismatch(...) -} - -#' @rdname chromVAR_deprecated -#' @export -get_total_fragments <- function(...) -{ - .Deprecated("getTotalFragments") - getTotalFragments(...) -} - -#' @rdname chromVAR_deprecated -#' @export -get_fragments_per_peak <- function(...) -{ - .Deprecated("getFragmentsPerPeak") - getFragmentsPerPeak(...) -} - -#' @rdname chromVAR_deprecated -#' @export -get_fragments_per_sample <- function(...) -{ - .Deprecated("getFragmentsPerSample") - getFragmentsPerSample(...) -} - -#' @rdname chromVAR_deprecated -#' @export -get_peaks <- function(...) -{ - .Deprecated("getPeaks") - getPeaks(...) -} - -#' @rdname chromVAR_deprecated -#' @export -get_counts <- function(...) -{ - .Deprecated("getCounts") - getCounts(...) -} - -#' @rdname chromVAR_deprecated -#' @export -get_sample_depths <- function(...) -{ - .Deprecated("getSampleDepths") - getSampleDepths(...) -} - -#' @rdname chromVAR_deprecated -#' @export -read_macs2_narrowpeaks <- function(...) -{ - .Deprecated("readNarrowpeaks") - readNarrowpeaks(...) -} - -#' @rdname chromVAR_deprecated -#' @export -get_annotations <- function(...) -{ - .Deprecated("getAnnotations") - getAnnotations(...) -} - -#' @rdname chromVAR_deprecated -#' @export -filter_samples <- function(...) -{ - .Deprecated("filterSamples") - filterSamples(...) -} - -#' @rdname chromVAR_deprecated -#' @export -filter_samples_plot <- function(...) -{ - .Deprecated("filterSamplesPlot") - filterSamplesPlot(...) -} - -#' @rdname chromVAR_deprecated -#' @export -filter_peaks <- function(...) -{ - .Deprecated("filterPeaks") - filterPeaks(...) -} - -#' @rdname chromVAR_deprecated -#' @export -annotation_matches <- function(...) -{ - .Deprecated("annotationMatches") - annotationMatches(...) -} - -#' @rdname chromVAR_deprecated -#' @export -deviations_tsne <- function(...) -{ - .Deprecated("deviationsTsne") - deviationsTsne(...) -} - -#' @rdname chromVAR_deprecated -#' @export -differential_deviations <- function(...) -{ - .Deprecated("differentialDeviations") - differentialDeviations(...) -} - -#' @rdname chromVAR_deprecated -#' @export -differential_variability <- function(...) -{ - .Deprecated("differentialVariability") - differentialVariability(...) -} - -#' @rdname chromVAR_deprecated -#' @export -compute_variability <- function(...) -{ - .Deprecated("computeVariability") - computeVariability(...) -} - -#' @rdname chromVAR_deprecated -#' @export -compute_expectations <- function(...) -{ - .Deprecated("computeExpectations") - computeExpectations(...) -} - -#' @rdname chromVAR_deprecated -#' @export -compute_deviations <- function(...) -{ - .Deprecated("computeDeviations") - computeDeviations(...) -} - -#' @rdname chromVAR_deprecated -#' @export -deviation_scores <- function(...) -{ - .Deprecated("deviationScores") - deviationScores(...) -} - -#' @rdname chromVAR_deprecated -#' @export -get_sample_distance <- function(...) -{ - .Deprecated("getSampleDistance") - getSampleDistance(...) -} - -#' @rdname chromVAR_deprecated -#' @export -get_sample_correlation <- function(...) -{ - .Deprecated("getSampleCorrelation") - getSampleCorrelation(...) -} - -#' @rdname chromVAR_deprecated -#' @export -get_cis_groups <- function(...) -{ - .Deprecated("getCisGroups") - getCisGroups(...) -} - -#' @rdname chromVAR_deprecated -#' @export -add_gc_bias <- function(...) -{ - .Deprecated("addGCBias") - addGCBias(...) -} - -#' @rdname chromVAR_deprecated -#' @export -get_background_peaks <- function(...) -{ - .Deprecated("getBackgroundPeaks") - getBackgroundPeaks(...) -} - -#' @rdname chromVAR_deprecated -#' @export -get_permuted_data <- function(...) -{ - .Deprecated("getPermutedData") - getPermutedData(...) -} - - - - - - - - - - - - - - - - - - - - diff --git a/R/filtering.R b/R/filtering.R index 67bbeab..d23737c 100644 --- a/R/filtering.R +++ b/R/filtering.R @@ -218,7 +218,7 @@ bias_skew <- function(object, nbins = 10, expectation = NULL, bias_bins <- split(seq_len(nrow(object)), bias_cut) if (is.null(expectation)) { - expectation <- compute_expectations(object) + expectation <- computeExpectations(object) } else { stopifnot(length(expectation) == nrow(object)) } diff --git a/R/kmers.R b/R/kmers.R index d174a47..340578a 100644 --- a/R/kmers.R +++ b/R/kmers.R @@ -89,6 +89,13 @@ get_mm_kmers <- function(kmer) { return(out) } +expected_n_overlap_kmers <- function(max_extend){ + if (max_extend == 0){ + return(0) + } else{ + return(4**(max_extend) + expected_n_overlap_kmers(max_extend - 1)) + } +} get_overlap_kmers <- function(kmer, max_extend, dir = "both") { out <- c() @@ -140,12 +147,12 @@ get_overlap_kmers <- function(kmer, max_extend, dir = "both") { return(c(out1, out2, vapply(out1, get_overlap_kmers, - rep("",4**(max_extend -1)), + rep("", expected_n_overlap_kmers(max_extend - 1)), max_extend = max_extend - 1, dir = "left"), vapply(out2, get_overlap_kmers, - rep("",4**(max_extend -1)), + rep("", expected_n_overlap_kmers(max_extend - 1)), max_extend = max_extend - 1, dir = "right"))) } else if (dir == "left") { @@ -157,7 +164,7 @@ get_overlap_kmers <- function(kmer, max_extend, dir = "both") { USE.NAMES = FALSE) return(c(out1, vapply(out1, get_overlap_kmers, - rep("",4 ** (max_extend -1)), + rep("", expected_n_overlap_kmers(max_extend - 1)), max_extend = max_extend - 1, dir = "left"))) } else if (dir == "right") { @@ -169,7 +176,7 @@ get_overlap_kmers <- function(kmer, max_extend, dir = "both") { return(c(out2, vapply(out2, get_overlap_kmers, - rep("", 4 ** (max_extend - 1)), + rep("", expected_n_overlap_kmers(max_extend - 1)), max_extend = max_extend - 1, dir = "right"))) } diff --git a/R/match_kmers.R b/R/match_kmers.R index 31a08c2..917445c 100644 --- a/R/match_kmers.R +++ b/R/match_kmers.R @@ -91,7 +91,7 @@ match_kmers_helper <- function(seqs, kmers, out, ranges) { #' @param ranges if subject is not GenomicRanges, ranges to use when out is #' positions #' @param ... additional arguments -#' @seealso \code{\link{get_annotations}}, \code{\link{computeDeviations}} +#' @seealso \code{\link{getAnnotations}}, \code{\link{computeDeviations}} #' @details Can either return a SummarizedExperiment with just sparse matrix #' with values set to 1 for a match (if return == 'matches'), or a #' GenomicRanges object with all the positions of matches diff --git a/R/plotting.R b/R/plotting.R index 5c34080..2f5313b 100644 --- a/R/plotting.R +++ b/R/plotting.R @@ -3,7 +3,7 @@ #' plotVariability #' #' plot variability of motifs/etc -#' @param variability output from \code{\link{compute_variability}} +#' @param variability output from \code{\link{computeVariability}} #' @param xlab label for x-axis (default is 'Sorted TFs') #' @param n number of toppoints to label? #' @param labels names of sets. if not given, uses rownames of variability @@ -111,7 +111,7 @@ variability_table <- function(var_df) { #' #' plots sample similarity tsne #' @param object deviations result object -#' @param tsne result from \code{\link{deviations_tsne}} +#' @param tsne result from \code{\link{deviationsTsne}} #' @param var_df variability result #' @param sample_column column name for sample data -- colData(object) -- to be #' used for coloring points @@ -134,7 +134,7 @@ plotDeviationsTsne <- function(object, if (nrow(tsne) != ncol(object)){ stop("Number of rows of tsne do not match number of columns of object. ", - " plotDeviationsTsne takes result of deviations_tsne for samples") + " plotDeviationsTsne takes result of deviationsTsne for samples") } if (shiny) @@ -200,7 +200,7 @@ plot_deviations_tsne_shiny <- function(object, tsne, var_df, annotation_column) { if (is.null(var_df)) - var_df <- compute_variability(object) + var_df <- computeVariability(object) if ("tsne" %in% names(tsne)) tsne <- tsne$tsne diff --git a/R/pwm_dist.R b/R/pwm_dist.R index fb6a9cf..4aa2665 100644 --- a/R/pwm_dist.R +++ b/R/pwm_dist.R @@ -58,8 +58,9 @@ pwm_to_prob <- function(pwms) { } else if (inherits(pwms, "PFMatrixList")) { out <- lapply(pwms, pfm_to_prob_helper) }else if (inherits(pwms, "list")) { - stopifnot(all(vapply(pwms, function(x) all(colSums(x) == ncol(x)), - TRUE))) + stopifnot(all(vapply(pwms, function(x){ + all(abs(colSums(x) - 1) < 10e-5)}, + TRUE))) out <- pwms } else { stop("incorrect input format, must be PWMatrix,PWMatrixList, matrix, diff --git a/R/variability_synergy.R b/R/variability_synergy.R index c7f6bd3..562fac3 100644 --- a/R/variability_synergy.R +++ b/R/variability_synergy.R @@ -6,7 +6,7 @@ #' @param background_peaks optional, matrix of background peaks #' @param variabilities optional, variabilities computed from computeVariability #' @param expectation optional, expected fraction of reads per peak, as computed -#' by compute_expectations +#' by computeExpectations #' @param nbg number of background iterations #' @param ... additional arguments #' @details should only be run on small number of motifs/kmers/peaksets @@ -109,7 +109,7 @@ setMethod("getAnnotationSynergy", c(object = "MatrixOrmatrix", setMethod("getAnnotationSynergy", c(object = "MatrixOrmatrix", annotations = "MatrixOrmatrix"), function(object, annotations, background_peaks, - expectation = compute_expectations(object), + expectation = computeExpectations(object), variabilities = NULL, nbg = 25) { stopifnot(canCoerce(annotations, "lMatrix")) annotations <- as(annotations, "lMatrix") @@ -129,7 +129,7 @@ setMethod("getAnnotationSynergy", c(object = "MatrixOrmatrix", setMethod("getAnnotationSynergy", c(object = "MatrixOrmatrix", annotations = "list"), function(object, annotations, background_peaks, - expectation = compute_expectations(object), + expectation = computeExpectations(object), variabilities = NULL, nbg = 25) { getAnnotationSynergy_core(object, annotations, background_peaks, @@ -210,7 +210,7 @@ getAnnotationSynergy_core <- function(counts_mat, #' @param variabilities optional, variabilities computed from #' computeVariability #' @param expectation optional, expected fraction of reads per peak, as computed -#' by compute_expectations +#' by computeExpectations #' @param ... additional arguments #' @details should only be run on small number of motifs/kmers/peaksets #' (very slow!) @@ -230,8 +230,8 @@ setGeneric("getAnnotationCorrelation", setMethod("getAnnotationCorrelation", c(object = "SummarizedExperiment", annotations = "SummarizedExperiment"), function(object, annotations, - background_peaks = get_background_peaks(object), - expectation = compute_expectations(object), + background_peaks = getBackgroundPeaks(object), + expectation = computeExpectations(object), variabilities = NULL) { object <- counts_check(object) annotations <- matches_check(annotations) @@ -249,8 +249,8 @@ setMethod("getAnnotationCorrelation", c(object = "SummarizedExperiment", setMethod("getAnnotationCorrelation", c(object = "SummarizedExperiment", annotations = "MatrixOrmatrix"), function(object, annotations, - background_peaks = get_background_peaks(object), - expectation = compute_expectations(object), + background_peaks = getBackgroundPeaks(object), + expectation = computeExpectations(object), variabilities = NULL) { stopifnot(canCoerce(annotations, "lMatrix")) annotations <- as(annotations, "lMatrix") @@ -271,8 +271,8 @@ setMethod("getAnnotationCorrelation", c(object = "SummarizedExperiment", annotations = "list"), function(object, annotations, - background_peaks = get_background_peaks(object), - expectation = compute_expectations(object), + background_peaks = getBackgroundPeaks(object), + expectation = computeExpectations(object), variabilities = NULL) { object <- counts_check(object) getAnnotationCorrelation_core(counts(object), @@ -291,7 +291,7 @@ setMethod("getAnnotationCorrelation", c(object = "MatrixOrmatrix", function(object, annotations, background_peaks, - expectation = compute_expectations(object), + expectation = computeExpectations(object), variabilities = NULL) { annotations <- matches_check(annotations) peak_indices <- convert_to_ix_list(annotationMatches(annotations)) @@ -308,7 +308,7 @@ setMethod("getAnnotationCorrelation", c(object = "MatrixOrmatrix", setMethod("getAnnotationCorrelation", c(object = "MatrixOrmatrix", annotations = "MatrixOrmatrix"), function(object, annotations, background_peaks, - expectation = compute_expectations(object), + expectation = computeExpectations(object), variabilities = NULL) { stopifnot(canCoerce(annotations, "lMatrix")) annotations <- as(annotations, "lMatrix") @@ -327,7 +327,7 @@ setMethod("getAnnotationCorrelation", c(object = "MatrixOrmatrix", setMethod("getAnnotationCorrelation", c(object = "MatrixOrmatrix", annotations = "list"), function(object, annotations, background_peaks, - expectation = compute_expectations(object), + expectation = computeExpectations(object), variabilities = NULL) { getAnnotationCorrelation_core(object, annotations, background_peaks, expectation, diff --git a/README.md b/README.md index 1d80da8..c498b79 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # chromVAR -chromVAR is an R package for the analysis of sparse chromatin accessibility data from single cell or bulk ATAC or DNAse-seq data. The package aims to identify motifs or other genomic annotations associated with variability in chromatin accessibility between individual cells or samples. For a more detail overview of the method, please see the [publication](https://www.nature.com/nmeth/journal/vaop/ncurrent/full/nmeth.4401.html) or [preprint](https://www.biorxiv.org/content/early/2017/02/21/110346). +chromVAR is an R package for the analysis of sparse chromatin accessibility data from single cell or bulk ATAC or DNAse-seq data. The package aims to identify motifs or other genomic annotations associated with variability in chromatin accessibility between individual cells or samples. For a more detail overview of the method, please see the [publication](https://www.nature.com/nmeth/journal/vaop/ncurrent/full/nmeth.4401.html) ([pdf](http://greenleaf.stanford.edu/assets/pdf/nmeth.4401.pdf), [supplement](https://drive.google.com/file/d/0B8eUn6ZURmqvUjBCbE5Hc0p4UFU/view?usp=sharing)). ## Note on recent function name changes diff --git a/man/chromVAR_deprecated.Rd b/man/chromVAR_deprecated.Rd deleted file mode 100644 index 0b22ecc..0000000 --- a/man/chromVAR_deprecated.Rd +++ /dev/null @@ -1,169 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/deprecated.R -\name{chromVAR_deprecated} -\alias{chromVAR_deprecated} -\alias{assemble_kmers} -\alias{get_annotation_synergy} -\alias{get_annotation_correlation} -\alias{make_bias_bins} -\alias{make_permuted_sets} -\alias{pwm_distance} -\alias{plot_variability} -\alias{plot_deviations_tsne} -\alias{get_jaspar_motifs} -\alias{match_kmers} -\alias{deviations_covariability} -\alias{plot_kmer_mismatch} -\alias{get_total_fragments} -\alias{get_fragments_per_peak} -\alias{get_fragments_per_sample} -\alias{get_peaks} -\alias{get_counts} -\alias{get_sample_depths} -\alias{read_macs2_narrowpeaks} -\alias{get_annotations} -\alias{filter_samples} -\alias{filter_samples_plot} -\alias{filter_peaks} -\alias{annotation_matches} -\alias{deviations_tsne} -\alias{differential_deviations} -\alias{differential_variability} -\alias{compute_variability} -\alias{compute_expectations} -\alias{compute_deviations} -\alias{deviation_scores} -\alias{get_sample_distance} -\alias{get_sample_correlation} -\alias{get_cis_groups} -\alias{add_gc_bias} -\alias{get_background_peaks} -\alias{get_permuted_data} -\title{Deprecated functions in chromVAR} -\usage{ -assemble_kmers(...) - -get_annotation_synergy(...) - -get_annotation_correlation(...) - -make_bias_bins(...) - -make_permuted_sets(...) - -pwm_distance(...) - -plot_variability(...) - -plot_deviations_tsne(...) - -get_jaspar_motifs(...) - -match_kmers(...) - -deviations_covariability(...) - -plot_kmer_mismatch(...) - -get_total_fragments(...) - -get_fragments_per_peak(...) - -get_fragments_per_sample(...) - -get_peaks(...) - -get_counts(...) - -get_sample_depths(...) - -read_macs2_narrowpeaks(...) - -get_annotations(...) - -filter_samples(...) - -filter_samples_plot(...) - -filter_peaks(...) - -annotation_matches(...) - -deviations_tsne(...) - -differential_deviations(...) - -differential_variability(...) - -compute_variability(...) - -compute_expectations(...) - -compute_deviations(...) - -deviation_scores(...) - -get_sample_distance(...) - -get_sample_correlation(...) - -get_cis_groups(...) - -add_gc_bias(...) - -get_background_peaks(...) - -get_permuted_data(...) -} -\arguments{ -\item{...}{arguments passed to new function} -} -\value{ -calls the replacement functions -} -\description{ -chromVAR has moved functions and methods to camelCase from snake_case. -The following functions have been deprecated and replaced with a different -name: -\itemize{ - \item get_annotation_synergy is now \code{\link{getAnnotationSynergy}} - \item make_bias_bins is now \code{\link{makeBiasBins}} - \item make_permuted_sets is now \code{\link{makePermutedSets}} - \item pwm_distance is now \code{\link{pwmDistance}} - \item plot_variability is now \code{\link{plotVariability}} - \item plot_deviations_tsne is now \code{\link{plotDeviationsTsne}} - \item get_jaspar_motifs is now \code{\link{getJasparMotifs}} - \item match_kmers is now \code{\link{matchKmers}} - \item deviations_covariability is now \code{\link{deviationsCovariability}} - \item plot_kmer_mismatch is now \code{\link{plotKmerMismatch}} - \item get_total_fragments is now \code{\link{getTotalFragments}} - \item get_fragments_per_peak is now \code{\link{getFragmentsPerPeak}} - \item get_fragments_per_sample is now \code{\link{getFragmentsPerSample}} - \item get_peaks is now \code{\link{getPeaks}} - \item get_counts is now \code{\link{getCounts}} - \item get_sample_depths is now \code{\link{getSampleDepths}} - \item read_macs2_narrowpeaks is now \code{\link{readNarrowpeaks}} - \item get_annotations is now \code{\link{getAnnotations}} - \item filter_samples is now \code{\link{filterSamples}} - \item filter_samples_plot is now \code{\link{filterSamplesPlot}} - \item filter_peaks is now \code{\link{filterPeaks}} - \item annotation_matches is now \code{\link{annotationMatches}} - \item deviations_tsne is now \code{\link{deviationsTsne}} - \item differential_deviations is now \code{\link{differentialDeviations}} - \item differential_variability is now \code{\link{differentialVariability}} - \item compute_variability is now \code{\link{computeVariability}} - \item compute_expectations is now \code{\link{computeExpectations}} - \item computeDeviations is now \code{\link{computeDeviations}} - \item deviation_scores is now \code{\link{deviationScores}} - \item get_sample_distance is now \code{\link{getSampleDistance}} - \item get_sample_correlation is now \code{\link{getSampleCorrelation}} - \item get_cis_groups is now \code{\link{getCisGroups}} - \item add_gc_bias is now \code{\link{addGCBias}} - \item get_background_peaks is now \code{\link{getBackgroundPeaks}} - \item get_permuted_data is now \code{\link{getPermutedData}} - \item assemble_kmers is now \code{\link{assembleKmers}} -} -} -\author{ -Alicia Schep -} diff --git a/man/getAnnotationCorrelation.Rd b/man/getAnnotationCorrelation.Rd index d67b0ef..996eb53 100644 --- a/man/getAnnotationCorrelation.Rd +++ b/man/getAnnotationCorrelation.Rd @@ -15,29 +15,29 @@ getAnnotationCorrelation(object, annotations, ...) \S4method{getAnnotationCorrelation}{SummarizedExperiment,SummarizedExperiment}(object, - annotations, background_peaks = get_background_peaks(object), - expectation = compute_expectations(object), variabilities = NULL) + annotations, background_peaks = getBackgroundPeaks(object), + expectation = computeExpectations(object), variabilities = NULL) \S4method{getAnnotationCorrelation}{SummarizedExperiment,MatrixOrmatrix}(object, - annotations, background_peaks = get_background_peaks(object), - expectation = compute_expectations(object), variabilities = NULL) + annotations, background_peaks = getBackgroundPeaks(object), + expectation = computeExpectations(object), variabilities = NULL) \S4method{getAnnotationCorrelation}{SummarizedExperiment,list}(object, - annotations, background_peaks = get_background_peaks(object), - expectation = compute_expectations(object), variabilities = NULL) + annotations, background_peaks = getBackgroundPeaks(object), + expectation = computeExpectations(object), variabilities = NULL) \S4method{getAnnotationCorrelation}{MatrixOrmatrix,SummarizedExperiment}(object, - annotations, background_peaks, expectation = compute_expectations(object), + annotations, background_peaks, expectation = computeExpectations(object), variabilities = NULL) \S4method{getAnnotationCorrelation}{MatrixOrmatrix,MatrixOrmatrix}(object, - annotations, background_peaks, expectation = compute_expectations(object), + annotations, background_peaks, expectation = computeExpectations(object), variabilities = NULL) \S4method{getAnnotationCorrelation}{MatrixOrmatrix,list}(object, annotations, - background_peaks, expectation = compute_expectations(object), + background_peaks, expectation = computeExpectations(object), variabilities = NULL) } \arguments{ @@ -50,7 +50,7 @@ getAnnotationCorrelation(object, annotations, ...) \item{background_peaks}{optional, matrix of background peaks} \item{expectation}{optional, expected fraction of reads per peak, as computed -by compute_expectations} +by computeExpectations} \item{variabilities}{optional, variabilities computed from computeVariability} diff --git a/man/getAnnotationSynergy.Rd b/man/getAnnotationSynergy.Rd index e566acb..9e7d55e 100644 --- a/man/getAnnotationSynergy.Rd +++ b/man/getAnnotationSynergy.Rd @@ -34,11 +34,11 @@ getAnnotationSynergy(object, annotations, ...) variabilities = NULL, nbg = 25) \S4method{getAnnotationSynergy}{MatrixOrmatrix,MatrixOrmatrix}(object, - annotations, background_peaks, expectation = compute_expectations(object), + annotations, background_peaks, expectation = computeExpectations(object), variabilities = NULL, nbg = 25) \S4method{getAnnotationSynergy}{MatrixOrmatrix,list}(object, annotations, - background_peaks, expectation = compute_expectations(object), + background_peaks, expectation = computeExpectations(object), variabilities = NULL, nbg = 25) } \arguments{ @@ -51,7 +51,7 @@ getAnnotationSynergy(object, annotations, ...) \item{background_peaks}{optional, matrix of background peaks} \item{expectation}{optional, expected fraction of reads per peak, as computed -by compute_expectations} +by computeExpectations} \item{variabilities}{optional, variabilities computed from computeVariability} diff --git a/man/matchKmers.Rd b/man/matchKmers.Rd index c46ef4f..ca33768 100644 --- a/man/matchKmers.Rd +++ b/man/matchKmers.Rd @@ -94,5 +94,5 @@ kmer_ix <- matchKmers(6, mini_counts, genome = BSgenome.Hsapiens.UCSC.hg19) } \seealso{ -\code{\link{get_annotations}}, \code{\link{computeDeviations}} +\code{\link{getAnnotations}}, \code{\link{computeDeviations}} } diff --git a/man/plotDeviationsTsne.Rd b/man/plotDeviationsTsne.Rd index bb575a1..c94a94c 100644 --- a/man/plotDeviationsTsne.Rd +++ b/man/plotDeviationsTsne.Rd @@ -10,7 +10,7 @@ plotDeviationsTsne(object, tsne, var_df = NULL, sample_column = NULL, \arguments{ \item{object}{deviations result object} -\item{tsne}{result from \code{\link{deviations_tsne}}} +\item{tsne}{result from \code{\link{deviationsTsne}}} \item{var_df}{variability result} diff --git a/man/plotVariability.Rd b/man/plotVariability.Rd index 2d3408c..d8f347f 100644 --- a/man/plotVariability.Rd +++ b/man/plotVariability.Rd @@ -8,7 +8,7 @@ plotVariability(variability, xlab = "Sorted TFs", n = 3, labels = variability$name, use_plotly = interactive()) } \arguments{ -\item{variability}{output from \code{\link{compute_variability}}} +\item{variability}{output from \code{\link{computeVariability}}} \item{xlab}{label for x-axis (default is 'Sorted TFs')} diff --git a/vignettes/Articles/Annotations.Rmd b/vignettes/Articles/Annotations.Rmd index d5be9ca..97a3240 100644 --- a/vignettes/Articles/Annotations.Rmd +++ b/vignettes/Articles/Annotations.Rmd @@ -16,7 +16,7 @@ library(motifmatchr) library(SummarizedExperiment) library(Matrix) library(BiocParallel) -register(MulticoreParam(8)) +register(SerialParam()) ``` ## Motifs or kmers diff --git a/vignettes/Articles/Applications.Rmd b/vignettes/Articles/Applications.Rmd index 79004b2..ab642a8 100644 --- a/vignettes/Articles/Applications.Rmd +++ b/vignettes/Articles/Applications.Rmd @@ -18,7 +18,7 @@ library(Matrix) library(ggplot2) library(BiocParallel) library(BSgenome.Hsapiens.UCSC.hg19) -register(MulticoreParam(8)) +register(SerialParam()) data(example_counts, package = "chromVAR") set.seed(2017) example_counts <- addGCBias(example_counts, genome = BSgenome.Hsapiens.UCSC.hg19) @@ -154,8 +154,7 @@ chromVAR includes a function for computing the "synergy" between pairs of annota ## Function for computing synergy ```{r} -data(example_ix, package = "chromVAR") -get_annotation_synergy(counts_filtered, motif_ix[,c(83,24,20)]) +getAnnotationSynergy(counts_filtered, motif_ix[,c(83,24,20)]) ``` The result is a matrix with Z-scores for the variability synergy of each possible pairing. Note that this function is pretty slow and should only be performed with a limited selection of motifs and not the full collection! diff --git a/vignettes/Articles/Deviations.Rmd b/vignettes/Articles/Deviations.Rmd index 1b91a24..9a511ba 100644 --- a/vignettes/Articles/Deviations.Rmd +++ b/vignettes/Articles/Deviations.Rmd @@ -21,7 +21,9 @@ library(motifmatchr) library(SummarizedExperiment) library(Matrix) library(BSgenome.Hsapiens.UCSC.hg19) +library(BiocParallel) set.seed(2017) +register(SerialParam()) data(example_counts, package = "chromVAR") example_counts <- addGCBias(example_counts, genome = BSgenome.Hsapiens.UCSC.hg19) counts_filtered <- filterSamples(example_counts, min_depth = 1500, min_in_peaks = 0.15, shiny = FALSE) diff --git a/vignettes/Introduction.Rmd b/vignettes/Introduction.Rmd index fe04b76..3abc1c3 100644 --- a/vignettes/Introduction.Rmd +++ b/vignettes/Introduction.Rmd @@ -11,7 +11,7 @@ vignette: > chromVAR is an R package for the analysis of sparse chromatin accessibility. chromVAR takes as inputs aligned fragments (filtered for duplicates and low quality) from ATAC-seq or DNAse-seq experiments as well as genomic annotations such as motif positions. chromVAR computes for each annotation and each cell or sample a bias corrected "deviation" in accessibility from the expected accessibility based on the average of all the cells or samples. -This vignette covers basic usage of chromVAR with standard inputs. For more detailed documentation covering different options for various inputs and additional applications, view the additional vignettes on the [documentation website](https://greenleaflab.github.io/chromVAR/). +This vignette covers basic usage of chromVAR with standard inputs. For more detailed documentation covering different options for various inputs and additional applications, view the additional vignettes on the [documentation website](https://greenleaflab.github.io/chromVAR/). For more description of the method and applications, please see the [publication](https://www.nature.com/nmeth/journal/vaop/ncurrent/full/nmeth.4401.html) ([pdf](http://greenleaf.stanford.edu/assets/pdf/nmeth.4401.pdf), [supplement](https://drive.google.com/file/d/0B8eUn6ZURmqvUjBCbE5Hc0p4UFU/view?usp=sharing)). ##Loading the package