Hi
I would like to extract a bam file with alignments length = 30.
I tried a script that I found on BioStar:
but, the out.bam still has alignments with length other than 30.
my in.bam was created by bowtie:
Please help
Thanks
Joseph
I would like to extract a bam file with alignments length = 30.
I tried a script that I found on BioStar:
Code:
samtools view -h in.bam | perl -lane '$l = 0; $F[5] =~ s/(\d+)[MX=DN]/$l+=$1/eg; print if $l = 30 or /^@/' | samtools view -bS - > out.bam
my in.bam was created by bowtie:
Code:
bowtie /indexes/dmelr5.42 -v 2 -k 5 --best --strata -S -t my.fastq | samtools view -uS -o my.bam -
Thanks
Joseph
Comment