ccpn.framework.lib.NTdb package

Module Documentation here

Submodules

ccpn.framework.lib.NTdb.NTdbDefs module

NTdb-related info; adapted from the cing code and NTdb2Json.py script

CingDefs(dict)
  • name, ResidueDef(dict)
    • contains list of AtomDef(dict)’s .atoms -> (name, AtomDef) dict

    • contains list of DihedralsDef(dict)’s .dihedrals -> (name, DihedralDef) dict

class ccpn.framework.lib.NTdb.NTdbDefs.AtomDef[source]

Bases: dict

Simple class to store Atom definitions

property attachedHeavyAtom

- None, immutable - :return the attached heavyAtom (AtomDef instance) if self is a proton, else None

property attachedProtons: list

- list, immutable - :return a list of the attached protons (AtomDef instances) of self if self is a non-proton, i.e. carbon, nitrogen, else None

getPseudoAtom()[source]

:return the pseudoAtom AtomDef instance or None is self does not have a pseudoAtom

getRealAtoms() list[source]

:return the real atoms AtomDef instances or [] is self is not a pseudoAtom

property hasPseudoAtom: bool

- bool, immutable - Return True if atom has a one or more pseudoAtoms

property id: str

- str, immutable - :return a ‘id’ string, that can be used to for lookup

property isAromatic: bool

- bool, immutable - :return True if self is a aromatic

property isCarbon

- None, immutable - Return True if it is a cabon

property isMethyl: bool

- bool, immutable - :return True if self is a methyl

property isMethylene: bool

- bool, immutable - :return True if self is a methylene

property isNitrogen

- None, immutable - Return True if it is a Nitrogen

property isProton: bool

- bool, immutable - :return True if it is a proton or pseudoAtom

property isPseudoAtom: bool

- bool, immutable - Return True if it is pseudoAtom

property name: str

- str, immutable - :return the name of self

property nameTuple

- None, immutable - Return (residueDef.name, atomDef.name) tuple

property otherAttachedProtons: list

- list, immutable - :return a list of all other protons (AtomDef instances) also attached to the attachedHeavyAtom of self if self is a proton, else None

property properties: list

- list, immutable - Return the properties of the ArtomDef

saveKeys = ['convention', 'name', 'nameDict', 'aliases', 'canBeModified', 'topology', 'NterminalTopology', 'CterminalTopology', 'spinType', 'shift', 'hetatm', 'properties']
class ccpn.framework.lib.NTdb.NTdbDefs.DihedralDef[source]

Bases: dict

Simple class to store Dihedral definitions

ATOMS = 'atoms'
property id: str

- str, immutable - :return a ‘id’ string, that can be used to for lookup

property name: str

- str, immutable - :return the name of self

saveKeys = ['convention', 'name', 'aliases', 'atoms', 'karplus']
class ccpn.framework.lib.NTdb.NTdbDefs.NTdbDefs(*args, **kwargs)[source]

Bases: dict

Class to contain the NTdbDef (Cing) residue definitions

addDef(rDef)[source]

Add ResidueDef instance to self

property allRealAtoms: list

- list, immutable - Return all real atoms as a AtomsDefs list

fromJson(path)[source]

Restore self from json files in path

getDef(item, default=None)[source]

Routine to get a definitions as ‘resName.atomName’ or (‘resName’, ‘atomName’) or ‘resName.dihedralName’ or (‘resName’, ‘dihedralName’)

property residueDefs: list

- list, immutable - Return list of residueDefs

toJson(path=None)[source]

Convert content of self to json files; path should be a directory

class ccpn.framework.lib.NTdb.NTdbDefs.ResidueDef[source]

Bases: dict

Simple class to store Residue definitions

ATOM_DEFS = 'atomDefs'
DIHEDRAL_DEFS = 'dihedralDefs'
addAtomDef(atomDef)[source]

Add an atomDef to the list

addDihedralDef(dihedralDef)[source]

Add an dihedralDef to the list

property atomDefs: list

- list, immutable - :return list of AtomDefs

property atomDefsDict: dict

- dict, immutable - :return (atomName, atomsDefs) as a dict

property atomNames: list

- list, immutable - :return a list of atoms names

property carbons: list

- list, immutable - :return all carbon atomsDefs as a list

property dihedralDefs: list

- list, immutable - Return list of dihedralDefs

property dihedralDefsDict: dict

- dict, immutable - Return (dihedralName, dihedralDefs) as a dict

fromJson(path)[source]

Restore self from json file path

property id: str

- str, immutable - :return a ‘id’ string, that can be used to for lookup

property isAminoAcid: bool

- bool, immutable - :return True is residue defines a amino acid

property isNucleicAcid: bool

- bool, immutable - :return True is residue defines a Nucleic acid

property name: str

- str, immutable - :return the name of self

property nitrogens: list

- list, immutable - :return all nitrogen atomsDefs as a list

property properties: list

- list, immutable - Return the properties of the ResidueDef

property protons: list

- list, immutable - :return all proton atomsDefs as a list

property pseudoAtoms: list

- list, immutable - :return all pseudo atoms atomsDefs as a list

property pseudoAtomsDict: dict

- dict, immutable - :return all pseudo atoms as a (atomName, atomsDefs) dict

property realAtoms: list

- list, immutable - :return all real atoms atomsDefs as a list

property realAtomsDict: dict

- dict, immutable - :return all real atoms as a (atomName, atomsDefs) dict

saveKeys = ['convention', 'name', 'commonName', 'shortName', 'nameDict', 'canBeModified', 'shouldBeSaved', 'cingDefinition', 'comment', 'properties']
toJson(path=None)[source]

Convert self to json string; optionally save to path

ccpn.framework.lib.NTdb.NTdbDefs.getNTdbDefs() dict[source]

:return the NTdbDefs (i.e. NTdbDefs) instance (singleton)

ccpn.framework.lib.NTdb.NTdbLib module

ccpn.framework.lib.NTdb.NTdbLib.getNefMappingDict() dict[source]

:return a dict with key=(residueName, atomName) and value=(residueName, NefName, specialType) pairs. Currently only for proteins

ccpn.framework.lib.NTdb.NTdbLib.isAromatic(atmDef)[source]

Return True if atmDef defines a aromatic-sidechain Phe, Tyr

ccpn.framework.lib.NTdb.NTdbLib.isBetaMethylene(atmDef)[source]

Return True if atmDef defines a protein b-methylene

ccpn.framework.lib.NTdb.NTdbLib.isMethyl(atmDef)[source]

Return True if atmDef defines a protein methyl, but not VAL, LEU

ccpn.framework.lib.NTdb.NTdbLib.isStereoMethyl(atmDef)[source]

Return True if atmDef defines a protein methyl proton or carbon and VAL, LEU