deeptools / HiCExplorer

HiCExplorer is a powerful and easy to use set of tools to process, normalize and visualize Hi-C data.
https://hicexplorer.readthedocs.org
GNU General Public License v3.0
233 stars 70 forks source link

hicBuildMatrix ends with KeyError #665

Closed cgirardot closed 3 years ago

cgirardot commented 3 years ago

Dear, I am running hicBuildMatrix 3.5.3 on a pretty big BAM pair (4 nextseq high lanes merged => 80G each) using the command line:

hicBuildMatrix --samFiles Fwd-Reads.bam Rev-Reads.bam --outFileName 1Kb-bin-matrix.h5 --outBam unsorted.bam --QCfolder /tmpdata/qc/. --restrictionCutFile rest_site_positions_DpnII_dm6.bed --minMappingQuality 10 --danglingSequence 'GATC' --threads 10 --binSize '1000' --restrictionSequence 'GATC'  2>error.txt 1>output.txt 

The offending key is in the BAM headers (on both Fwd & Rev bam inputs):

samtools view -H  Fwd-Reads.bam | grep chrUn_DS484472v1
@SQ SN:chrUn_DS484472v1 LN:2046

Error is :

INFO:hicexplorer.hicBuildMatrix:processing 361050129 lines took 96605.74 secs (3737.4 lines per second)

INFO:hicexplorer.hicBuildMatrix:49685436 (13.76%) valid pairs added to matrix

ERROR:hicexplorer.hicBuildMatrix:'chrUn_DS484472v1'Traceback (most recent call last):
  File "/g/funcgen/gbcs/public/software/conda/envs/hicexplorer-3.5.3/lib/python3.6/site-packages/hicexplorer/hicBuildMatrix.py", line 966, in process_data
    pRfPositions[mate_ref][frag_start: frag_end]))
KeyError: 'chrUn_DS484472v1'

Do you have an idea of what could be wrong ?

NB: Running the tech replicates individually worked in Galaxy with 3.4.3 version ; I had to move to the command line as the jobs were not ending on the cluster with the big merged files (due to time limit and me not knowing how long it needs)

joachimwolff commented 3 years ago

Please update to HiCExplorer 3.6. With 3.5 we introduced a mandatory restriction cut site file, however, there have been some bugs that are closed with version 3.6.

Galaxy with version 3.4 does not have this mandatory restriction cut site file and therefore has not the presented bug.

Best,

Joachim

cgirardot commented 3 years ago

ok thx.

cgirardot commented 3 years ago

solved with 3.6; thank you. Is there any chance to release 3.6 in galaxy soon ? feel free to close on reply :-)

joachimwolff commented 3 years ago

I hope I find time in Q1 this year.