Thanks for your reply. I misunderstood the helper documentation. It should be -l instead of -r as you said.
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!
1 answer
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)
Log in to answer this question.
Hello jing.mengrabbit,
Please use the formatting bar (especially the
codeoption) to present your post better.For example:
Besides, I believe your command is:
Thanks for your advice.