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

Again) generateNull #20

Closed hyojin0912 closed 3 years ago

hyojin0912 commented 4 years ago

Hello

I am a student studying at KAIST in South Korea.

First, thank you for nice package.

I want to use singscore for enriching immune cell type specific genes.

But I got error when generateNull distribution.

I raised issue and get answer to update version.

But I again get error for generateNull when scoring single direction gene set

`

BiocManager::install("singscore")` BiocManager::install("GSEABase")

library(singscore) library(GSEABase)

exp_sym <- read.table("./Input/gexp_BER.txt", sep="\t", header=TRUE)

test <- read.table("./Input/test.txt", sep="\t", header=TRUE)

Test using single gene set

gset <- c() gset <- unique(as.character(paste(test[,1]))) gset <- GeneSet(test , setName=paste0(1))

ssRank <- rankGenes(exp_sym) ss <- simpleScore(ssRank, upSet = gset, knownDirection = T, centerScore = T) Nulldist <- generateNull(upSet = gset, downSet = NULL, rankData=ssRank, knownDirection = T, centerScore = T) Pval <- getPvals(Nulldist, ss)

Multi gene set

gsetlist <- list() for (i in 1:ncol(test)){ sym <- unique(as.character(paste(test[,i]))) sym <- sym[1:length(sym)-1] gset <- GeneSet(sym, setName=paste0(i)) geneIdType(gset) <- SymbolIdentifier() gsetlist <- c(gsetlist, list(gset)) } multiss <- multiScore(ssRank, upSet = gsetlist, knownDirection = T, centerScore = T)

Nulldist <- generateNull(upSet = gset, rankData=ssRank, knownDirection = T, centerScore = T) Pval <- getPvals(Nulldist, multiss)

`

I found that error raised when setting "downSet=NULL" image

Could you describe how I get p values per gene set I attatched.

Sincerely

Hyojin

`Session Info

sessionInfo() R version 3.6.0 (2019-04-26) Platform: x86_64-redhat-linux-gnu (64-bit) Running under: CentOS Linux 7 (Core)

Matrix products: default BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages: [1] stats4 parallel stats graphics grDevices utils datasets methods base

other attached packages: [1] singscore_1.4.0 GSEABase_1.46.0 graph_1.62.0 annotate_1.62.0 XML_3.98-1.20
[6] AnnotationDbi_1.46.1 IRanges_2.18.3 S4Vectors_0.22.1 Biobase_2.44.0 BiocGenerics_0.30.0

loaded via a namespace (and not attached): [1] SummarizedExperiment_1.14.1 tidyselect_1.1.0 locfit_1.5-9.4 purrr_0.3.4
[5] lattice_0.20-38 colorspace_1.4-1 vctrs_0.3.2 generics_0.0.2
[9] blob_1.2.1 rlang_0.4.7 pillar_1.4.6 glue_1.4.1
[13] DBI_1.1.0 BiocParallel_1.18.1 bit64_4.0.2 plyr_1.8.6
[17] matrixStats_0.56.0 GenomeInfoDbData_1.2.1 lifecycle_0.2.0 zlibbioc_1.30.0
[21] munsell_0.5.0 gtable_0.3.0 memoise_1.1.0 GenomeInfoDb_1.20.0
[25] Rcpp_1.0.5 xtable_1.8-4 edgeR_3.26.8 scales_1.1.1
[29] limma_3.40.6 DelayedArray_0.10.0 XVector_0.24.0 bit_4.0.4
[33] ggplot2_3.3.2 digest_0.6.25 dplyr_1.0.2 GenomicRanges_1.36.1
[37] grid_3.6.0 tools_3.6.0 bitops_1.0-6 magrittr_1.5
[41] RCurl_1.98-1.2 RSQLite_2.2.0 tibble_3.0.3 crayon_1.3.4
[45] tidyr_1.1.1 pkgconfig_2.0.3 ellipsis_0.3.1 Matrix_1.2-17
[49] rstudioapi_0.11 R6_2.4.1 compiler_3.6.0

gexp_BER.txt test.txt

`

bhuvad commented 4 years ago

Hi Hyojin,

The version of singscore you are using is 1.4.0 (thanks for including your R session info!). The latest version (which includes the bug fix) is v1.8.0 (https://www.bioconductor.org/packages/release/bioc/html/singscore.html). This version of the package can be installed using the latest version of Bioconductor (which itself requires R >4.0). As such, you will first need to install R v4.0 or greater, follow this with updating your Bioconductor installation and finally, updating singscore. Alternatively, you can install the development version directly from this Github repository using BiocManager::install("DavisLaboratory/singscore"). This will allow an installation even with your current R version being 3.6. The true dependency of the package is R >3.6 but installation via Bioconductor will require you to install R >4.0. I hope this helps you resolve your problem.

Cheers, Dharmesh

hyojin0912 commented 4 years ago

Hello Thanks for your kind reply.

I installed singscore via github.

And found that its ver is 1.7.5 image

Also get same error from generateNull image

Could you explain how to install singscore v1.8.0 to deviate this error

sincerely

Hyojin

2020년 8월 24일 (월) 오후 8:52, Dharmesh Bhuva notifications@github.com님이 작성:

Closed #20 https://github.com/DavisLaboratory/singscore/issues/20.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DavisLaboratory/singscore/issues/20#event-3685062905, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJKE5V4D3GGAQ4KC7PHL6OTSCJIABANCNFSM4QJJKPXA .

bhuvad commented 4 years ago

Hi Hyojin,

I had outlined the steps to update your singscore version to the latest version. You will first need to get R4.0.0, follow that with the latest installation of Bioconductor (install.packages('BiocManager') and then finally install singscore (BiocManager::install('singscore')). I tried your code with the data you provided and I don't get any errors from my side. Version 1.7.5 on this repository is the same as v1.8.0 on Bioconductor. Since things are working on my end, I can't replicate the error you are getting. If the error persists, can you please attach your full code and data again so that I can try to replicate it. I had to modify the following two lines (which I assume are typos):

exp_sym <- read.table("./Input/gexp_BER.txt", sep="\t", header=TRUE, row.names = 1)
...
gset <- GeneSet(gset, setName=paste0(1))

Please try the update and let me know how that goes.

Cheers, Dharmesh