This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to keep sample name while using samtools mpileup + varscan to do variant call?

Hello, everyone. I am using samtools mpileup and varscan to do variant call, but this will lost all the sample names. For example if I have 10 bam file name like 18R07049.bam ... 18R07058.bam, I pileup them all to 18R07.mpileup:

samtools mpileup -f myref.fasta -o 18R07.mpileup *.bam

Then use varscan mpileup2cns:

java -jar varscan.jar mpileup2cns 18R07.mpileup --output-vcf 1 > 18R07.vcf

When I checked 18R07.vcf i found it lost all the sample names, and become:

sample1 sample2 ... sample10

Then I tried not to mpileup all file to one file, I mpileup them separately and varscan mpileup2cns one by one, still it lost all sample names. I want to know how can I keep those sample names? thanks everyone.

samtools mpileup varscan

Why don't you simply awk them into the VCF when the process is finished?

1 answer

http://varscan.sourceforge.net/germline-calling.html

As of v2.3.1, you can provide a list of sample names to use in the VCF header with the --vcf-sample-list parameter. This list should be in plain text, one sample per line, in the order that samples appear in the raw mpileup input.

In creating the multisample mpileup with SAMtools for subsequent variant calling with Varscan2, did you populate the Bamlist file as alternating normal - tumor pairs or the sequence doesn't matter?

Eg, Bamlist.txt with each sample on a separate line:

NA1230-norm.bam
NA1230-tumor.bam
NA1231-norm.bam
NA1231-tumor.bam

Log in to answer this question.