COMBINE-lab / RapMap

Rapid sensitive and accurate read mapping via quasi-mapping
GNU General Public License v3.0
89 stars 23 forks source link

-u always active, unaligned reads cause parse error in samtools #47

Open jmcasc opened 5 years ago

jmcasc commented 5 years ago

At the moment, RapMap always prints unaligned reads, even if the -u flag is not given. The writeUnmapped variable seems to be set according to the flag, but is later ignored. Whenever such an unaligned read entry is read by samtools for sam->bam conversion, samtools terminates with a "parse error on line xxxxx".

Happens on current master branch and with current samtools version.

mflevine commented 4 years ago

Yea, writeUnmapped variable is never used or checked.

shengxingou commented 7 months ago

At the moment, RapMap always prints unaligned reads, even if the -u flag is not given. The writeUnmapped variable seems to be set according to the flag, but is later ignored. Whenever such an unaligned read entry is read by samtools for sam->bam conversion, samtools terminates with a "parse error on line xxxxx".

Happens on current master branch and with current samtools version.

I have encountered the same problem. I found that changing the eighth column of the Sam file to 0 can solve this problem. But I don't know why that's the case. "rapmap quasimap -i newest_ref_index -1 <(gunzip -c R1.fq.fastp.gz) -2 <(gunzip -c R2.fq.fastp.gz) -t 10 -u -o test.sam cat test2.sam|awk '{if ($8 == "") $8 = "0"; print}' OFS='\t'|samtools view -@ 10 -bS -f 12 > test.sam.f12.bam"