recommended way of filtering out non-karyotype ref sequences and reads from a bam file?
0
1
Entering edit mode
6.0 years ago

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

```

bam samtools sambamba • 1.5k views
ADD COMMENT

Login before adding your answer.

Traffic: 2819 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6