Bioconductor / RaggedExperiment

Matrix-like representations of mutation and CN data
https://bioconductor.org/packages/RaggedExperiment
4 stars 3 forks source link

Error in as(background, class(mcol)) : no method or default for coercing “logical” to “factor” #15

Closed dietmarfdz closed 6 years ago

dietmarfdz commented 6 years ago

Hi,

I have a total of 124 samples (each of them a GRanges objetct) in a list.

transfor[1]
$EPR000148
GRanges object with 57 ranges and 1 metadata column:
       seqnames                 ranges strand |     score
          <Rle>              <IRanges>  <Rle> | <integer>
   [1]     chr1 [   129285,   6314822]      * |         1
   [2]     chr1 [ 12855876,  13802437]      * |         1
   [3]     chr1 [ 16344494,  33282775]      * |         1
   [4]     chr1 [117622286, 148951207]      * |         1
   [5]     chr2 [ 90464785,  95963242]      * |         1
   ...      ...                    ...    ... .       ...
  [53]    chr21   [10907208, 14756481]      * |         0
  [54]    chr21   [44837551, 47552385]      * |         1
  [55]    chr22   [18304392, 18900750]      * |         1
  [56]    chr22   [21045398, 21742598]      * |         1
  [57]    chr22   [42523409, 42779699]      * |         1
 -------
  seqinfo: 20 sequences from an unspecified genome; no seqlength

I get the following warning:

Warning message:
In `[<-`(`*tmp*`, i, value = <S4 object of class structure("GRanges", package = "GenomicRanges")>) :
  implicit list embedding of S4 objects is deprecated

Performing the function RaggedExperiment works perfect.

>ragedtransfor<-RaggedExperiment(transfor, colData=colDat)

> ragedtransfor
class: RaggedExperiment
dim: 3828 124
assays(1): score
rownames: NULL
colnames(124): EPR000148 EPR002842 ... EPR985377 EPR990968
colData names(1): id

but when performing any of the Assayfunctions, I get the following:

sparseAssay(ragedtransfor)
Error in as(background, class(mcol)) :
  no method or default for coercing “logical” to “factor”

I performed the debug option and it crashes in the following step:

debug: dimnames[[1]] <- as.character(.rowRanges(x))
Browse[2]>
debug: na <- as(background, class(mcol))
Browse[2]>
Error in as(background, class(mcol)) :
  no method or default for coercing “logical” to “factor”

Any clue about what´s happening? Thanks in advance

lwaldron commented 6 years ago

Can you post your GRangesList object or a subset of it, to allow us to reproduce the problem? Also, what's your sessionInfo()? I'm not sure offhand what the issue is but it looks like something to do with legacy objects. You might want to post this on support.bioconductor.org, since that's where the developers of GenomicRanges will see it.

dietmarfdz commented 6 years ago

Here you have the data you requested:

R version 3.4.2 (2017-09-28)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS: /home/.../homews/R342/lib64/R/lib/libRblas.so
LAPACK: /home/.../homews/R342/lib64/R/lib/libRlapack.so

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

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

other attached packages:
[1] RaggedExperiment_1.2.0 GenomicRanges_1.30.0   GenomeInfoDb_1.14.0
[4] IRanges_2.12.0         S4Vectors_0.16.0       BiocGenerics_0.24.0
[7] BiocInstaller_1.28.0

loaded via a namespace (and not attached):
 [1] lattice_0.20-35            matrixStats_0.52.2
 [3] bitops_1.0-6               grid_3.4.2
 [5] zlibbioc_1.24.0            XVector_0.18.0
 [7] Matrix_1.2-11              tools_3.4.2
 [9] Biobase_2.38.0             RCurl_1.95-4.8
[11] DelayedArray_0.4.1         compiler_3.4.2
[13] SummarizedExperiment_1.8.0 GenomeInfoDbData_0.99.1

ragedtransfor_subset.zip

LiNk-NY commented 6 years ago

Hi Taran, @dietmarfdz Thanks for your report. I will have a look at it today.

Regards, Marcel

LiNk-NY commented 6 years ago

Hi Taran, @dietmarfdz This was happening because there was a factor in the mcol data. This would generate an error when coercing the default background value in assay and *Assay. Please see 38ad3f4bb2c0a125473f1ef3799b1ca3e18419ca and 381a22eb2fc4507af83dd021901f826263588162 for commit info.

Regards, Marcel

LiNk-NY commented 6 years ago

Fixed in 1.2.2 in release and 1.3.4 in devel. These changes should be live after tomorrow's BBS build.