ValueError: csamtools.Samfile has the wrong size, try recompiling

25 views
Skip to first unread message

Franzi

unread,
Mar 6, 2012, 4:04:37 PM3/6/12
to JointSNVMix User Group
Dear Team,

I recently installed JointSNVMix-0.7.5.
I have Pysam-0.6 and Cython-0.14.1-6. I alsohave the python 2.7.2
with corresponding python-dev for all header filers.

While installing JointSNVMix there were no error messages.
But when I run

jsm.py train snv_mix_two ../reference/hg19_ref.fa /ngs/cancer/aln/bam/
separated/AB-Q_In15_clean.bam /ngs/cancer/aln/bam/separated/AB-
Q_In16_clean.bam config/indep_params.cfg config/indep_params.cfg /ngs/
cancer/snps/HS_params.cfg

or any other attempt to run jsm.py

I get the following error message:

ValueError: csamtools.Samfile has the wrong size, try recompiling

Do you have any idea what i am doing wrong?
I already used JointSNVMix-0.7.5 on a different machine and it worked
fine.

Thank you for any help you provide!
Franziska



################################### Full Error Message

jsm.py train snv_mix_one ../reference/hg19_ref.fa /ngs/cancer/aln/bam/
separated/AB-Q_In15_clean.bam /ngs/cancer/aln/bam/separated/AB-
Q_In16_clean.bam config/indep_params.cfg config/indep_params.cfg /ngs/
cancer/snps/HS_params.cfg
Traceback (most recent call last):
File "/usr/local/bin/jsm.py", line 9, in <module>
from joint_snv_mix.runners.train import snv_mix_one_train,
snv_mix_two_train, joint_snv_mix_one_train, \
File "/usr/local/lib/python2.7/dist-packages/joint_snv_mix/runners/
train.py", line 8, in <module>
from joint_snv_mix.counters.joint_binary_counter import
JointBinaryBaseCounter
File "joint_binary_counter.pyx", line 1, in init
joint_snv_mix.counters.joint_binary_counter (joint_snv_mix/counters/
joint_binary_counter.c:3141)
File "csamtools.pxd", line 388, in init
joint_snv_mix.counters.ref_iterator (joint_snv_mix/counters/
ref_iterator.c:3116)
ValueError: csamtools.Samfile has the wrong size, try recompiling

aroth

unread,
Mar 6, 2012, 4:52:03 PM3/6/12
to JointSNVMix User Group
Hi Franziska,
This is a problem with JointSNVMix and Pysam >= 0.6. If you go to the
older version of Pysam 0.5, it should work. The next release of
JointSNVMix will fix this, but it is still in beta testing for the
moment.

Cheers,
Andy

Franzi

unread,
Mar 6, 2012, 6:49:37 PM3/6/12
to JointSNVMix User Group

Thanks for the super fast answer!!!
It's working perfectly now :)

Jeff

unread,
Mar 14, 2012, 3:46:10 PM3/14/12
to JointSNVMix User Group
Hi, Andy,

I did not use Pysam0.6 but as instructed I installed pysam-0.5 (with
Cython-0.15.1 and JointSNVMix-0.7.5 in Python2.7.2). However, I got
following similar errors when I tried to test or run jsm.py: Would you
help.

Thanks,
Jeff

python ../python-2.7.2/bin/jsm.py classify snv_mix_two -h

Traceback (most recent call last):
File "../python-2.7.2/bin/jsm.py", line 9, in <module>
from joint_snv_mix.runners.train import snv_mix_one_train,
snv_mix_two_train, joint_snv_mix_one_train, \
File "../python-2.7.2/lib/python2.7/site-packages/joint_snv_mix/
runners/train.py", line 8, in <module>
from joint_snv_mix.counters.joint_binary_counter import
JointBinaryBaseCounter
File "joint_binary_counter.pyx", line 1, in init
joint_snv_mix.counters.joint_binary_counter (joint_snv_mix/counters/
joint_binary_counter.c:3141)
File "csamtools.pxd", line 433, in init
joint_snv_mix.counters.ref_iterator (joint_snv_mix/counters/
ref_iterator.c:3122)
ValueError: csamtools.IteratorRowRegion has the wrong size, try
recompiling

aroth

unread,
Mar 14, 2012, 4:12:51 PM3/14/12
to JointSNVMix User Group
Hi Jeff,
Did you ever have another version of pysam installed? The main reason
this error occurs is that JointSNVMix links against the old header
files from pysam-0.5. If it finds a new version of pysam likely
causing this error. It may also have problems if it for some reason
used an older version of the pysam headers.

If you have never installed anything but pysam-0.5 this is definitely
peculiar. In that case it may be easier to try version 0.8-b2, the
beta release of the next version. It is not properly documented yet
but I believe the code itself is fairly stable. It removes the pysam
dependency along with adding some other features, and removing some
legacy features like the Fisher models. If you are game you can give
it a try, the commands are relatively straightforward and you can get
help using the -h command.

I have posted a bit about the commands for the new version in this
group so you should be able to find more help.

Cheers,
Andy

Jeff

unread,
Mar 14, 2012, 10:26:24 PM3/14/12
to JointSNVMix User Group
Hi, Andy,

Thank you for your hints. It turned out I had pysam 0.41 installed in
my user profile and it was taken instead of the newly installed 0.5.
After disabling that version, now it is working!

Thank you again,

Jeff
Reply all
Reply to author
Forward
0 new messages