diff --git a/NAMESPACE b/NAMESPACE index fef6443..2e46122 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -28,8 +28,8 @@ export(pileup_sites) export(raer_example) export(read_sparray) import(GenomicRanges) +import(IRanges) import(S4Vectors) -import(SingleCellExperiment) import(SummarizedExperiment) importFrom(BSgenome,snpsByOverlaps) importFrom(BiocFileCache,BiocFileCache) @@ -59,9 +59,9 @@ importFrom(GenomicAlignments,readGAlignments) importFrom(GenomicFeatures,genes) importFrom(GenomicFeatures,intronsByTranscript) importFrom(GenomicFeatures,mapToTranscripts) +importFrom(GenomicRanges,GRanges) importFrom(IRanges,IRanges) importFrom(IRanges,extractList) -importFrom(IRanges,grouplengths) importFrom(IRanges,subsetByOverlaps) importFrom(Matrix,colSums) importFrom(Matrix,sparseMatrix) @@ -78,6 +78,7 @@ importFrom(Rsamtools,scanFaIndex) importFrom(Rsamtools,seqinfo) importFrom(S4Vectors,aggregate) importFrom(S4Vectors,unstrsplit) +importFrom(SingleCellExperiment,SingleCellExperiment) importFrom(data.table,fread) importFrom(methods,"slot<-") importFrom(methods,as) diff --git a/R/cache.R b/R/cache.R index 2d7ebf0..0799dc8 100644 --- a/R/cache.R +++ b/R/cache.R @@ -36,7 +36,7 @@ download_GSE99249 <- function(verbose = TRUE) { bfc <- .get_cache() fls <- unlist(GSE99249_files) fl_paths <- .add_files(fls, paste0(baseURL, fls), bfc, verbose) - fl_paths <- utils::relist(fl_paths, GSE99249_files) + fl_paths <- relist(fl_paths, GSE99249_files) fl_paths } diff --git a/R/calc_AEI.R b/R/calc_AEI.R index 537a40e..f2e4662 100644 --- a/R/calc_AEI.R +++ b/R/calc_AEI.R @@ -59,6 +59,8 @@ #' @importFrom rtracklayer export #' @importFrom Rsamtools scanBamHeader #' @importFrom IRanges subsetByOverlaps +#' @import S4Vectors +#' @import GenomicRanges #' #' @export calc_AEI <- function(bamfiles, diff --git a/R/differential_editing.R b/R/differential_editing.R index 0ccddd2..71e13b1 100644 --- a/R/differential_editing.R +++ b/R/differential_editing.R @@ -34,6 +34,7 @@ #' rse <- calc_edit_frequency(rse_adar_ifn) #' assay(rse, "edit_freq")[1:5, ] #' +#' @import SummarizedExperiment #' @importFrom Matrix colSums #' @export calc_edit_frequency <- function(rse, @@ -125,6 +126,7 @@ calc_edit_frequency <- function(rse, #' @param min_count OPTIONAL the number of reads used to determine the number of #' edited sites. Default is 10. #' +#' @import SummarizedExperiment #' @importFrom Matrix colSums #' @noRd #' @keywords internal @@ -167,6 +169,7 @@ count_edits <- function(se, edit_frequency = 0.01, min_count = 10, #' @param min_samples The minimum number of samples passing the `min_prop` and #' `max_prop` cutoffs to keep a site. #' +#' @import SummarizedExperiment #' #' @returns [RangedSummarizedExperiment] for use with `edgeR` or #' `DESeq2`. Contains a `counts` assay with a matrix formatted diff --git a/R/pileup.R b/R/pileup.R index 60529ac..3d3fd4b 100644 --- a/R/pileup.R +++ b/R/pileup.R @@ -86,6 +86,7 @@ #' #' @importFrom BiocGenerics path #' @importFrom Rsamtools index scanFaIndex seqinfo BamFile BamFileList +#' @importFrom GenomicRanges GRanges #' @importFrom IRanges IRanges #' @importFrom GenomeInfoDb seqlevels seqinfo seqlengths #' @importFrom BiocParallel SerialParam bpstop bplapply @@ -663,6 +664,8 @@ gr_to_cregions <- function(gr) { #' #' @return `RangedSummarizedExperiment` populated with assays specified in #' `assay_cols`. +#' @import GenomicRanges +#' @import SummarizedExperiment #' @importFrom IRanges extractList #' @keywords internal #' @noRd diff --git a/R/raer.R b/R/raer.R index 101441d..b06bd64 100644 --- a/R/raer.R +++ b/R/raer.R @@ -1,7 +1,6 @@ #' @docType package #' @name raer -#' -#' @import SingleCellExperiment SummarizedExperiment GenomicRanges S4Vectors + #' @importFrom utils download.file #' @importFrom methods is new as #' @importFrom Biostrings vmatchPattern diff --git a/R/sc-pileup.R b/R/sc-pileup.R index b67aa44..79b413c 100644 --- a/R/sc-pileup.R +++ b/R/sc-pileup.R @@ -355,6 +355,7 @@ get_sc_pileup <- function(bamfn, index, id, sites, barcodes, #' #' @importFrom data.table fread #' @importFrom Matrix sparseMatrix +#' @importFrom SingleCellExperiment SingleCellExperiment #' @importFrom R.utils gzip #' @export read_sparray <- function(mtx_fn, sites_fn, bc_fn, diff --git a/R/utils.R b/R/utils.R index 25dd991..b05608b 100644 --- a/R/utils.R +++ b/R/utils.R @@ -67,7 +67,7 @@ unlist_w_names <- function(x) { #' overlapping independent regions found in each chunk (dictated by `n_reads_per_chunk`). #' The `A_freq` column indicates the frequency of A bases within the region. #' -#' @importFrom IRanges grouplengths +#' @import GenomicRanges S4Vectors IRanges #' @importFrom Rsamtools ScanBamParam BamFile #' @importFrom GenomicAlignments readGAlignments #' @examples @@ -150,6 +150,7 @@ empty_mispriming_record <- function() { gr } +#' @import GenomicRanges merge_pa_peaks <- function(gr) { # get 3' end of read start(gr[strand(gr) == "+"]) <- end(gr[strand(gr) == "+"])