ALLHiC icon indicating copy to clipboard operation
ALLHiC copied to clipboard

filterBAM_forHiC.pl error

Open yanyew opened this issue 3 years ago • 2 comments

Hi Dr.zhang Thanks your great work in ALLHIC ! I got an error when I run filterBAM_forHiC.pl sample.bwa_aln.REduced.paired_only.bam sample.clean.sam. There is no header information in sample.clean.sam, which casued error ([main_samview] fail to read the header from "sample.clean.sam".) in running samtools view -bt draft.asm.fasta.fai sample.clean.sam > sample.clean.bam. But sample.bwa_aln.REduced.paired_only.bam has the correct header information. I am not sure what's going wrong.

Thanks in advance! Waiting for your reply

yanyew avatar Feb 23 '22 07:02 yanyew

The command "samtools view -bt" means use the fai file generated with fasta file to create header and generate bam file, the error you have got may caused by the version difference of samtools, maybe you can run it with samtools v1.3 or samtools v1.9, and check if this error is still appeared or not.

sc-zhang avatar Feb 23 '22 07:02 sc-zhang

The command "samtools view -bt" means use the fai file generated with fasta file to create header and generate bam file, the error you have got may caused by the version difference of samtools, maybe you can run it with samtools v1.3 or samtools v1.9, and check if this error is still appeared or not.

Thanks for your reply! I have try the samtools v1.9 and it works now.

And I have another question. What's the difference between using bwa aln to map Hi-C reads to draft assembly and using bwa mem in ALLHiC? I tried both two ways and I found the assembly so different. When I tried to get a .hic file from the sample.clean.bam following https://github.com/Yujiaxin419/ALLHiC/wiki/Manually-refine-ALLHiC-scaffold-assembly-through-juicebox, only the sample.clean.bam generated by bwa aln could successfully convert into a .hic file (and sample.clean.bam generated by bwa aln is much smaller than that generated by bwa aln in file sizes). Do you have any idea about it?

Thank you!

yanyew avatar Feb 23 '22 14:02 yanyew