HiTC importC not working
3
0
Entering edit mode
@rene-wiegandt-15172
Last seen 6.7 years ago
Germany

I wrote a script which creates interaction maps using HiTC

Running the script on windows everything works perfectly.

Running the same script with the same data in my VM with Debian installed i get following error:

 

Loading Genomic intervals ...

Error in .Call2("solve_user_SEW0", start, end, width, PACKAGE = "IRanges") :

solving row 1: negative widths are not allowed

Calls: lapply ... GenomicData -> IRanges -> solveUserSEW0 -> .Call2 -> .Call

 

I checked the data which is fine otherwise it would not be able to run on windows.

The line causing the error, where 'path_matrix' is the path to a matrix file generated by HiC-Pro :

interaction_matrix_full <- HiTC::importC(path_matrix, xgi.bed = path_bed, rm.trans = T)

 


Here is the output of sessionInfo("HiTC") for both systems:

R version 3.4.3 (2017-11-30)

Platform: x86_64-pc-linux-gnu (64-bit)

Running under: Debian GNU/Linux 9 (stretch)

Matrix products: default

BLAS: /mnt/software/x86_64/packages/r/3.4.3-stretch-local/lib/R/lib/libRblas.so

LAPACK: /mnt/software/x86_64/packages/r/3.4.3-stretch-local/lib/R/lib/libRlapack.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:

character(0)

other attached packages:

[1] HiTC_1.22.0

loaded via a namespace (and not attached):

 [1] XVector_0.18.0             GenomicRanges_1.30.3       BiocGenerics_0.24.0        zlibbioc_1.24.0           

 [5] GenomicAlignments_1.14.1   IRanges_2.12.0             grDevices_3.4.3            BiocParallel_1.12.0       

 [9] lattice_0.20-35            GenomeInfoDb_1.14.0        tools_3.4.3                utils_3.4.3               

[13] SummarizedExperiment_1.8.1 parallel_3.4.3             grid_3.4.3                 Biobase_2.38.0            

[17] matrixStats_0.53.1         stats_3.4.3                datasets_3.4.3             yaml_2.1.17               

[21] base_3.4.3                 Matrix_1.2-12              GenomeInfoDbData_1.0.0     rtracklayer_1.38.3        

[25] RColorBrewer_1.1-2         graphics_3.4.3             S4Vectors_0.16.0           bitops_1.0-6              

[29] RCurl_1.95-4.10            DelayedArray_0.4.1         compiler_3.4.3             methods_3.4.3             

[33] Biostrings_2.46.0          Rsamtools_1.30.0           stats4_3.4.3               XML_3.98-1.10


R version 3.4.2 (2017-09-28)

Platform: x86_64-w64-mingw32/x64 (64-bit)

Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:

[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252    LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                   

[5] LC_TIME=German_Germany.1252    

attached base packages:

character(0)

other attached packages:

[1] HiTC_1.22.0

loaded via a namespace (and not attached):

 [1] XVector_0.18.0             HiTC_1.22.0                GenomicRanges_1.30.0       BiocGenerics_0.24.0        zlibbioc_1.24.0           

 [6] GenomicAlignments_1.14.1   IRanges_2.12.0             grDevices_3.4.2            BiocParallel_1.12.0        lattice_0.20-35           

[11] GenomeInfoDb_1.14.0        tools_3.4.2                utils_3.4.2                SummarizedExperiment_1.8.1 parallel_3.4.2            

[16] grid_3.4.2                 Biobase_2.38.0             matrixStats_0.53.1         stats_3.4.2                datasets_3.4.2            

[21] base_3.4.2                 Matrix_1.2-12              GenomeInfoDbData_1.0.0     rtracklayer_1.38.3         RColorBrewer_1.1-2        

[26] graphics_3.4.2             S4Vectors_0.16.0           bitops_1.0-6               RCurl_1.95-4.10            DelayedArray_0.4.1        

[31] compiler_3.4.2             methods_3.4.2              Biostrings_2.46.0          Rsamtools_1.30.0           stats4_3.4.2              

[36] XML_3.98-1.10

HiTC IRanges windows debian • 1.8k views
ADD COMMENT
0
Entering edit mode
@nicolas-servant-1466
Last seen 2.5 years ago
France

Hi,

Indeed, it looks like the file was read, but that the parsing failed when it tries to create the GenomicRanges object (negatives widths).

I'm wondering if the file could be corrupted by Windows character for instance ?

Could you try ;

xgi <- rtracklayer::import(xgi.bed, format = "bed")
xgi
cdata <- read.table(con, comment.char = "#", colClasses = c("character",
        "character", "numeric"), check.names = FALSE)
head(cdata)

Thanks

ADD COMMENT
0
Entering edit mode

Hi,

thanks for the quick answer.

I get:

GRanges object with 136288 ranges and 1 metadata column:
           seqnames                 ranges strand |        name
              <Rle>              <IRanges>  <Rle> | <character>
       [1]     chr1        [    1,  20000]      * |           1
       [2]     chr1        [20001,  40000]      * |           2
       [3]     chr1        [40001,  60000]      * |           3
       [4]     chr1        [60001,  80000]      * |           4
       [5]     chr1        [80001, 100000]      * |           5
       ...      ...                    ...    ... .         ...
  [136284]     chrX [170940001, 170960000]      * |      136284
  [136285]     chrX [170960001, 170980000]      * |      136285
  [136286]     chrX [170980001, 171000000]      * |      136286
  [136287]     chrX [171000001, 171020000]      * |      136287
  [136288]     chrX [171020001, 171031299]      * |      136288
  -------
  seqinfo: 21 sequences from an unspecified genome; no seqlengths


   V1     V2 V3
1 151   1352  1
2 151  63981  1
3 151 113658  1
4 151 114665  1
5 152   5708  1
6 152   5919  1

ADD REPLY
0
Entering edit mode
@nicolas-servant-1466
Last seen 2.5 years ago
France

Thanks. It looks good. I think the error occur on the xgi object. Did you check if your have intervals with negative widths ?

The importC function is a small function. Could you try to excecute it line by line to see where exactly it crashed ...

or at least ;

 xgi <- rtracklayer::import(xgi.bed, format = "bed")
 xgi <- sortSeqlevels(xgi)
 names(xgi) <- id(xgi)

Thanks

ADD COMMENT
0
Entering edit mode

Hey,

i found my mistake. Executing the function line by line worked without errors.

So i had a closer look at my code again.. I mixed up the con and the xgi.bed variable.

Still got no idea why it worked running under windows. It is the same script and same data no copy.

Well, that has probably nothing to do with the package.

Anyway thank you very much.

ADD REPLY
0
Entering edit mode
@nicolas-servant-1466
Last seen 2.5 years ago
France

Great ! Thanks. Nicolas

ADD COMMENT

Login before adding your answer.

Traffic: 799 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6