This is a test version of Biostars. For the public version, visit https://www.biostars.org.
filter bam file

Hi

I have merged bam file which has 24-101 bp reads. I would like to find the alternative splice events using MISO. I need to filter the reds in my merged bam file and keep only reads with 100 bp length. Is there any way to do that?

Thanks in advance

rna-seq

2 answers

samtools view -h my.bam | awk '{if($0~/^@/ || length($10) == $Desired_length){print $0}}' | samtools view -bS - > my_new.bam

Try: samtools view -m 100

Log in to answer this question.