timoast / sinto

Tools for single-cell data processing
https://timoast.github.io/sinto/
MIT License
112 stars 24 forks source link

Empty bam fles after merging in filterbarcodes #28

Closed anamariaelek closed 3 years ago

anamariaelek commented 3 years ago

I am splitting a bam file with sinto filterbarcodes -b $BAM -c $CELLS -p 16. This is a snippet of my input $BAM:

@HD     VN:1.6  SO:coordinate
@SQ     SN:chr_1        LN:356613585
GGGATTGGATCTATCT:NS500645:228:HGT2VAFX2:1:11311:15433:7613      1187    chr_1   9139    60      50M     =       9211    122     ATATACTCTATTAGCTCCTTTCTTTTTTCCTGGAAAGTAGGACATATTAT      AAAAAEEAAEAAE6EA6EEEAEEEEEEEEEEEEEEEEEEE/EEEEEEA6<      NM:i:0  MD:Z:50 AS:i:50 XS:i:22 MQ:i:60 MC:Z:50M        ms:i:1716       CB:Z:25m_PFA#GGGATTGGATCTATCT
GGGATTGGATCTATCT:NS500645:228:HGT2VAFX2:2:11306:22648:13604     1187    chr_1   9139    60      50M     =       9211    122     ATATACTCTATTAGCTCCTTTCTTTTATCCTGGAAAGTAGGACATATTAT      AAAAAEEEE<EAEEEEEEEEEAEEEE/E/EEE/EEEE6//EEEAEEEEAE      NM:i:1  MD:Z:26T23      AS:i:45 XS:i:0  MQ:i:60 MC:Z:50M        ms:i:1742       CB:Z:25m_PFA#GGGATTGGATCTATCT

Temporary files being created are ok, i.e barcodes are read and reads are split correctly, however after merging, all outputs are empty.

Is this a samtools merge or reheader issue that I can't figure out, or is it something sinto-related?

Thank you in advance, Anamaria

anamariaelek commented 3 years ago

It was indeed a samtools issue, I was using the old version, with samtools 1.12 everything works well. Sorry for the false alarm. Maybe you want to include this in the requirements, though. Regards!

frankligy commented 2 years ago

It was indeed a samtools issue, I was using the old version, with samtools 1.12 everything works well. Sorry for the false alarm. Maybe you want to include this in the requirements, though. Regards!

Hi,

I am running into the same problems as you did, temporary files look good but the merged outputs were empty. Would you mind sharing a bit more about the solutions here? Because as far as I understand, running sinto doesn't require us to explicitly install or load samtools right? So I wasn't sure how the version of samtools would play a role here, I must have missed something here.

Many thanks in advance, Frank

anamariaelek commented 2 years ago

Merging tmp files is done with samtools merge, followed by samtools reheader, see here. Smply updating samtools fixed it for me (I suppose the arguments or their order differed between the two versions).

frankligy commented 2 years ago

Merging tmp files is done with samtools merge, followed by samtools reheader, see here. Smply updating samtools fixed it for me (I suppose the arguments or their order differed between the two versions).

Thanks so much! I didn't dig that deep, yeah now it makes a lot of sense!