DavisLaboratory / singscore

An R/Bioconductor package that implements a single-sample molecular phenotyping approach
https://davislaboratory.github.io/singscore/
40 stars 5 forks source link

Error when genes in gene signatures are absent in expression matrix #14

Closed ktmf1991 closed 4 years ago

ktmf1991 commented 5 years ago

Hi singscore team,

Firstly thank you for the great work. It solves a lot of problem for the study of clinical samples that usually could not afford repeated samples and involves complicated "conditions/blocks" due to the complex composition of diseases like cancer.

I was using multiScore() (and actually also simpleScore()) and it shows me the following thing message when I am running the codes:

library(EnrichmentBrowser)
library(singscore)
# calculate rank
ssRank <- rankGenes(full_mat)

# get gene sets
kegg.gs <- getGenesets(org="hsa", db="kegg")

# convert to GeneSet object list
kegg.gs.collection <- list()
for (i in seq_along(kegg.gs)){
  set <- GeneSet(kegg.gs[[i]], setName = names(kegg.gs)[i])
  kegg.gs.collection <- c(kegg.gs.collection,list(set))
}

# run multiScore()
multiss <- multiScore(ssRank,upSet = kegg.gs.collection, knownDirection = F)

And the error goes:

Error in dimnames(x) <- dn : 
  length of 'dimnames' [1] not equal to array extent
In addition: Warning message:
In multiSingscore(rankData, upSetColc, downSetColc = NULL, subSamples = subSamples,  :
  'centerScore' is disabled for this setting

I think it may be due to the some missing genes in the gene sets which are filtered because of low count/lack of a proper entrezID. Or is there some errors in my input?

Many thanks, Kent

bhuvad commented 4 years ago

Hi Kent,

Apologies for the delay in responding to your issue (I haven't been getting notifications for issues for some reason). It might be late to respond to your specific problem but I will respond in any case to assist other users in case they faced similar issues.

The first thing I'd like to point out is that the argument name for up-regulated gene sets in multiScore is upSetColc as opposed to upSet in simpleScore. Additionally, what you encountered was a bug in singscore which I have also recently encountered and subsequently fixed (a09a2be3449adc5ecae3084aa3954fb688258fae). This update will be in the next Bioconductor release (end of Apr 2020) or can be accessed from the latest version which is in this repository. This version of singscore (v1.8.0 when released) has this along with other bug fixes to the multiScore() and generateNull() functions

I apologise for the late response again and I hope you find this information useful.

Cheers, Dharmesh