Bam files not accepted in dba.count
0
0
Entering edit mode
5 weeks ago

The script I had working 2 years ago for DiffBind no longer works. Dba.count seems to reject files it accepted before.

   sets_counted_g=dba.count(sets_g)
Computing summits...
Sample: H:/(filepath truncated)/file_sorted.bam125  
Re-centering peaks...
Indexing H:/(filepath truncated)/file_sorted.bam
[E::hts_idx_push] NO_COOR reads not in a single block at the end 2 -1
Error in FUN(X[[i]], ...) : failed to build index
  file: H:/CH_DATA/ATAC/2020_Second_postprocessing/bam/PoolCH-7_sorted.bam
In addition: Warning message:
Parallel execution unavailable: executing serially.

I thought I'd sorted this file by position, but I went ahead and re-sorted it using

samtools sort file_sorted.bam -o file_sorted_byposition.bam

The result still fails to count:

sets_counted_g=dba.count(sets_g)
Computing summits...
Sample: H:/(filepath truncated)/file_sorted_byposition.bam125 
Re-centering peaks...
Error in colnames(result)[4:ncol(result)] <- colnames(classes) : 
  replacement has length zero
In addition: Warning message:
Parallel execution unavailable: executing serially

Tagged this with both samtools and Diffbind because it looks like a samtools problem, but the script worked as-is 2 years ago for DiffBind. So maybe DiffBind is involved. Picard ValidateSamFile returned no errors on the file.

samtools diffbind dba.count bam • 132 views
ADD COMMENT
0
Entering edit mode

what is the output of

samtools quickcheck file_sorted_byposition.bam

is file_sorted_byposition.bam indexed with samtools index ?

ADD REPLY
0
Entering edit mode

Thanks Pierre,

Quickcheck exited without error. I did generate an index for file_sorted_byposition.bam, but DiffBind doesn't call for indexes.

ADD REPLY
0
Entering edit mode

I would as a first diagnostic recommend to run the example data from the vignette (they have some bam files) with the code you have for your project and see how this goes, unless you have already done this. This probably shows whether it is something in your code (that might conflict with the now newer diffbind versions) or indeed the bam files itself. I am not a DiffBind user myself so cannot speak from experiences, but can it me differences in chromosome names between peaks and bam, just tossing in here some ideas to sort out first.

ADD REPLY

Login before adding your answer.

Traffic: 2231 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