I have a bam file that I'd like to filter. I want to filter out all the reads that were aligned to intronic regions - i.e., CIGAR field containing an N.
Anyone familiar with a way to filter out reads with CIGAR field containing an N?
Note: I could convert all the Bams to Sams and then write my own custom script, but was wondering if it'd be possible with samtools or picard tools directly, couldn't find any direct instruction.
Note2: The bam was generated by aligning mRNA-Seq to the genome.
Please let me know.