[Biopython] using Select class to pass atoms to Superimposer

ashutosh srivastava ashu4487 at gmail.com
Thu Dec 15 08:40:34 UTC 2016


Hi

I am trying to write a program to superimpose multiple structures to a
reference structure.For this, is it possible to pass the list of atoms to
be aligned (ref atoms and sample atoms) using the Select subclassing. I am
already using it to store the PDB files of CA atoms that I am using to
align in the following way.
class CA_select(Select):
    def accept_atom(self,atom):
        if atom.get_id()=='CA' and (atom.get_parent().get_id()[1] in
res_to_be_aligned):
            print('accept')
            return 1
        else:
            return 0

#Get reference structure coordinates
ref_str=parser.get_structure(ref_str_file[:-4],ref_str_file)
ref_model=ref_str[0]
io.set_structure(ref_str)
io.save('ref_structure.pdb',CA_select())

If this can be used to pass the atoms directly to Superimposer then I wont
have to iterate through the structure to accumulate the atoms.

Thank you

Best Regards
Ashutosh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython/attachments/20161215/26a5afe2/attachment.html>


More information about the Biopython mailing list