proteindf_bridge.atomgroup module¶
- class proteindf_bridge.atomgroup.AtomGroup(*args, **kwargs)[source]¶
Bases:
object>>> group1 = AtomGroup() >>> atom1 = Atom(symbol='C') >>> atom2 = Atom(symbol='H') >>> atom3 = Atom(symbol='N') >>> subgrp = AtomGroup() >>> subgrp.set_atom('C1', atom1) >>> subgrp.set_atom('H1', atom2) >>> subgrp.set_atom('N1', atom3) >>> group1.set_group('grp', subgrp) >>> group1['grp']['C1'].symbol 'C' >>> group1.get_number_of_atoms() 0 >>> group1.get_number_of_groups() 1 >>> group1.get_number_of_all_atoms() 3 >>> group1.sum_of_atomic_number() 14.0
>>> group2 = AtomGroup() >>> atom_with_path1 = Atom(symbol='C') >>> atom_with_path2 = Atom(symbol='N') >>> group2.set_atom('/group1/subgroup1/C1', atom_with_path1) >>> group2.set_atom('/group1/subgroup2/N2', atom_with_path2) >>> print(group2) # group key= name= # group key=group1 name= parent= # group key=subgroup1 name= parent= C () 0.000 0.000 0.000, 0.00, 0.000 0.000 0.000 /group1/subgroup1/C1 # group key=subgroup2 name= parent= N () 0.000 0.000 0.000, 0.00, 0.000 0.000 0.000 /group1/subgroup2/N2 >>> group2['group1']['subgroup1'].has_atom('C1') True
- property charge¶
- erase_atom(key)[source]¶
remove atom
Deprecated since version use:
remove_atom()instead.
- erase_group(key)[source]¶
remove group
Deprecated since version use:
remove_group()instead.- Return type:
- get_atom(key_or_name)[source]¶
Return the atom if one matching the given key or name is contained; otherwise return None.
- get_bond_list(bond_list=None)[source]¶
Return a list of tuples (‘atom1 path’, ‘atom2 path’, bond order).
- get_group(key_or_name)[source]¶
Return the group if one matching the given key or name is contained; otherwise return None.
- has_atom(key_or_name)[source]¶
Return True if an atom matching the given key or name is contained; otherwise return False.
- has_atomkey(key)[source]¶
Return True if an atom with the given key is contained; otherwise return False.
- has_atomname(name)[source]¶
Return True if an atom with the given name is contained; otherwise return False.
- has_group(key_or_name)[source]¶
Return True if a group matching the given key or name is contained; otherwise return False.
- Return type:
- has_groupkey(key)[source]¶
Return True if a group with the given key is contained; otherwise return False.
- Return type:
- has_groupname(name)[source]¶
Return True if a group with the given name is contained; otherwise return False.
- Return type:
- property name¶
- property nuclei_charge¶
- property parent¶
- property path¶
- property real_nuclei_charge¶
- restructure(reference, range=1e-05)[source]¶
Rebuild the data structure by referring to the structure of reference.
Useful when building up a flat list of atoms into a PDB-like data structure.
- select(selector)[source]¶
Pass a Selector object as selector to get back the corresponding molecular group.
- property sort_atoms¶
- property sort_groups¶
- property weight¶