This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problem generating Varscn2 copynumber output

Hi,

I'm trying to generate CNVs using Varscan2. I am getting following ERROR

java -jar /opt/VarScan.v2.3.6.jar copynumber normal.mpliup tumor.mpliup
Normal Pileup: normal.mpliup
Tumor Pileup: tumor.mpliup
Min coverage:    10
Min avg qual:    15
P-value thresh:    0.01
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 5
    at net.sf.varscan.Copynumber.<init>(Copynumber.java:693)
    at net.sf.varscan.VarScan.copynumber(VarScan.java:317)
    at net.sf.varscan.VarScan.main(VarScan.java:198

Please Suggest.

varscan varscan2 cnv copy-number-analysis

3 answers

Hi,

Hopefully, this is no longer an issue for you but I have had the same problem this morning and thought I ought to post my fix. In my hands Varscan crashes if a sample on any line of the input pileup has zero coverage:

# FAILING CMD:
​samtools mpileup -q 1 -f ref.fasta n.bam t.bam | java -jar VarScan.v2.3.7.jar copynumber out.bn --mpileup 1
# WORKING CMD:
samtools mpileup -q 1 -f ref.fasta n.bam t.bam |\
awk -F"\t" '$4 > 0 && $7 > 0' |\
java -jar VarScan.v2.3.7.jar copynumber out.bn --mpileup 1

Note that this seems to be a bug, but that VarScan's forums appear t be down so I can't post it. The program runs fine if I ensure that just the second mpileup column is nonzero (using $7 > 0 alone); it fails if I ensure that just the first mpileup column is nonzero (using $4 > 0 alone).

If you have two separate pre-prepared pileups, I'd take the intersection of the covered positions before passing them into VarScan, though it would probably be easier just to construct a 2-sample coverage-filtered pileup (using code similar to the above) and either pass it or pipe it into Varscan.

Regards

Russ

In http://varscan.sourceforge.net/copy-number-calling.html

The syntax of the command for copy number calling is most similar to the VarScan somatic tool.

java -jar VarScan.jar copynumber normal-tumor.pileup output.basename --mpileup 1

Or, if you have independent normal and tumor pileup files:

java -jar VarScan.jar copynumber normal.pileup tumor.pileup output.basename

an argument is missing.

Dear Pierre,

Thanks for the reply.

I have tried using both ways but getting sample error.

gsk - did you ever figure out how to run it?

I'm getting similar errors, and I've seen others listing similar errors as well, but I haven't seen a solution yet.

I generated two separate pileup files, using the -B flag, and use them as input to varscan copynumber as follows:

java -jar VarScan.v2.3.7.jar copynumber normal.pileup tumor.pileup outfile

I get this error:

Normal Pileup: normal.pileup
Tumor Pileup: tumor.pileup
Min coverage:    10
Min avg qual:    15
P-value thresh:    0.01
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 5
    at net.sf.varscan.Copynumber.&lt;init&gt;(Copynumber.java:693)
    at net.sf.varscan.VarScan.copynumber(VarScan.java:317)
    at net.sf.varscan.VarScan.main(VarScan.java:198)

Log in to answer this question.