Entering edit mode
6.7 years ago
devin.porter92
•
0
I am trying to use bamtools filter to keep output a new bam file with a specific sequence. This is what I am using...
bamtools filter -in Aligned.bam -queryBases AAACCTG >Aligned_1.bam
This does not return any matches. The question I am asking, is it possible to filter sequencing reads from a BAM file that has specific sequence of interest? If so, how? Are there any other tools that might be able to do this?
Thanks in advance for any guidance provided.
Thanks a lot! I was able to make it work with the following:
samtools view -h input.bam | awk -F '\t' '($1 ~ /^@/ || $10 ~/AAACCTG/ )' >filter.sam ; samtools view filter.sam -Sb -o filter.bam
ah yes, I forgot to write the last hyphen on my command line. You should be able to write filter the bam without writing this 'filter.sam'.
Please check the green mark on the left to flag this question as answered.