Question: recommended way of filtering out non-karyotype ref sequences and reads from a bam file?
gravatar for 14134125465346445
3.3 years ago by
United Kingdom
141341254653464453.4k wrote:

What is the recommended way of filtering out the '@SQ' lines and the reads mapping to non-karyotypic sequences from a bam file?

At the moment I use a simple bash one-liner like the one below, but I presume there must be a cleaner way to do it with samtools/sambamba or some other tool.


samtools view -h -L $karyotype_bed $inputfile | grep -v decoy | grep -v HLA | grep -v _alt | grep -v chrUn | grep -v random | grep -v chrEBV | samtools view -bS - > $outfile


sambamba samtools bam • 849 views
ADD COMMENTlink modified 3.3 years ago • written 3.3 years ago by 141341254653464453.4k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 736 users visited in the last hour