###FOR FURTHER INSTRUCTIONS PLEASE REFER TO alternateresidues.py SAMPLE FILE sys.path.insert(0, '../') import gmml temp = gmml.PdbPreprocessor() pdbfile = gmml.PdbFile("gmml/example/pdb/1RVZ_New.pdb") #GIVE THE ADDRESS OF THE PDB FILE TO EXTRACT THE INFORMATION OR GIVE IT BY THE COMMAND LINE: temp.ExtractCYSResidues(pdbfile) #temp.ExtractCYSResidues(sys.argv[1]) disulfide_bonds = temp.GetDisulfideBonds() for x in xrange(0, disulfide_bonds.size()): disulfide_bonds[x].Print() ###UPDATING CYS RESIDUES### disulfide_bonds[0].SetIsBonded(False) print("Updated disulfide bond(s):") disulfide_bonds[0].Print() temp.UpdateCYSResidues(pdbfile, disulfide_bonds) pdbfile.Write('cysresidues-update.pdb')
###FOR FURTHER INSTRUCTIONS PLEASE REFER TO alternateresidues.py SAMPLE FILE import sys sys.path.insert(0, '../') import gmml temp = gmml.PdbPreprocessor() st = gmml.PdbFile() pdbfile = st.LoadPdbFile("gmml/example/pdb/1RVZ_New.pdb") #pdbfile = gmml.PdbFile(sys.argv[1]) temp.ExtractHISResidues(pdbfile) histidine_mappings = temp.GetHistidineMappings() for x in xrange(0, histidine_mappings.size()): histidine_mappings[x].Print() ###UPDATING HISTIDINE MAPPINGS### #MODIFYING selected_mapping ATTRIBUTE OF THE HISTIDINE MAPPINGS VECTOR (POSSIBLE OPTIONS: gmml.HIE, gmml.HIP, gmml.HID) histidine_mappings[0].SetSelectedMapping(gmml.HIP) print "The Updated part(s):" histidine_mappings[0].Print() temp.UpdateHISMapping(pdbfile, histidine_mappings) pdbfile.Write('hisresidues-update.pdb')
elif arg == '-glycam_libs': arguments = sys.argv[i + 1].split(',') for argument in arguments: glycam_libs.push_back(argument) elif arg == '-other_libs': arguments = sys.argv[i + 1].split(',') for argument in arguments: other_libs.push_back(argument) elif arg == '-prep': arguments = sys.argv[i + 1].split(',') for argument in arguments: prep.push_back(argument) elif arg == '-pdb': pdb = sys.argv[i + 1] pdbfile = gmml.PdbFile(pdb) temp.ExtractResidueInfo(pdbfile, amino_libs, glycam_libs, other_libs, prep) ###FOR GIVING THE FILES MANUALLY AND THROUGH THE COMMAND LINE USE THE FOLOWIG SECTION #amino_libs.push_back("gmml/dat/lib/GLYCAM_amino_06h.lib") #amino_libs.push_back("gmml/dat/lib/GLYCAM_aminoct_06h.lib") #amino_libs.push_back("gmml/dat/lib/GLYCAM_aminont_06h.lib") #temp.ExtractRemovedHydrogens("gmml/example/pdb/1Z7E-Mod.pdb, amino_libs, glycam_libs, other_libs, prep) residue_info = temp.GetResidueInfoMap() for x in residue_info: residue_info[x].Print() print 'Model charge is: ', temp.CalculateModelCharge(pdbfile, amino_libs, glycam_libs, other_libs,
# python alternateresidues.py gmml/example/pdb/1Z7E-Mod.pdb ###IMPORTING THE GMML LIBRARY import sys sys.path.insert(0, '../') import gmml ###BUILDING AN OBJECT OF THE PDB PREPROCESSOR AND STORING IT IN "temp" VARIABLE TO WORK WITH temp = gmml.PdbPreprocessor() ###FIRST OPTION TO BUILD THE PDB FILE OBJECT: GIVE YOUR PDB FILE PATH IN THE FOLLOWING LINE. (IF YOU WANT TO USE THE SECOND OPTION COMMENT THE FOLLOWING LINE) #pdbfile = gmml.PdbFile("gmml/example/1Z7E-Mod.pdb") ###SECOND OPTION TO BUILD THE PDB FILE OBJECT. (IF YOU WANT TO USE THE FIRST OPTION COMMENT THE FOLLOWING LINE) pdbfile = gmml.PdbFile(sys.argv[1]) ###EXTRACTING INFORMATION temp.ExtractAlternateResidue(pdbfile) ###GETTING THE RESULT FOR THE ALTERNATE RESIDUES OF THE GIVEN FILE alternate_residues_map = temp.GetAlternateResidueMap() ###IF YOU WANT TO SEE THE RESULT IN THE TERMINAL USE THE FOLLOWING FOR LOOP OTHERWISE IGNORE AND COMMENT THE LOOP print(alternate_residues_map) for x in alternate_residues_map: alternate_residues_map[x].Print() ###UPDATING ALTERNATE RESIDUES### ###GETTING THE OBJECT OF FIRST RESIDUE WITH ALTERNATE LOCATIONS (KEY OF THE alternate_residues_map IS THE COMBINATION OF "residuename_chainId_sequenceNumber_insertionCode") selected_alt_residue = alternate_residues_map[