Extract Reads From A Bam File That Fall OUTSIDE A Given Region
1
0
Entering edit mode
23 months ago
irfanwustl ▴ 80

Using samtools view -L FILE command we can extract reads which are in the FILE regions. Is there a way to extract reads which are OUTSIDE of the FILE regions?

Thanks

bam • 597 views
ADD COMMENT
1
Entering edit mode

I would suggest 2 options: 1) Create a bed file with the complementary regions to your current region file and run samtools with that new bed file. 2) Use bedtools intersect, applying -v argument.

ADD REPLY
3
Entering edit mode
23 months ago

samtools view -L in.bed --unoutput out.bam in.bam > /dev/null

ADD COMMENT

Login before adding your answer.

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