Viewing Multiple Regions In Samtools
1
3
Entering edit mode
12.2 years ago
axelwilhelm ▴ 120

Hi all

I'm wondering if there is a way to exclude regions in samtools view.

Now I awk and sed lines away in post processing via piping.

Wouldn't it save time and space to just pileup more than one region at once into a file?

Maybe this is a dumb question but I don't have the software now while I'm wondering so I can't experiment.

For example:

samtools view chrY:2709520-3709520, chrY:17443438-27443438 ǀ samtools mpileup...
samtools view chrY:2709520-3709520 AND chrY:17443438-27443438 ǀ samtools mpileup.
samtools view chrY:2709520-3709520: chrY:17443438-27443438 ǀ samtools mpileup...

...

samtools • 5.4k views
ADD COMMENT
8
Entering edit mode
12.2 years ago

samtools view takes an argument to only output the alignments overlapping the regions of a BED file:

-L FILE  output alignments overlapping the input BED FILE [null]
ADD COMMENT
0
Entering edit mode

update 2021: use option -M to go faster with an indexed bam.

ADD REPLY

Login before adding your answer.

Traffic: 1469 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