I obtained .sam file after running hisat2 -x indexed -1 R1.fastq.gz -2 R2.fastq.gz -S hisat2_map.sam.I would like to filter this file so that only the reads that are aligned concordantly (1) exactly 1 time (2)* remain.
Could you help me with this please? Thank you very much in advance!
*I mean
... reads; of these:
... (...%) were paired; of these:
... (...%) aligned concordantly 0 times
... (...%) aligned concordantly exactly 1 time - these reads
... (...%) aligned concordantly >1 times
Edit:
It seems I need to use such a command
samtools view -hf 0x2 -q 3 hisat2_map.bam, where
-f 0x2- save properly paired alignments,
-q 3- skip alignments with MAPQ smaller than 3, because
60 - uniquely mapped read, regardless of number of mismatches / indels (which I need)
1 - multiply mapped, perfect match or few mismatches / indels
0 - unmapped, or multiply mapped and with lots of mismatches / indels
Good morning,
I obtained .sam file after running
hisat2 -x indexed -1 R1.fastq.gz -2 R2.fastq.gz -S hisat2_map.sam
.I would like to filter this file so that only the reads that are aligned concordantly (1) exactly 1 time (2)* remain.Could you help me with this please? Thank you very much in advance!
*I mean ... reads; of these: ... (...%) were paired; of these: ... (...%) aligned concordantly 0 times ... (...%) aligned concordantly exactly 1 time - these reads ... (...%) aligned concordantly >1 times
Edit: It seems I need to use such a command
samtools view -hf 0x2 -q 3 hisat2_map.bam
, where-f 0x2
- save properly paired alignments,-q 3
- skip alignments with MAPQ smaller than 3, because60 - uniquely mapped read, regardless of number of mismatches / indels (which I need) 1 - multiply mapped, perfect match or few mismatches / indels 0 - unmapped, or multiply mapped and with lots of mismatches / indels
Is it true? Thanks a lot!
Best regards, Poecile