Dear Colleagues,
Is there a way to filter out reads with specific properties from bam file, for example, after mapping my small RNA reads to a reference genome by Bowtie, I would like to filter out all the mapped reads that have a stretch of 3 G bases ("GGG") at the beginning of the reads from the bam file and I would like to have two output bam files in which one bam file having all the reads which are starting with "GGG" (the filtered out reads) and the other bam file having all the rest of reads.
If this could not be done, maybe I need to generate a bed file from the bam file and do the operation on the bed file?
I really appreciate it if you have any inputs.
Thanks ahead,
Xiao
thanks a lot, samjdk works great in my case
if it worked, please, check the green mark on the left to validate+ close the question.
Do you mean the green checkmark ? I just clicked it. Thanks.