Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addresses issue 168 by parameterizing checkAnnots rnktype #432

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: SCENIC
Type: Package
Title: SCENIC (Single Cell rEgulatory Network Inference and Clustering)
Version: 1.3.1
Version: 1.3.1.9001
Date: 2022-05-02
Author: Sara Aibar, Carmen Bravo, Stein Aerts.
Laboratory of Computational Biology, KU Leuven Center for Human Genetics.
Expand Down
6 changes: 3 additions & 3 deletions R/class_ScenicOptions.R
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ initializeScenic <- function(org=NULL, dbDir="databases", dbs=NULL, datasetTitle

## Check if motif annotation and rankings potentially match
motifAnnot <- getDbAnnotations(object)
featuresWithAnnot <- checkAnnots(object, motifAnnot)
featuresWithAnnot <- checkAnnots(object, motifAnnot, col = dbIndexCol)
if(any(featuresWithAnnot == 0)) message("Missing annotations for: \n", paste("\t", names(which(featuresWithAnnot==0))))

## Return
Expand Down Expand Up @@ -494,12 +494,12 @@ dbLoadingAttempt <- function(dbFilePath, indexCol='features'){

#' @rdname ScenicOptions-class
#' @export
checkAnnots <- function(object, motifAnnot)
checkAnnots <- function(object, motifAnnot, col)
{
allFeaturesInAnnot <- unlist(motifAnnot[,1]) # motif or track
featuresWithAnnot <- lapply(getDatabases(object), function(dbFile)
{
rnktype = "features" #TODO: add as option for custom dbs
rnktype = col #TODO: add as option for custom dbs
nRnks <- getRanking(RcisTarget::importRankings(dbFile, columns = rnktype))
nRnks <- dplyr::pull(nRnks, rnktype)

Expand Down
2 changes: 1 addition & 1 deletion R/runSCENIC_2_createRegulons.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ runSCENIC_2_createRegulons <- function(scenicOptions,
})))

## Check if annotation and rankings (potentially) match:
featuresWithAnnot <- checkAnnots(scenicOptions, motifAnnot)
featuresWithAnnot <- checkAnnots(scenicOptions, motifAnnot, col = dbIndexCol)
if(any(featuresWithAnnot == 0)) warning("Missing annotations\n", names(which(rankingsInDb==0)))

### Filter & format co-expression modules
Expand Down