You are here

segfault in loop

2 posts / 0 new
Last post
segfault in loop
#1

I wrote a script to "idealize" a protein using the new conformation dependent library (Berkholz et al. 2009).
All my statements evaluate fine by themselves but when I run the loop a segfault occurs. Anyone have any hints?

I'd paste the entire script but it's essentially unreadable here (sorry).
See http://libra.sfsu.edu/~dasarnow/CDIdeal.py

The business end of the code looks like this:

for i in range(1,ni.total_residue()+1):
fields, geometry_bin = pgd.angles.get_geometry(dbdict,ni.residue(i).name(),ni.residue(i+1).name(),ni.phi(i),ni.psi(i))
geometry = [float(x) for x in str(geometry_bin).split("\t")]
L1 = geometry[11]; L2 = geometry[13]; **&c. for all the angles and lengths**
Ni = AtomID(1,i)
Cai = AtomID(2,i)
Ci = AtomID(3,i)
ni.conformation().set_bond_length(Ni,Cai,L2)
ni.conformation().set_bond_angle(Ni,Cai,Ci,t3)

Sat, 2010-02-13 21:49
reve_etrange

Oops, passed ni.residue() an illegal value (ni.total_residue()+1)!
Current (and working) version at above URL.

Note that by "working", I mean, "doesn't crash" and not "actually does what one wants."

Mon, 2010-02-15 22:09
reve_etrange