BAM detect unalign region
Hello folks,
I am running bowtie2 of a sequenced PCR product against a reference allele. Obviously here, my PCR product is bigger than the length of the sequence reads.
How can I detect the presence of unaligned regions/positions early on without visualising on IGV?
Thank you.
• 724 views
•
link
1 answer
samtools depth -r "chrom1:234-567" -a in.bam |\
awk '$3=="0" {printf("%s\t%d\t%s\n",$1,int($2)-1,$2);}' |\
sort -t $'\t' -k1,1 -k2,2n |\
bedtools merge
• 0 views
•
link
Log in to answer this question.