Extract Reads From A Bam File That Fall OUTSIDE A Given Region
1
0
Entering edit mode
2.5 years ago
irfanwustl ▴ 90

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 • 694 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
2.5 years ago

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

ADD COMMENT

Login before adding your answer.

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