Mpileup With A Region File
1
3
Entering edit mode
10.8 years ago
Dataminer ★ 2.8k

Hi!

I have two sorted .bam files and I have a set of regions (chr str stp) in a bed format (3 columns).

I would like to check for variants only in these regions rather through out the genome.

What I know, is that, following commands can be used

samtools mpileup -uD -r 2L:100,000-150,000 -f hg19.fa file1.sorted.bam file2.sorted.bam | bcftools view -bvcg - > RAL_samtools.raw.bcf
bcftools view RAL_samtools.raw.bcf | vcfutils.pl varFilter -D100 > RAL_samtools.vcf

but how can I put a region file and also filter the results based on regions that have more than 5X coverage on an average.

Any help is welcome.

Thank you

samtools variant chip-seq mpileup • 14k views
ADD COMMENT
6
Entering edit mode
10.8 years ago

Just use the -l regions.bed option in samtools mpileup:

samtools mpileup -uDl regions.bed -f hg19.fa file1.sorted.bam file2.sorted.bam | bcftools view -bvcg - > RAL_samtools.raw.bcf
bcftools view RAL_samtools.raw.bcf | vcfutils.pl varFilter -D100 > RAL_samtools.vcf
ADD COMMENT
0
Entering edit mode

Thank you, the command is running. One more thing, is it possible to add more cores to it?

ADD REPLY
2
Entering edit mode

The base samtools mpileup command is single threaded, so no. Having said that, you could just split the regions.bed file into multiple chunks and then run multiple instances of the command at once (perhaps merging the VCF files at the end). I'd be surprised if no one's yet written a little wrapper script to do that.

ADD REPLY

Login before adding your answer.

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