This is a test version of Biostars. For the public version, visit https://www.biostars.org.
varscan.v2.3.9 CNV call "Error: Invalid format or not enough samples in mpileup"

I'm hitting a wall and need some help with this issue.

Overview: I have NGS data for a human tumor cell line (Onco_comb_rd.bam) for which I need to identify CNVs compared to a wild type human genome sequence. I understand I need a tumor/normal comparison for samtools mpileup | varscan copynumber (I am perfectly willing to use bcftools cnv if someone can tell me what is supposed to go after the -c and -s options)

I have mapped, sorted, and rmdup'd the tumor data. I do not have a "normal" set of data, so I generated a synthetic data set using one of the bbmap related tools. For the synthetic set, I tried to match the # of tumor reads as well as the approximate insert size. Mapped etc (hg38_synth.rd.bam)

It took a while to get mpileup to function without a memory error, but I eventually got it to work. I have tried this whoel process without piping the data, and with (latest command below), but keep running into the same (or close) error:

[mpileup] 2 samples in 2 input files
Min coverage:   10
Min avg qual:   15
P-value thresh: 0.01
<mpileup> Set max per-file depth to 4000
Reading input from STDIN
Reading mpileup input...
Error: Invalid format or not enough samples in mpileup: ##fileformat=VCFv4.2

At any rate, this is the latest version of the command:

samtools mpileup -Avuf /oasis/projects/nsf/csd414/pdehoff/Reference/GRCh38_latest_genomic.fna hg38_synth.rd.bam Onco_comb_rd.bam | java -Xmx4G -jar /oasis/projects/nsf/csd414/pdehoff/programs/VarScan.v2.3.9.jar copynumber --mpileup Onco_hg38

I've been pulling my hair out over this for a while and I need to understand what I'm doing wrong here. If any of you folks have some suggestions, please let me know. Thank you.

varscan copy number

2 answers

Try upgrading to the latest version 2.4.3. There have been some changes made in the 2.4.X versions to better handle the mpileup output.

I tried this out and it worked. Initially had the "Parsing Exception on line:" error.

Hopefully this will help other people out. Note that all of what is in the command may or may not be need, but the "awk" part (which I got from somewhere on SourceForge, was key.

samtools mpileup -B -q 1 -f /oasis/projects/nsf/csd414/pdehoff/Reference/GRCh38_latest_genomic.fna hg38_synth.rd.bam Onco_comb_rd.bam | awk 'NF==9 && $4!=0' | java -Xmx4G -jar /oasis/projects/nsf/csd414/pdehoff/programs/VarScan.v2.3.9.jar copynumber varScan --mpileup 1

Log in to answer this question.