def main(): if len(sys.argv) != 3: # if no input print "ERORR" return namemol2 = sys.argv[1] namesph = sys.argv[2] mol = mol2.remove_hydrogens(mol2.read_Mol2_file(namemol2)[0]) write_sph(namesph, mol)
def main(): if len(sys.argv) != 3: # if no input print "ERORR" print "this script reads in a mol2 file and writes out a sph file." print "this script takes 2 arguments: name.mol2 name.sph" return namemol2 = sys.argv[1] namesph = sys.argv[2] mol = mol2.remove_hydrogens(mol2.read_Mol2_file(namemol2)[0]) write_sph(namesph, mol)
def multimol2_removeH(input, output): #print "This file requires the mol2 library written by Trent Balius (AKA Xiaobo Wan) and sudipto mukherjee" #print "syntex: multimol2_removeH.py input_file output_file" infile = input outfile = output file = open(outfile, 'w') # overwrite file.close() mol_list = mol2.read_Mol2_file_head(infile) #print len(mol_list) for i in range(len(mol_list)): #print "mol ", i mol = mol2.remove_hydrogens(mol_list[i]) mol2.append_mol2(mol, outfile)
import mol2 import sys print "this file requiers the mol2 libary writen by trent balius and sudipto mukherjee" print "syntex: multimol2_removeH.py input_file output_file" infile = sys.argv[1] outfile = sys.argv[2] file = open(outfile, 'w') # overwrite file.close() mol_list = mol2.read_Mol2_file_head(infile) print len(mol_list) for i in range(len(mol_list)): print "mol ", i mol = mol2.remove_hydrogens(mol_list[i]) mol2.append_mol2(mol, outfile)
import mol2 import sys print "this file requiers the mol2 libary writen by trent balius and sudipto mukherjee" print "syntex: mol2_removeH.py input_file output_file" infile = sys.argv[1] outfile = sys.argv[2] mol_list = mol2.read_Mol2_file(infile) print len(mol_list) for mol_withH in mol_list: mol = mol2.remove_hydrogens(mol_withH) mol2.append_mol2(mol, outfile)
continue # Atoms down here are always hydrogen elif (a1.heavy_atom): print bond.a1_num, bond.a1_num, m.atom_list[bond.a1_num-1].Q, m.atom_list[bond.a2_num-1].Q m.atom_list[bond.a1_num-1].Q = m.atom_list[bond.a1_num-1].Q + m.atom_list[bond.a2_num-1].Q m.atom_list[bond.a2_num-1].Q = 0 elif (a2.heavy_atom): print bond.a1_num, bond.a1_num, m.atom_list[bond.a1_num-1].Q, m.atom_list[bond.a2_num-1].Q m.atom_list[bond.a2_num-1].Q = m.atom_list[bond.a2_num-1].Q + m.atom_list[bond.a1_num-1].Q m.atom_list[bond.a1_num-1].Q = 0 # Assuming that residue list does not change #data = mol2.Mol(m.header,m.name,atom_list,bond_list,m.residue_list) #return data return m print "this file requiers the mol2 libary writen by trent balius and sudipto mukherjee" print "syntex: mol2_removeH.py input_file output_file" infile = sys.argv[1] outfile = sys.argv[2] mol_list = mol2.read_Mol2_file(infile) print len(mol_list) mol1 = combine_q_and_remove_hydrogens(mol_list[0]) mol = mol2.remove_hydrogens( mol1 ) mol2.write_mol2(mol,outfile)