¶ Xponge.assign
This package is used to assign the properties for atoms, residues and molecules
¶ subpackages
¶ submodules
¶ functions
¶ get_assignment_from_smiles
This function gets an Assign instance from smiles
| parameters |
explanation |
| smiles |
the smiles to get |
| return |
the Assign instance |
¶ get_assignment_from_pdb
This function gets an Assign instance from a pdb file
| parameters |
explanation |
| file |
the name of the input file or an instance of io.IOBase |
| only_residue |
only get the residue with the name same as only_residue |
| bond_tolerance |
the parameter to determine the atomic connections. The larger tolerance, the easier to set a bond between two atoms |
| total_charge |
the total charge of the molecule used when aligning bond orders. If None is given, the total charge will not be checked |
| return |
the Assign instance |
¶ get_assignment_from_residuetype
This function gets an Assign instance from a ResidueType instance
| parameters |
explanation |
| restype |
the ResidueType instance |
| return |
the Assign instance |
¶ get_assignment_from_xyz
This function gets an Assign instance from a xyz file
| parameters |
explanation |
| file |
the name of the input file or an instance of io.IOBase |
| bond_tolerance |
the parameter to determine the atomic connections. The larger tolerance, the easier to set a bond between two atoms |
| total_charge |
the total charge of the molecule used when aligning bond orders. If None is given, the total charge will not be checked |
| return |
the Assign instance |
¶ get_assignment_from_mol2
This function gets an Assign instance from a mol2 file
| parameters |
explanation |
| file |
the name of the input file or an instance of io.IOBase |
| total_charge |
the total charge of the molecule used when aligning bond orders. If "sum" is given, the sum of the partial charges will be used; If None is given, the total charge will not be checked |
| return |
the Assign instance |
¶ get_assignment_from_cif
This function gets an Assign instance and a preprocessed lattice information from a cif file
| parameters |
explanation |
| file |
the name of the input file or an instance of io.IOBase |
| total_charge |
the total charge of the molecule used when aligning bond orders. 0 for default. |
| orthogonal_threshold |
cell angle with the difference less than this parameter will be considered to be orthogonal (in degree, and 5 for default) |
| return |
the Assign instance and a dict which stores the preprocessed lattice information |
¶ classes
¶ AssignRule
This class is to be the rule to determine the atom type for one atom
| parameters |
explanation |
| name |
the name of the rule |
¶ add_rule
This function is used as a decorator to add the atom type - judge function
| parameters |
explanation |
| atomtype |
a string or an AtomType instance |
| priority |
if more than one judge function returns True, the atom type with higher priority will be chosen. If the priority levels of the functions are the same, the atom type which is added first will be chosen. |
| return |
a function, which wraps a judge function (receiving the Assign instance and the atom index and giving True or False as a result) |
¶ add_rings_basic_marker
| parameters |
explanation |
| assign |
|
| rings |
|
¶ check_rings_type
| parameters |
explanation |
| assign |
|
| rings |
|
¶ get_rings
| parameters |
explanation |
| assign |
|
¶ get_3_neighbors
¶ check_pure_aromatic
| parameters |
explanation |
| assign |
|
¶ check_pure_aliphatic_and_planar
| parameters |
explanation |
| assign |
|
¶ check_out_plane_double_bond
| parameters |
explanation |
| assign |
|
¶ check_aromatic
| parameters |
explanation |
| assign |
|
¶ Assign
This class is used to assign properties for atoms, which is called an "assignment"
| parameters |
explanation |
| name |
the name of the molecule |
¶ add_index_to_name
This function renames the atoms by adding the index to the element name
¶ atom_judge
This function helps judge whether the atom belongs to the mask. For example, "O2" means an oxygen atom connected to two other atoms, "N4" means a nitrogen atom connected to four other atoms.
| parameters |
explanation |
| atom |
the index of the atom |
| string |
a string mask of a list of string masks. |
¶ add_atom
This function adds an atom to the Assign
| parameters |
explanation |
| element |
the chemical symbol for the element. "O" - oxygen, "H" - hydrogen for example. |
| x |
the x coordinate |
| y |
the y coordinate |
| z |
the z coordinate |
| name |
the name of the atom |
| charge |
the charge of the atom |
¶ add_atom_marker
This function adds a marker to an atom
| parameters |
explanation |
| atom |
the atom index |
| marker |
the marker |
¶ add_bond
This function adds a bond to two atoms
| parameters |
explanation |
| atom1 |
the index of the first atom |
| atom2 |
the index of the the second atom |
| order |
the bond order |
¶ add_bond_marker
This function adds a marker to a bond
| parameters |
explanation |
| atom1 |
the index of the first atom |
| atom2 |
the index of the the second atom |
| marker |
the marker |
| only1 |
only add the marker to the atom1 - atom2 bond instead of the atom2 - atom1 bond |
¶ delete_atom
This function deletes the atom
| parameters |
explanation |
| atom |
the index of the atom to delete |
¶ delete_bond
This function deletes the bond between two atoms
| parameters |
explanation |
| atom1 |
the index of the first atom |
| atom2 |
the index of the the second atom |
¶ determine_equal_atoms
This function dertermines the chemical equalvalent atoms
| return |
a list of equalvalent atom index lists |
¶ determine_ring_and_bond_type
This function determine the ring and the bond type
¶ determine_atom_type
This function determines the atom type.
| parameters |
explanation |
| rule |
a string or an AssignRule instance |
| return |
if the attribute "pure_string" of the rule is False, the atom types will be saved inplace and return |
¶ determine_connectivity
This function determines the connectivity based on atomic distances
| parameters |
explanation |
| simple_cutoff |
the distance cutoff to determine whether the two atoms are connected. If None (default), |
| tolerance |
the tolerance factor for the default method |
¶ check_connectivity
This function checks whether all atoms are connected in one graph
¶ to_residuetype
This function converts the Assign instance to the ResidueType instance
| parameters |
explanation |
| name |
the name of the ResidueType instance |
| charge |
the charge of atoms. If set to None, internal charge will be used |
| return |
the ResidueType instance |
¶ calculate_charge
This function calculates the partial charge for every atom.
| parameters |
explanation |
| method |
the method to calculate the charge |
| parameters |
the parameters to calculate the charge |
¶ kekulize
This function kekulizes the structure.
¶ uff_optimize
This function uses rdkit and uff to optimize the structure
¶ save_as_pdb
This function saves the instance as a pdb file
| parameters |
explanation |
| filename |
the name of the output file |
¶ save_as_mol2
This function saves the instance as a mol2 file
| parameters |
explanation |
| filename |
the name of the output file |
| atomtype |
the rule of atom types. |
¶ set_ph
This function sets the pH value, and adds or deletes the related hydrogens.
| parameters |
explanation |
| ph |
the pH value |
| return |
the sum of final formal charge |