This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Varscan Error On Mpileup Input

Hello, I am trying to filter low quality data off my mpileup files using Varscan but keep getting stuck with the error message: Invalid format for pileup at line 1. I don't think my vcf tools are corrupted, since they have made it through bedtools instersect.

The command lines I have used are the following:

samtools mpileup -uf genome.fa 1.bam 2.bam | bcftools view -bvcg -> *.bcf

I also used -vcg -> *.vcf and even ommitted -u. For VarScan I am typing:

java -jar VarScan.jar mpielup *.vcf  --output-vcf

Any tip to as why is my vcf file not recognized by VarScan will be appreciated.

varscan

2 answers

Do you want to convert the samtools mpileup format to variant calls and filter them for variant allele frequency, #reads supporting variant/reference, etc? Then the command you should use is

samtools mpileup -uf genome.fa 1.bam 2.bam | java -jar /path/to/VarScan.jar mpileup2snp --output-vcf > your_sample.vcf

So not

java -jar VarScan.jar mpielup *.vcf --output-vcf

So, it expects a .pileup-file, not vcf

Thanks, I went ahead with your recommendation, but I get the same error: invalid format at line 1. My bam files have a header, are sorted, and the duplicates removed.I also tried adding Read Groups, which are needed to get GATK working. Any other suggestions?

The job actually went through when taking -u off in samtools mpileup . Thanks again!

Nice you have sorted it out!

Irsan, thanks for helping out!

Log in to answer this question.