brentp / goleft

goleft is a collection of bioinformatics tools distributed under MIT license in a single static binary
MIT License
216 stars 25 forks source link

indexcov everything is DEL or DUP #74

Closed lindenb closed 8 months ago

lindenb commented 8 months ago

Hi Brent,

a collaborator sent me some BAI files so we can run goleft/indexcov with his data and ours.

I generated an empty BAM file for each of their BAI

Nevertheless while our data look OK (bottom pane) their data look like everything is DEL/DUP (upper pane).

jeter3

Furthermore, the outputs of 'samtools idxstats' with our data compared to their data looks ok.

paste <(samtools idxstats our.bam | grep 'chr[0-9]' | cut -f1,3) \
      <(samtools idxstats their.bam  | grep 'chr[0-9]' | cut -f1,3) |\
      awk '{printf("%s %s\n",$0,$2/$4);}' | column -t
#chr1  count1    chr2   count2    ratio
chr1   40221821  chr1   68558570  0.586678
chr2   43034497  chr2   73728046  0.583692
chr3   35714800  chr3   60882967  0.586614
chr4   34705884  chr4   59255691  0.585697
chr5   32205588  chr5   55083733  0.584666
chr6   30793378  chr6   52560598  0.585864
chr7   27787405  chr7   47472384  0.585338
chr8   25929357  chr8   44461685  0.583184
chr9   20115268  chr9   34804208  0.577955
chr10  23335847  chr10  39731924  0.587332
chr11  23611150  chr11  40148858  0.58809
chr12  23738934  chr12  40350432  0.588319
chr13  17632188  chr13  30138860  0.585032
chr14  16000634  chr14  27337135  0.585308
chr15  14345507  chr15  24524322  0.58495
chr16  14068644  chr16  24359040  0.577553
chr17  13520414  chr17  22889588  0.59068
chr18  13669048  chr18  23367921  0.584949
chr19  9538848   chr19  15874980  0.600873
chr20  10586429  chr20  17864543  0.592594
chr21  6563796   chr21  11217204  0.585154
chr22  5807055   chr22  9807610   0.592097

what could be the source of the problem ?

Thanks, P.

lindenb commented 8 months ago

OK my colleague figured it out, he generated the bai using --input-fmt-option required_fields=0x1e , somehow it breaks the expected format in the bai

brentp commented 8 months ago

Hi Pierre, I'm glad you figured this out! I was just about to reply with some guesses that were now clearly not correct.