def copy_from_convention(from_convention, new_convention, protein_only=True): """Copy nomenclature convention from from_convention to new_convention. Only copy standard protein residues if protein_only (defaults to True). """ residue_definitions = NTdb.residuesWithProperties("protein") if not protein_only: residue_definitions = NTdb.allResidueDefs() for res_def in residue_definitions: nTdebug("Copying %s nomenclature convention to %s for %s", from_convention, new_convention, res_def) res_def.nameDict[new_convention] = res_def.nameDict[from_convention] for atom_def in res_def: atom_def.nameDict[new_convention] = atom_def.nameDict[from_convention] atom_def.postProcess() res_def.postProcess()
def correct_xplor_stap(protein_only=True): """Correct atom definitions copied from XPLOR for STAP. Only correct standard protein residues if protein_only (defaults to True). """ remove_non_stap_residues(NTdb) correct_his_stap(NTdb) correct_hg_stap(NTdb['CYS']) correct_hg_stap(NTdb['SER']) correct_ile_d_stap(NTdb['ILE']) residue_definitions = NTdb.residuesWithProperties('protein') if not protein_only: residue_definitions = NTdb.allResidueDefs() for res_def in residue_definitions: correct_termini_stap(res_def) remove_pseudo_atoms(res_def)
def copy_from_convention(from_convention, new_convention, protein_only=True): """Copy nomenclature convention from from_convention to new_convention. Only copy standard protein residues if protein_only (defaults to True). """ residue_definitions = NTdb.residuesWithProperties('protein') if not protein_only: residue_definitions = NTdb.allResidueDefs() for res_def in residue_definitions: nTdebug("Copying %s nomenclature convention to %s for %s", from_convention, new_convention, res_def) res_def.nameDict[new_convention] = res_def.nameDict[from_convention] for atom_def in res_def: atom_def.nameDict[new_convention] = atom_def.nameDict[ from_convention] atom_def.postProcess() res_def.postProcess()
from cing.core.database import NTdb from cing.core.database import saveToSML cing.verbosity = cing.verbosityDebug if __name__ == '__main__': if 1: # DEFAULT: 1 disable only when needed. nTwarning( "Don't execute this script %s by accident. It damages CING." % getCallerFileName()) sys.exit(1) # end if convention = 'INTERNAL_1' for rdef in NTdb.residuesWithProperties('protein'): nTdebug( "Xplor N-terminal and C-terminal atom name translations changed for %s", rdef) for name1, namex in [('H1', 'HT1'), ('H2', 'HT2'), ('H3', 'HT3'), ('OXT', 'OT2'), ('O', 'O,OT1')]: if name1 in rdef: rdef[name1].nameDict['XPLOR'] = namex #end if #end for #end for # save the new versions rootPath = os.path.realpath( os.path.join(cingPythonCingDir, 'Database', convention)) saveToSML(NTdb, rootPath, convention)
script to update xplor N-terminal and C-terminal name conventions ''' from cing import cingPythonCingDir from cing.Libs.NTutils import * #@UnusedWildImport from cing.core.database import NTdb from cing.core.database import saveToSML cing.verbosity = cing.verbosityDebug if __name__ == '__main__': if 1: # DEFAULT: 1 disable only when needed. nTwarning("Don't execute this script %s by accident. It damages CING." % getCallerFileName()) sys.exit(1) # end if convention = 'INTERNAL_1' for rdef in NTdb.residuesWithProperties('protein'): nTdebug("Xplor N-terminal and C-terminal atom name translations changed for %s",rdef) for name1, namex in [('H1','HT1'), ('H2','HT2'), ('H3','HT3'), ('OXT','OT2'), ('O','O,OT1')]: if name1 in rdef: rdef[name1].nameDict['XPLOR'] = namex #end if #end for #end for # save the new versions rootPath = os.path.realpath(os.path.join(cingPythonCingDir, 'Database' , convention) ) saveToSML( NTdb, rootPath, convention )