Generate A Subset Of Bam Or Reads Based On Vcf
2
1
Entering edit mode
11.3 years ago
jlduan ▴ 10

Generate a subset of BAM or reads based on VCF

After mapping, I am interested in extracting a subset of bam or reads with certain genoytpes. Could you please advise me some efficient ways to do this?

Thanks in advance!

vcf bam • 2.9k views
ADD COMMENT
2
Entering edit mode
11.3 years ago

loop over each mutation and extract the subset of BAM using samtools view in.bam chr:start-end

ADD COMMENT
0
Entering edit mode

If two different genotypes are in the same positon, this method cannot distinguish them.

ADD REPLY
1
Entering edit mode
ADD REPLY
0
Entering edit mode
8.9 years ago

Via BEDOPS and bash substitution:

$ bedops -e 1 <(bam2bed < reads.bam) <(vcf2bed < variants.vcf) > reads_overlapping_variants.bed
ADD COMMENT

Login before adding your answer.

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