Mpileup Command Line
1
0
Entering edit mode
10.2 years ago
Giffredo ▴ 10

Hello,

I have a problem to use mpileup. I used this command:

samtools mpileup -f mi.fas sorted.bam > X.bcf &
bcftools view X.bcf > X.vcf &

it doesn't work "incorrect number of fields (0 != 5) at 0:0". I d like to optain vcf output from bam without using -u and -g in order to reach the result described in the manual http://samtools.sourceforge.net/samtools.shtml

If I try

samtools mpileup -f mi.fas sorted.bam > 2eccolo.bcf | bcftools view > 2eccolo.vcf&

It works but the results is an empty table...

P.S. using only the line below, it did not give me an output; I see only the results print on screen...

samtools mpileup -f mi.fas sorted.bam&
mpileup • 4.7k views
ADD COMMENT
1
Entering edit mode
10.2 years ago

The command you're looking for is tee

samtools mpileup -f mi.fas sorted.bam  | tee X.bcf | bcftools view - > 2eccolo.vcf

or something like that.

Edit: I just realized that you're not outputting BCF in the first place, just mpileup, which is text! That won't ever work. You'll need to use the -g or -v or similar.

ADD COMMENT
0
Entering edit mode

Unfortunately it doesn t work.. it gives me the same error incorrect number of fields (0 != 5) at 0:0 Anyway tee is a good idea! thanks!

ADD REPLY
1
Entering edit mode

Oh, I just noticed that you didn't use -g or -u or similar and updated my answer, since that won't work.

ADD REPLY

Login before adding your answer.

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