# HG changeset patch # User bgruening # Date 1379511876 14400 # Node ID 021f0ef9474fb64db5e7c97cf54cae5d15fa323f # Parent b65518a007fa270d074591c57d32ec5d2aa3a847 Uploaded diff -r b65518a007fa -r 021f0ef9474f get_pubchem/get_pubchem_as_smiles.py --- a/get_pubchem/get_pubchem_as_smiles.py Sun Sep 08 09:42:57 2013 -0400 +++ b/get_pubchem/get_pubchem_as_smiles.py Wed Sep 18 09:44:36 2013 -0400 @@ -29,7 +29,7 @@ result.get() for filename in os.listdir(td): - path = os.path.join(td, filename) + path = os.path.join(td, filename) + '.smi' shutil.copyfileobj(open(path, 'rb'), output_handle) output_handle.close() @@ -38,9 +38,9 @@ def fetch_convert(args): (filename, td) = args - tmp_name = os.path.join( tempfile.gettempdir(), filename) + tmp_name = os.path.join( td, filename) subprocess.call( ['wget', '-O', tmp_name, os.path.join('ftp://ftp.ncbi.nih.gov/pubchem/Compound/CURRENT-Full/SDF/', filename)] ) - output = os.path.join(td, filename) + output = os.path.join(td, filename) + '.smi' subprocess.call(["obabel", "-isdf", tmp_name, "-ocan", '-O', output]) os.remove(tmp_name) diff -r b65518a007fa -r 021f0ef9474f get_pubchem/get_pubchem_as_smiles.xml --- a/get_pubchem/get_pubchem_as_smiles.xml Sun Sep 08 09:42:57 2013 -0400 +++ b/get_pubchem/get_pubchem_as_smiles.xml Wed Sep 18 09:44:36 2013 -0400 @@ -1,23 +1,36 @@ - as canonical SMILES - - openbabel - - + as canonical SMILES + + openbabel + + get_pubchem_as_smiles.py -o $pubchem_smi -p 4 - 2>&1 - - - - - - - - - - + + + + + + + + + + + + + + + .. class:: infomark @@ -35,5 +48,5 @@ The output will be one large SMILES file. - +