broadinstitute / ssGSEA2.0

Single sample Gene Set Enrichment analysis (ssGSEA) and PTM Enrichment Analysis (PTM-SEA)
Other
230 stars 79 forks source link

ssGSEA2 bug in parse.gctx #2

Closed rpeys closed 5 years ago

rpeys commented 5 years ago

I am getting an error in the parse.gctx() function call in the "import dataset" section of ssGSEA2.0.R:

gct.unique <- NULL
dataset <- try(parse.gctx(input.ds), silent = T)
if(class(dataset) != 'try-error' ){

  m <- dataset@mat
  gene.names <- dataset@rid
  gene.descs <- dataset@rdesc
  sample.names <- dataset@cid
  sample.descs <- dataset@cdesc

} else {
    ## - cmapR functions stop if ids are not unique
    ## - import gct using readLines and make ids unique
...
}

The parse.gctx() function call throws an error that is not accounted for in the "else" statement. When I run parse.gctx(input.ds) I get the following error:

parsing as GCT v1.2 /Users/Rebecca/Documents/Sontag_lab/MM/CoMMpass_IA12/gene_expression/data/GCT_format//fpkm_limit_baseline_cd138.gct 55861 rows, 770 cols, 0 row descriptors, 0 col descriptors Error in dimnames(mat) = list(rid, cid) : length of 'dimnames' [2] not equal to array extent In addition: Warning messages: 1: In matrix(mat, nrow = nrmat, ncol = ncmat + nrhd + col_offset, byrow = TRUE) : data length [43068831] is not a sub-multiple or multiple of the number of columns [772] 2: In matrix(as.numeric(mat[, (1 + col_offset):ncol(mat)]), nrow = nrmat, : NAs introduced by coercion

Any ideas how to get past this? My file is a gct not gctx file. It's extension is .gct, and here is a snapshot of the first few rows/columns:

image

I am using cmapR version 1.0.1, and here is my session info:

$platform [1] "x86_64-apple-darwin15.6.0"

$arch [1] "x86_64"

$os [1] "darwin15.6.0"

$system [1] "x86_64, darwin15.6.0"

$status [1] ""

$major [1] "3"

$minor [1] "5.1"

$year [1] "2018"

$month [1] "07"

$day [1] "02"

$svn rev [1] "74947"

$language [1] "R"

$version.string [1] "R version 3.5.1 (2018-07-02)"

$nickname [1] "Feather Spray"

karstenkrug commented 5 years ago

Hi Rebecca,

My first guess would have been the combination of R 3.5.1 and cmapR. However, I noticed that you reached out to the developers of cmapR:

https://github.com/cmap/cmapR/issues/23

I hope you will sort things out.

Best, Karsten