Hi there
#read in protein model = IMP. Model() mhd = IMP.atom.read_pdb(pdb_name, model, IMP.atom.NonWaterNonHydrogenPDBSelector()) ff = IMP.atom.get_heavy_atom_CHARMM_parameters() top = ff.create_topology(mhd) top.add_atom_types(mhd) bonds = top.add_bonds(mhd) angles = ff.create_angles(bonds) dihedrals = ff.create_dihedrals(bonds)
Why is this last line so much slower than the others? It's sad, because it takes up most of the time in the construction of a protein hierarchy.
thanks!
Yannick
On 9/12/14, 6:05 AM, Yannick SPILL wrote: > angles = ff.create_angles(bonds) > dihedrals = ff.create_dihedrals(bonds) > > Why is this last line so much slower than the others? It's sad, because > it takes up most of the time in the construction of a protein hierarchy.
It shouldn't be any slower than create_angles() - both iterate over all bonds and extend them at one end (for angles) or both ends (for dihedrals). How much is "so much slower"? Where does profiling say time is being spent?
Ben
Le 12/09/14 19:59, Ben Webb a écrit : > On 9/12/14, 6:05 AM, Yannick SPILL wrote: >> angles = ff.create_angles(bonds) >> dihedrals = ff.create_dihedrals(bonds) >> >> Why is this last line so much slower than the others? It's sad, because >> it takes up most of the time in the construction of a protein hierarchy. > > It shouldn't be any slower than create_angles() - both iterate over > all bonds and extend them at one end (for angles) or both ends (for > dihedrals). How much is "so much slower"? Where does profiling say > time is being spent? > > Ben
pdb_name='6LYZ.pdb' #read in protein a=time.time() model = IMP. Model() mhd = IMP.atom.read_pdb(pdb_name, model, IMP.atom.NonWaterNonHydrogenPDBSelector()) ff = IMP.atom.get_heavy_atom_CHARMM_parameters() top = ff.create_topology(mhd) top.add_atom_types(mhd) bonds = top.add_bonds(mhd) c=time.time() angles = ff.create_angles(bonds) d=time.time() dihedrals = ff.create_dihedrals(bonds) e=time.time() print "init",c-a print "angles",d-c print "dihedrals",e-d
512 [yannick@lap-2 lysozyme]$ impf python test.py init 0.135031938553 angles 0.0178110599518 dihedrals 0.414628982544
On 9/13/14, 4:27 AM, Yannick Spill wrote: > 512 [yannick@lap-2 lysozyme]$ impf python test.py > init 0.135031938553 > angles 0.0178110599518 > dihedrals 0.414628982544
Right, it's the actual lookup of the CHARMM parameter information that takes the time. That's tricky to speed up (and at 0.4s I don't think it's worth worrying about too much) because of the way these parameters are specified (more than one parameter can be given for each dihedral, and wildcards need to be checked). But there were some unnecessary copies in there which I just removed - that should speed it up some.
Ben
Le 16/09/14 00:20, Ben Webb a écrit : > On 9/13/14, 4:27 AM, Yannick Spill wrote: >> 512 [yannick@lap-2 lysozyme]$ impf python test.py >> init 0.135031938553 >> angles 0.0178110599518 >> dihedrals 0.414628982544 > > Right, it's the actual lookup of the CHARMM parameter information that > takes the time. That's tricky to speed up (and at 0.4s I don't think > it's worth worrying about too much) because of the way these > parameters are specified (more than one parameter can be given for > each dihedral, and wildcards need to be checked). But there were some > unnecessary copies in there which I just removed - that should speed > it up some. > > Ben
okay, that's cool, thank you! It doesn't seem to take a long time here, but for big molecules I remember that setup can take up to a minute!
participants (2)
-
Ben Webb
-
Yannick SPILL