Detects resid gaps in a selection and assigns incrementing segid to each fragment
!!!WARNING!!! If you want to use atom selections like ‘protein’ or ‘fragment’, use this function on a Molecule containing only protein atoms, otherwise the protein selection can fail.
mol (Molecule
object) – The Molecule object
sel (str) – Atom selection string on which to check for gaps. See more here
basename (str) – The basename for segment ids. For example if given ‘P’ it will name the segments ‘P1’, ‘P2’, …
spatial (bool) – Only considers a discontinuity in resid as a gap if the CA atoms have distance more than spatialgap Angstrom
spatialgap (float) – The size of a spatial gap which validates a discontinuity (A)
fields (list) – Fields in which to set the segments. Must be a combination of “chain”, “segid” or only one of them.
newmol – A new Molecule object with modified segids
Molecule
object
Example
>>> newmol = autoSegment(mol, "chain B", "P", fields=("chain", "segid"))
Detects bonded segments in a selection and assigns incrementing segid to each segment
mol (Molecule
object) – The Molecule object
sel (str) – Atom selection string on which to check for gaps. See more here
basename (str) – The basename for segment ids. For example if given ‘P’ it will name the segments ‘P1’, ‘P2’, …
fields (tuple of strings) – Field to fix. Can be “segid” (default) or any other Molecule field or combinations thereof.
residgaps (bool) – Set to True to consider gaps in resids as structural gaps. Set to False to ignore resids
residgaptol (int) – Above what resid difference is considered a gap. I.e. with residgaptol 1, 235-233 = 2 > 1 hence is a gap. We set default to 2 because in many PDBs single residues are missing in the proteins without any gaps.
chaingaps (bool) – Set to True to consider changes in chains as structural gaps. Set to False to ignore chains
newmol – A new Molecule object with modified segids
Molecule
object
Example
>>> newmol = autoSegment2(mol)