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
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:
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.
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.<init>(Copynumber.java:693)
at net.sf.varscan.VarScan.copynumber(VarScan.java:317)
at net.sf.varscan.VarScan.main(VarScan.java:198)
Dear Pierre,
Thanks for the reply.
I have tried using both ways but getting sample error.