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

Re: [IMP-dev] Atom::create



> atom = IMP::atom::Atom::create(p,IMP::atom::AT_CA)
> connecting this atom to a molecule ( with residue and chain of course)

I tried to do the same thing now, i.e. print single coordinate in PDB format.
something that normally should take 2 lines of code and ended up with 14 lines.
        m = IMP.Model()
        rp = IMP.Particle(m)
        ap = IMP.Particle(m)
        cp = IMP.Particle(m);
        chain = IMP.atom.Chain.create(cp, 'A')
        residue = IMP.atom.Residue.create(rp)
        atom = IMP.atom.Atom.create(ap, IMP.atom.AT_CA)
        xyz = IMP.core.XYZ.create(ap)
        hcd = IMP.atom.Hierarchy.cast(cp)
        hrd = IMP.atom.Hierarchy.cast(rp)
        had = IMP.atom.Hierarchy.cast(ap)
        hcd.add_child(hrd)
        hrd.add_child(had)
        print atom.get_pdb_string()

Is there a way to make it simpler?
Am I the only one who thinks it should be simpler?

Dina

> On Aug 6, 2009, at 7:05 PM, Daniel Russel wrote:
>
>> It should get it from the aromtype for all properly initialized atom
>> types. If it isn't currently doing that blame Dina :-) we should be able to
>> fix it easily.
>>
>> I'm not sure there is a reason to store the element in the particle rather
>> than just look it up from the atomtype when get_element is called. Is there?
>>
>>
>>
>> On Aug 6, 2009, at 6:31 PM, Keren Lasker <> wrote:
>>
>>> seems that now element is needed for writing atoms in pdb format.
>>> Would not it make sense to set the value of element  in Atom::create()?
>>> _______________________________________________
>>> IMP-dev mailing list
>>> 
>>> https://salilab.org/mailman/listinfo/imp-dev
>>
>> _______________________________________________
>> IMP-dev mailing list
>> 
>> https://salilab.org/mailman/listinfo/imp-dev
>
> _______________________________________________
> IMP-dev mailing list
> 
> https://salilab.org/mailman/listinfo/imp-dev
>