Question: samtools mpileup's options -b (more than one bam file) and -r cannot be used together
0
gravatar for jing.mengrabbit
10 months ago by
jing.mengrabbit30 wrote:

Hi, I would like to generate a mpileup file from 2 bam files in some regions instead of the whole chromosomes:

samtools -b bam_list_file -r regions_to_be_parsed.bed > mpileup_from_two_bam_files.pileup

The content in the bam_list_file is

~/1.bam

~/2.bam

but an error was given:

[E::mpileup] fail to parse region 'regions_to_be_parsed.bed' with 1.bam.

I do not think there is something wrong with the bam files or the bed file, because it works when I ran with the following command:

samtools -r regions_to_be_parsed.bed ~/1.bam > mpile1.pileup

samtools -r regions_to_be_parsed.bed ~/2.bam > mpile2.pileup

samtools -b bam_list_file > mpileup_from_two_bam_files.pileup

Is there some way to generate a mpileup file from two bam files with regions in bed file? Thanks for your time!

sequence software error • 403 views
ADD COMMENTlink modified 10 months ago by h.mon24k • written 10 months ago by jing.mengrabbit30

Hello jing.mengrabbit,

Please use the formatting bar (especially the code option) to present your post better.

Formatting bar

For example:

samtools -b bam_list_file -r regions_to_be_parsed.bed > mpileup_from_two_bam_files.pileup

Besides, I believe your command is:

samtools mpileup -b bam_list_file -r regions_to_be_parsed.bed > mpileup_from_two_bam_files.pileup
ADD REPLYlink written 10 months ago by h.mon24k

Thanks for your advice.

ADD REPLYlink written 10 months ago by jing.mengrabbit30
2
gravatar for h.mon
10 months ago by
h.mon24k
Brazil
h.mon24k wrote:

Are you sure about -r regions_to_be_parsed.bed? The help says:

-r, --region REG region in which pileup is generated

I think -r should be used as -r chr1:200-210. For using bed files as intervals, you should use -l:

-l, --positions FILE skip unlisted positions (chr pos) or regions (BED)

ADD COMMENTlink modified 10 months ago • written 10 months ago by h.mon24k

Thanks for your reply. I misunderstood the helper documentation. It should be -l instead of -r as you said.

ADD REPLYlink written 10 months ago by jing.mengrabbit30
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1980 users visited in the last hour