Ejemplo n.º 1
0
def test_sdf_processing2():
    import gzip
    import molfile
    m = molfile.converter()
    f = gzip.open("00000001_00025000.sdf.gz", "r")
    f2 = file("AAAA.sdf", "w")
    for mol in m.read_file(f):
        mol.remove_unimportant_hydrogens()
        m.mols_to_file([mol], f2)
    f.close()
    f2.close()
Ejemplo n.º 2
0
def test_sdf_processing():
    import gzip
    import molfile, smiles
    m = molfile.converter()
    m2 = smiles.converter()
    f = gzip.open("00000001_00025000.sdf.gz", "r")
    for mol in m.read_file(f):
        mol.remove_unimportant_hydrogens()
        mols = mol.get_disconnected_subgraphs()
        print m2.mols_to_text(mols)
    f.close()
Ejemplo n.º 3
0
def test_sdf_processing2():
    import gzip
    import molfile
    m = molfile.converter()
    f = gzip.open("00000001_00025000.sdf.gz","r")
    f2 = file( "AAAA.sdf","w")
    for mol in m.read_file( f):
        mol.remove_unimportant_hydrogens()
        m.mols_to_file( [mol], f2)
    f.close()
    f2.close()
Ejemplo n.º 4
0
def test_sdf_processing():
    import gzip
    import molfile, smiles
    m = molfile.converter()
    m2 = smiles.converter()
    f = gzip.open("00000001_00025000.sdf.gz","r")
    for mol in m.read_file( f):
        mol.remove_unimportant_hydrogens()
        mols = mol.get_disconnected_subgraphs()
        print m2.mols_to_text( mols)
    f.close()
Ejemplo n.º 5
0
def test_multimol_molfile2():
    import molfile, smiles
    mols = [smiles.text_to_mol(t) for t in ["CCC(=O)[O-].[K+]"]]
    for mol in mols:
        mol.remove_zero_order_bonds()
    m = molfile.converter()
    text = m.mols_to_text(mols)
    f = file("multi2.mol", "w")
    f.write(text)
    f.close()
    f = file("prase.sdf", "r")
    for mol in m.read_text(text):
        print smiles.mol_to_text(mol)
    f.close()
Ejemplo n.º 6
0
def test_multimol_molfile2():
    import molfile, smiles
    mols = [smiles.text_to_mol( t) for t in ["CCC(=O)[O-].[K+]"]]
    for mol in mols:
        mol.remove_zero_order_bonds()
    m = molfile.converter()
    text = m.mols_to_text( mols)
    f = file("multi2.mol","w")
    f.write( text)
    f.close()
    f = file("prase.sdf","r")
    for mol in m.read_text( text):
        print smiles.mol_to_text( mol)
    f.close()