Skip to content

Commit

Permalink
bugfix if subsetting DORC list in runFigRGRN
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinay Kartha committed Jul 1, 2022
1 parent 35299ea commit 5141359
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/FigR.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#'@param genome character specifying a valid genome assembly to use for peak GC content estimation and background peak determination. Must be one of "hg19","hg38", or "mm10", and requires the corresponding genomes package e.g. \code{\link[BSgenome.Hsapiens.UCSC.hg19]{BSgenome.Hsapiens.UCSC.hg19}} for hg19
#'@param dorcMat Matrix object of smoothed single-cell DORC accessibility scores
#'@param rnaMat Matrix object of smoothed single-cell RNA expression values
#'@param dorcGenes character vector specifying the subset of DORCs to test, if not running on everything
#'@param dorcGenes character vector specifying the subset of DORCs to test, if not running on everything. Note: We still use the entire list of DORCs found in dorcMat to determine dorc KNNs from, but will only test and include results for these specified genes (also must exist in the provided RNA matrix rnaMat as rownames)
#'@param nCores numeric specifying the number of cores to run DORCs in parallel. Default is 1, i.e. don't use parallel backend
#'@return a data.frame with all TF-DORC motif enrichment and correlation associations, and the corresponding FigR regulation score for each association
#'@import dplyr Matrix SummarizedExperiment chromVAR
Expand Down Expand Up @@ -141,7 +141,7 @@ runFigRGRN <- function(ATAC.se, # SE of scATAC peak counts. Needed for chromVAR
.packages = c("FigR", "dplyr","Matrix","Rmpfr")) %dopar% {
# Take peaks associated with gene and its k neighbors
# Pool and use union for motif enrichment
DORCNNpeaks <- unique(dorcTab$Peak[dorcTab$Gene %in% c(g,dorcGenes[DORC.knn[g,]])])
DORCNNpeaks <- unique(dorcTab$Peak[dorcTab$Gene %in% c(g,rownames(dorcMat)[DORC.knn[g,]])])

if(usePeakNames)
DORCNNpeaks <- which(rownames(ATAC.se) %in% DORCNNpeaks) # Convert to index relative to input
Expand Down
2 changes: 1 addition & 1 deletion man/runFigRGRN.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5141359

Please sign in to comment.