I have created a bowtie aligned .sam file with this command:
bowtie -S -p 18 /media/owner/ref.fa test1.fastq test1.sam
which I then converted to .bam file like this:
samtools view -bS -o test1.bam test1.sam
From this test1.bam, I was able to get the total number of plus and minus strand of reads aligned to the reference loci using bedtools coverage maping (for positives reads and negative reads) like this:
bedtools coverage -a my_region.bed -b test1.bam -bed -d -s | gzip > test1_region_pos.tsv.gz
Since I used default bowtie option which allows for three mismatches, I want to know how many reads are aligned with terminal mismatches (i.e,last three, last two and last one base mismatched at 3' region of the aligned reads at their loci position). How can I get this information? Thank for your help in advance.