-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
alignmentSieve returns a truncated bam #1180
Comments
Hello, (Python 3.9.13, |
I also met a similar problem. Thank you for your help! (deeptools 3.5.1 |
Same problem here. |
Same problem here. |
Hi, I was able to reproduce, though I'm a bit puzzled about the actual cause. Kind regards, wardDeb |
This didn't occur anymore with chunksize increases (release 3.5.2). |
Hi, I have the same problem even after updating the deeptools to 3.5.5
After the 'samtools sort' command, I got the errors: Do you have any suggestions? |
This is not an issue with your tmp directory ? 512MB is an oddly specific size, otherwise, would you mind sharing (somehow) the bam file that causes this behavior ? |
I found that 'tmp.bam' file had fewer reads. The tail of 'tmp.bam' seems strange. Is that a problem?
|
Hi, same problem here.. I've tried both 3.5.2 and 3.5.5 versions of deeptools. Just tried also 3.5.3 but same problem. Tried also 3.5.1 same problem (empty Bam files) but this time the size is different 213.746Kb. |
Hi. Another information is that 5 of 6 my sequencing BAM files ran successfully. Only 1 file faild. I think it is not a general problem but a specific one. I'd like to provide my BAM to you if you need one to test. |
Thanks for the additional info, it'd be great if you could share the problematic and a working bam file somehow. Do you have a way of making these available ? |
Just per update, I've received the files, this is now work in progress. |
I get the non-truncated bam when using the latest alignmentSieve(3.5.5) on my first try on the sample that I always got truncated err regardless of how many times I've re-ran the alignmentSieve of the old version. |
It seems the chance for a truncated bam in 3.5.5 is decreased, but not completely removed. I'm aiming to have a true fix for this in the upcoming weeks. |
same problem. and I also tried to reprocess the failed files individually, and the results still failed, which I think is probably not an accident, but a specific file format problem |
I use conda install deeptools=3.5.5. It still doesn't solve the problem. But I solved the problem by creating a new environment using conda and then installing deeptools using pip. You can try installing with pip for now |
hi there, just wanted to add some information on the issue: while read p; do samtools view -o "/scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_"$p".bam" /scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.filtered.bam ` echo $p | sed 's/^/chr/'` ; done < chr.txt then: for bam in /scratch/Theo/AP06/bam/filtered_bam/*.test_*; do samtools index -@ 16 $bam; done ATAC shift for bam in /scratch/Theo/AP06/bam/filtered_bam/*.test_*bam; do alignmentSieve --bam $bam --outFile ${bam%.bam}"_Stmp.bam" --ATACshift --numberOfProcessors 16; done and here the sorting: for bam in /scratch/Theo/AP06/bam/filtered_bam/*_Stmp.*bam; do samtools sort -@ 16 -O Bam -o ${bam%_Stmp.bam}"_shift.bam" $bam; done
[bam_sort_core] merging from 0 files and 16 in-memory blocks...
[E::bgzf_read] Read block operation failed with error 4 after 0 of 4 bytes
samtools sort: truncated file. Aborting
[bam_sort_core] merging from 0 files and 16 in-memory blocks...
[bam_sort_core] merging from 0 files and 16 in-memory blocks...
[bam_sort_core] merging from 0 files and 16 in-memory blocks...
[bam_sort_core] merging from 0 files and 16 in-memory blocks...
[bam_sort_core] merging from 0 files and 16 in-memory blocks...
[bam_sort_core] merging from 0 files and 16 in-memory blocks...
[bam_sort_core] merging from 0 files and 16 in-memory blocks...
[bam_sort_core] merging from 0 files and 16 in-memory blocks...
[bam_sort_core] merging from 0 files and 16 in-memory blocks...
[bam_sort_core] merging from 0 files and 16 in-memory blocks...
[bam_sort_core] merging from 0 files and 16 in-memory blocks...
[bam_sort_core] merging from 0 files and 16 in-memory blocks...
[bam_sort_core] merging from 0 files and 16 in-memory blocks...
[bam_sort_core] merging from 0 files and 16 in-memory blocks...
[bam_sort_core] merging from 0 files and 16 in-memory blocks...
[bam_sort_core] merging from 0 files and 16 in-memory blocks...
[bam_sort_core] merging from 0 files and 16 in-memory blocks...
[bam_sort_core] merging from 0 files and 16 in-memory blocks...
[E::bgzf_read] Read block operation failed with error 4 after 0 of 4 bytes
samtools sort: truncated file. Aborting Those are the bam affected, chr11,chrX. I do not know if this is a random event: ls /scratch/Theo/AP06/bam/filtered_bam/*_shift.bam
/scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_10_shift.bam /scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_2_shift.bam
/scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_12_shift.bam /scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_3_shift.bam
/scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_13_shift.bam /scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_4_shift.bam
/scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_14_shift.bam /scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_5_shift.bam
/scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_15_shift.bam /scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_6_shift.bam
/scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_16_shift.bam /scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_7_shift.bam
/scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_17_shift.bam /scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_8_shift.bam
/scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_18_shift.bam /scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_9_shift.bam
/scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_19_shift.bam /scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_M_shift.bam
/scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_1_shift.bam /scratch/Theo/AP06/bam/filtered_bam/A006200409_226916_S85.test_Y_shift.bam |
Dear all,
when I run
alignmentSieve
withATACshift
option, but not for all my samples, I get as output a truncated bam file.For instance this is the flagstat of my original bam:
Then I run the following shifting:
Then, a first thing is that the size of the file 2.4GB compared to the 5.4GB that I get without the shifting.
(I do not get any error message from
alignmentSieve
)Secondly when I try to sort the file I get the following error:
Furthermore if I try to run the flagstat on the resulting file I get that the file is indeed truncated with less than half of the read:
Thank you in advance for your help!
The text was updated successfully, but these errors were encountered: