[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [IMP-dev] slow molecule building



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