Skip to content

Commit

Permalink
Fix bug if only one signature
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachel Rosenthal committed Aug 18, 2020
1 parent 5c8d831 commit 41a705c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/whichSignatures.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ whichSignatures = function(tumor.ref = NA,

#Take a subset of the signatures
if(!is.null(associated)){
signatures <- signatures[rownames(signatures) %in% associated, ]
signatures <- signatures[rownames(signatures) %in% associated,,drop=FALSE ]
}

if(is.na(signatures.limit)){
Expand All @@ -132,7 +132,7 @@ whichSignatures = function(tumor.ref = NA,

# Remove signatures from possibilities if they have a "strong" peak not seen in the tumor sample
zero.contexts <- colnames(tumor)[tumor < 0.01]
corr.sigs <- which(signatures[,zero.contexts] >= 0.2, arr.ind = T)
corr.sigs <- which(signatures[,zero.contexts,drop=FALSE] >= 0.2, arr.ind = T)
signatures <- signatures[which(!rownames(signatures) %in% rownames(corr.sigs)),,drop = FALSE]
#print(paste(rownames(corr.sigs), " not considered in the analysis.", sep = ""))

Expand Down

0 comments on commit 41a705c

Please sign in to comment.