Repository 'chemical_data_sources'
hg clone https://toolshed.g2.bx.psu.edu/repos/bgruening/chemical_data_sources

Changeset 3:021f0ef9474f (2013-09-18)
Previous changeset 2:b65518a007fa (2013-09-08) Next changeset 4:7c1f9962ac07 (2013-09-27)
Commit message:
Uploaded
modified:
get_pubchem/get_pubchem_as_smiles.py
get_pubchem/get_pubchem_as_smiles.xml
b
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)
 
b
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
b
@@ -1,23 +1,36 @@
 <tool id="ctb_pubchem_download_as_smiles" name="PubChem Download" Version="0.1" >
-  <description>as canonical SMILES</description>
-  <requirements>
-    <requirement type="package" version="2.3.2">openbabel</requirement>
-  </requirements>
-  <command interpreter="python">
+    <description>as canonical SMILES</description>
+    <requirements>
+        <requirement type="package" version="2.3.2">openbabel</requirement>
+    </requirements>
+    <command interpreter="python">
         get_pubchem_as_smiles.py 
             -o $pubchem_smi 
             -p 4
-            2>&#38;1
-  </command>
-  <inputs>
-     <param name="infile" type="select" display="radio" size="250" label="Load all pubchem files and convert them to canonical smiles." />
-  </inputs>
-  <outputs>
-     <data format="smi" name="pubchem_smi" />
-  </outputs>
-  <tests>
-  </tests>
-  <help>
+    </command>
+    <stdio>
+        <regex match="obError" 
+               source="both" 
+               level="fatal" 
+               description="Critical Open Babel error" />
+        <regex match="obWarning"
+               source="both"
+               level="warning"
+               description="Non-critical Open Babel warning" />
+        <regex match="obInfo"
+               source="both"
+               level="log"
+               description="Open Babel Information" />
+    </stdio>
+    <inputs>
+        <param name="infile" type="select" display="radio" size="250" label="Load all pubchem files and convert them to canonical smiles." />
+    </inputs>
+    <outputs>
+        <data format="smi" name="pubchem_smi" />
+    </outputs>
+    <tests>
+    </tests>
+    <help>
 
 .. class:: infomark
 
@@ -35,5 +48,5 @@
 
 The output will be one large SMILES file.
   
-  </help>
+    </help>
 </tool>