ValueError when running jsm.py train

35 views
Skip to first unread message

Ron Ammar

unread,
Oct 16, 2012, 5:40:02 PM10/16/12
to jointsnvmix...@googlegroups.com
Hello,
I'm trying to run JointSNVMix for the first time and am getting this error. I installed Python 2.7.3, Cython and pysam 0.5.
Here's the error:
Traceback (most recent call last):
  File "build/scripts-2.7/jsm.py", line 224, in <module>
    args.func(args)
  File "/DSC4/DSC4/hip/temp_guest/JointSNVMix/Python-2.7.3-bin/lib/python2.7/site-packages/joint_snv_mix/runners/train.py", line 43, in joint_snv_mix_one_train
    sample = ss.subsample(counter)
  File "joint_snv_mix.pyx", line 40, in joint_snv_mix.trainers.joint_snv_mix.PairedDataSubSampler.subsample (joint_snv_mix/trainers/joint_snv_mix.c:3038)
  File "joint_binary_counter.pyx", line 27, in joint_snv_mix.counters.joint_binary_counter.JointBinaryBaseCounter.iter_ref (joint_snv_mix/counters/joint_binary_counter.c:1559)
  File "base_counter.pyx", line 22, in joint_snv_mix.counters.base_counter.BaseCounter.iter_ref (joint_snv_mix/counters/base_counter.c:1315)
  File "csamtools.pyx", line 927, in csamtools.Samfile.pileup (pysam/csamtools.c:9857)
ValueError: no index available for pileup

Any ideas?
Thanks,
Ron

aroth

unread,
Oct 16, 2012, 5:42:27 PM10/16/12
to JointSNVMix User Group
Hi Ron,
This mostly likely means the BAM file or reference genome has to be
indexed. To index BAM files use the samtools index command. For the
reference genome FASTA use the samtools faidx comman.

Cheers,
Andy

On Oct 16, 2:40 pm, Ron Ammar <ron.am...@gmail.com> wrote:
> Hello,
> I'm trying to run JointSNVMix for the first time and am getting this error.
> I installed Python 2.7.3, Cython and pysam 0.5.
> Here's the error:
> Traceback (most recent call last):
>   File "build/scripts-2.7/jsm.py", line 224, in <module>
>     args.func(args)
>   File
> "/DSC4/DSC4/hip/temp_guest/JointSNVMix/Python-2.7.3-bin/lib/python2.7/site- packages/joint_snv_mix/runners/train.py",

Ron Ammar

unread,
Oct 16, 2012, 5:46:35 PM10/16/12
to jointsnvmix...@googlegroups.com
Hi Andy,
Thanks for the quick response! It is indexed, but I tried reindexing it, just in case, using Samtools - this didn't change the outcome. The BAM files are also indexed.
Not sure if this helps, but the command I'm using is:

build/scripts-2.7/jsm.py train joint_snv_mix_one chromosomes.fasta CaLC660_PHRED20_SORTED.bam 1371.sam.bam-SORTED.bam config/joint_priors.cfg config/joint_params.cfg joint_snv_mix_one_params_TEST.cfg

Thanks,
Ron

aroth

unread,
Oct 16, 2012, 5:56:24 PM10/16/12
to JointSNVMix User Group
Hi Ron,
Usually when this happens the mostly likely cause is that the program
is not finding the files. Maybe try specifying absolute paths to every
file. Also the program assumes that the index files for the BAM files
are in the same location with same name, but with a .bai added. It
might be useful to double check that.

Cheers,
Andy

Ron Ammar

unread,
Oct 17, 2012, 10:10:32 AM10/17/12
to jointsnvmix...@googlegroups.com
Hi Andy,
Thanks for the pointers. I figured out the problem: it was that the index files had to have ".bai" appended to the end of the filename. So if the file was test.bam, jsm was looking for test.bam.bai, rather than test.bai. 
Thanks for your help!
Ron
Reply all
Reply to author
Forward
0 new messages