zengxiaofei / HapHiC

HapHiC: a fast, reference-independent, allele-aware scaffolding tool based on Hi-C data
https://www.nature.com/articles/s41477-024-01755-3
BSD 3-Clause "New" or "Revised" License
142 stars 10 forks source link

[E::bgzf_read] Read block operation failed with error 4 after 0 of 4 bytes samtools view: error reading file "HiC.bam" samtools view: error closing "HiC.bam": -1 #61

Closed cht-jk closed 2 months ago

cht-jk commented 2 months ago

Hello author: (1)bwa mem -5SP -t 80 Six_genome.bp.p_ctg.fasta Q-6-Hi_c_1.clean.fq.gz Q-6-Hi_c_2.clean.fq.gz | samblaster | samtools view - -@ 80 -S -h -b -F 3340 -o HiC.bam (2)/home/export/online3/caohaitao/HapHiC/haphic/HapHiC/utils/filter_bam HiC.bam 1 --nm 3 --threads 80 | samtools view - -b -@ 80 -o HiC.filtered.bam The following error occurred while running step (2): [E::bgzf_read] Read block operation failed with error 4 after 0 of 4 bytes samtools view: error reading file "HiC.bam" samtools view: error closing "HiC.bam": -1

zengxiaofei commented 2 months ago

It seems that your HiC.bam was not correctly generated. Please check the file using samtools view HiC.bam

cht-jk commented 2 months ago

haphic pipeline Six_genome.bp.p_ctg.fasta HiC.filtered.bam 25 --quick_view --RE "GATC" --correct_nrounds 2 --remove_allelic_links 4 --threads 60 --processes 60 Will the information indicated in the figure have an impact on the results? 企业微信截图_17254998327187

zengxiaofei commented 2 months ago

The sparse_dot_mkl module is only used to speed up the clustering step. It does not affect the results. --remove_allelic_links 4 is used to deal with haplotype-resolved autotetraploid assemblies. As your input assembly file is p_ctg and the chromosome number is 25, this parameter is not necessary for your case.

cht-jk commented 2 months ago

haphic reassign ../Six_genome.bp.p_ctg.fasta full_links.pkl mcl_inflation_4.2.clusters.txt paired_links.clm --nclusters 25 Running Reassign alone resulted in the following error image thanks!

zengxiaofei commented 2 months ago

FileNotFoundError

cht-jk commented 2 months ago

Hello, I would like to use only Haphic to draw the HIC heatmap. Can I skip the mounted part and only obtain the HIC heatmap without changing the original genome?

zengxiaofei commented 2 months ago

Yes, for more information, please see our note in the Visualization section.

cht-jk commented 2 months ago

Hello, thank you for your answer. Currently, I am only using Haphic to draw a heatmap and skipping mounting. The resulting heatmap does not meet expectations. What is the situation? image

zengxiaofei commented 2 months ago
  1. How did you align the Hi-C reads to the assembly and filter them?
  2. Does the sixth column of the AGP file match the reference names of the BAM file for haphic plot?
  3. Could you please show me the commands you used?
cht-jk commented 2 months ago

(1) $bwa mem -5SP -t 50 sweettea.racon.2.fa R._c_var._suavissimus-3_1.clean.fq.gz R._c_var._suavissimus-3_1.clean.fq.gz | samblaster | samtools view - -@ 50 -S -h -b -F 3340 -o HiC.bam $filter_bam HiC.bam 1 --nm 3 --threads 35 | samtools view - -b -@ 35 -o HiC.filtered.bam $mock_agp_file.py sweettea.racon.2.fa > sweettea.agp $haphic plot sweettea.agp HiC.filtered.bam --bin_size 1000 --min_len 5 --threads 80 (2) does the sixth column of the AGP file match the reference name of the BAM file exactly

zengxiaofei commented 2 months ago

You used the same file R._c_var._suavissimus-3_1.clean.fq.gz for both ends of the Hi-C reads.

cht-jk commented 2 months ago

Oh, I just realized. Thank you very much

cht-jk commented 2 months ago

How to split group3 into two parts, one green part named group3 and the other green part named group26,thanks. image

zengxiaofei commented 2 months ago

https://github.com/aidenlab/Juicebox https://github.com/zengxiaofei/HapHiC#juicebox-curation