tseemann / samclip

Filter SAM file for soft and hard clipped alignments
GNU General Public License v3.0
46 stars 10 forks source link

problem using --max 0: keeps soft reads #17

Open emlec opened 3 years ago

emlec commented 3 years ago

Hello Torsten,

Thank you for the development of samclip. I want to exclude all soft-clipped reads (6 in all) from my dataset. The line below does not seem to work. No soft-clipped reads are removed. samtools bamfile.bam | samclip --ref sequence.fa --max 0 --debug | cut -f 6 | sort |uniq -c

[samclip] Found 1 sequences in sequence.fa.fai
[samclip] GOOD CHROM=sequence:1..3298 POS=3262..3355 CIGAR=37M57S L=0 R=0 | HL=0 SL=0 SR=57 HR=0 max=0)
[samclip] GOOD CHROM=sequence:1..3298 POS=3217..3310 CIGAR=82M12S L=0 R=0 | HL=0 SL=0 SR=12 HR=0 max=0)
[samclip] GOOD CHROM=sequence:1..3298 POS=3273..3366 CIGAR=26M68S L=0 R=0 | HL=0 SL=0 SR=68 HR=0 max=0)
[samclip] GOOD CHROM=sequence:1..3298 POS=3258..3351 CIGAR=41M53S L=0 R=0 | HL=0 SL=0 SR=53 HR=0 max=0)
[samclip] GOOD CHROM=sequence:1..3298 POS=1..94 CIGAR=75S19M L=0 R=0 | HL=0 SL=75 SR=0 HR=0 max=0)
[samclip] GOOD CHROM=sequence:1..3298 POS=1..94 CIGAR=10S84M L=0 R=0 | HL=0 SL=10 SR=0 HR=0 max=0)
[samclip] Total SAM records 20390, removed 0, allowed 6, passed 20390
[samclip] Header contained 0 lines
[samclip] Done.
      1 10S84M
      1 26M68S
      1 37M57S
      1 41M53S
      1 75S19M
      1 82M12S
  20384 94M

The --invert option, which allows to keep only soft-clipped reads, works fine. Thanks in advance for your feedback, Emilie