Question: recommended way of filtering out non-karyotype ref sequences and reads from a bam file?
gravatar for 14134125465346445
5.0 years ago by
United Kingdom
141341254653464453.5k 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 • 1.3k views
ADD COMMENTlink modified 5.0 years ago • written 5.0 years ago by 141341254653464453.5k
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: 1255 users visited in the last hour