I'm using samtools mpileup and would like to generate both a pileup file and a vcf file as output. I can see how to generate one or the other, but not both (unless I run mpileup twice). I suspect I am missing something simple.
Specifically, calling mpileup with the -g or -u flag causes it to compute genotype likelihoods and output a bcf. Leaving these flags off just gives a pileup. Is there any way to get both, without redoing the work of producing the pileup file? Can I get samtools to generate the bcf _from_ the pileup file in some way? Generating the bcf from the bam file, when I already have the pileup, seems wasteful.
Thanks for any help!
Although the file is named as
file.mpileup
,samtools mpileup -u
actually generates a BCF file. You can generate a pileup file without using -g and -u, then try this tool pileup_to_vcf to convert pileup file to vcf file.I have tried using both methods, I have generated a file.pileup which has the 6 columns and looks correct.
when I use the bcftools I get the warning that the column !=5 warning.
The
pileup_to_vcf
has also not worked and seems to just stall and not run (checking ps regularly)I have also used the
samtools sam_2_vcf.pl
script to no avail and this gives me an error saying that there is insufficient columns in the .pileup file (the opposite of bcftools).I am really stuck here as I need to get the files back to vcf.
Any help would be greatly appreciated!
pileup_to_vcf/test-data
folder. Run./pileup_to_vcf.py -i test-data/test.pileup -o test.out.vcf
and then you can get the vcf results (a file namedtest.out.vcf
). It's the same when you use your own mpileup files.samtools pileup
. However, this command is deserted in newer versions. The output ofsamtools mpileup
does not satisfy the requirement of sam2vcf.pl. You can check the required pileup format on lines 95-99, which is different from output ofsamtools mpileup
.Where can I download
pileup_to_vcf.py
? @Dejianwhat is reference.fa file? where can I download it?
That is the reference genome that you aligned your data to.
where can i download it? I want to map with human genome hg19?
You can download genome reference and annotation files from GENCODE.
Illumina's iGenomes site also has ready to use sequence/index/annotation bundles for various genomes.