Mercurial > repos > bgruening > openbabel
changeset 7:12822efbd4a4
Uploaded
author | bgruening |
---|---|
date | Sat, 11 May 2013 17:11:45 -0400 |
parents | 9d1f982555ba |
children | fa78faf6ee4f |
files | convert/ob_convert.xml filter/ob_filter.xml modify/ob_genProp.py modify/ob_genProp.xml repository_dependencies.xml search/ob_spectrophore_search.xml subsearch/subsearch.py subsearch/subsearch.xml |
diffstat | 8 files changed, 410 insertions(+), 118 deletions(-) [+] |
line wrap: on
line diff
--- a/convert/ob_convert.xml Fri Apr 26 11:05:19 2013 -0400 +++ b/convert/ob_convert.xml Sat May 11 17:11:45 2013 -0400 @@ -11,7 +11,9 @@ ## The command is a Cheetah template which allows some Python based syntax. ## Lines starting hash hash are comments. Galaxy will turn newlines into spaces - #if str($out_format) == 'fs': +#set $format = $oformat.oformat_opts_selector + + #if $format == "fs": ## For the fastsearch index we need to copy the original molecule files to the composite datatype of obfs. ## Because openbabel likes file extensions, we give the molecule file a proper file extension. mkdir $outfile.extra_files_path; @@ -19,129 +21,395 @@ #end if obabel -i "${infile.ext}" - #if str($out_format) == 'fs': + + #if $format == "fs": + ## the fs filetype need his own symlink path, all others can take the original ones ${os.path.join($outfile.extra_files_path, 'molecule.%s' % $infile.ext )} - -o "${out_format}" -e + -o "$format" -e -O ${os.path.join($outfile.extra_files_path,'molecule.fs')} + #if int($oformat.fs_fold) > 0: + $oformat.fs_fold + #end if + -xN$#str(${oformat.fs_fptype}).strip() #else: "${infile}" - -o "${out_format}" -e + -o "$format" -O "${outfile}" + -e + #end if + + + #if $format == 'cml': + $oformat.cml_array + $oformat.cml_cml1 + $oformat.cml_aromatic + $oformat.cml_hydrogen + $oformat.cml_metadata + $oformat.cml_omit + $oformat.cml_continuous + $oformat.cml_properties + #elif $format == 'inchi': + ##ignore less import warnings + -w + #if $oformat.inchi_truncate: + #set $truncate = ''.join( str( $oformat.inchi_truncate ).split( ',' ) ) + -xT ${truncate} + #end if + + #if $oformat.inchi_additional: + #set $additional = ' '.join( str( $oformat.inchi_additional ).split( ',' ) ) + -xX '${additional}' + #end if + + $oformat.inchi_key + $oformat.inchi_name + $oformat.inchi_unique + $oformat.inchi_unique_sort + #elif $format == 'can': + $oformat.can_exp_h + $oformat.can_iso_chi + $oformat.can_rad + $oformat.can_atomclass_out + #elif $format == 'smi': + $oformat.smi_exp_h + $oformat.smi_iso_chi + $oformat.smi_rad + $oformat.smi_atomclass_out + $oformat.smi_can + $oformat.smi_coordinates + #elif $format == 'sdf': + $oformat.sdf_exp_h + $oformat.sdf_no_prop + $oformat.sdf_wedge_bonds + $oformat.sdf_alias_out + #elif $format == 'fpt': + $oformat.fpt_fptype + #if int($oformat.fpt_fold) > 0: + $oformat.fpt_fold + #end if + $oformat.fpt_hex_multiple + $oformat.fpt_hex + $oformat.fpt_set + $oformat.fpt_unset + #elif $format == 'mol2': + $oformat.mol2_ignore_res + #end if + + ## Uniqueness according to stripped InChI's or canonical SMILES + #if str($unique.unique_opts_selector): + #if $unique.unique_opts_selector == 'inchi': + #if $unique.truncate: + #set $truncate = ''.join( str( $unique.truncate ).split( ',' ) ) + --unique $truncate + #end if + #else + --unique $unique.unique_opts_selector + #end if + #end if + + + #if str($appendtotitle).strip(): + --addtotitle '${appendtotitle}' #end if $remove_h - #if $iso_chi or $can or $exp_h: - -x$iso_chi$exp_h$can - #end if - #if $dative_bonds: - -b - #end if + $dative_bonds + #if int($ph) >= 0: -p $ph #end if + 2>&1 </command> <inputs> <param name="infile" type="data" format="sdf,mol2,cml,inchi,smi" label="Select input file with molecules"/> - <param name="out_format" type="select" label="Output format"> - <option value="acr">Carine ASCI Crystal</option> - <option value="alc">Alchemy format</option> - <option value="bgf">MSI BGF format</option> - <option value="box">Dock 3.5 Box format</option> - <option value="bs">Ball and Stick format</option> - <option value="c3d1">Chem3D Cartesian 1 format</option> - <option value="c3d2">Chem3D Cartesian 2 format</option> - <option value="caccrt">Cacao Cartesian format</option> - <option value="cache">CAChe MolStruct format</option> - <option value="cacint">Cacao Internal format</option> - <option value="can">Canonical SMILES format (can)</option> - <option value="cdxml">ChemDraw CDXML format</option> - <option value="cht">Chemtool format</option> - <option value="cif">Crystallographic Information File</option> - <option value="cml">Chemical Markup Language</option> - <option value="cmlr">CML Reaction format</option> - <option value="com">Gaussian 98/03 Cartesian Input</option> - <option value="copy">Copies raw text</option> - <option value="crk2d">Chemical Resource Kit 2D diagram format</option> - <option value="crk3d">Chemical Resource Kit 3D format</option> - <option value="csr">Accelrys/MSI Quanta CSR format</option> - <option value="cssr">CSD CSSR format</option> - <option value="ct">ChemDraw Connection Table format</option> - <option value="dmol">DMol3 coordinates format</option> - <!--<option value="ent">Protein Data Bank format</option> - <option value="fa">FASTA format</option>--> - <option value="fasta">FASTA format</option> - <option value="feat">Feature format</option> - <option value="fh">Fenske-Hall Z-Matrix format</option> - <option value="fix">SMILES FIX format</option> - <option value="fpt">Fingerprint format</option> - <option value="fract">Free Form Fractional format</option> - <option value="fs">Open Babel FastSearching database (fs)</option> - <!--<option value="fsa">FASTA format</option>--> - <option value="gamin">GAMESS Input</option> - <option value="gau">Gaussian 98/03 Cartesian Input</option> - <!--<option value="gjc">Gaussian 98/03 Cartesian Input</option> - <option value="gjf">Gaussian 98/03 Cartesian Input</option>--> - <option value="gpr">Ghemical format</option> - <option value="gr96">GROMOS96 format</option> - <option value="hin">HyperChem HIN format</option> - <option value="inchi">IUPAC InChI</option> - <option value="inp">GAMESS Input</option> - <option value="jin">Jaguar input format</option> - <!--<option value="mdl">MDL MOL format (mol)</option>--> - <option value="mmd">MacroModel format</option> - <option value="mmod">MacroModel format</option> - <option value="mol">MDL MOL format (mol)</option> - <option value="mol2">Sybyl Mol2 format (mol2)</option> - <option value="molreport">Open Babel molecule report</option> - <option value="mop">MOPAC Cartesian format</option> - <option value="mopcrt">MOPAC Cartesian format</option> - <option value="mopin">MOPAC Internal</option> - <option value="mpc">MOPAC Cartesian format</option> - <option value="mpd">Sybyl descriptor format</option> - <option value="mpqcin">MPQC simplified input format</option> - <option value="nw">NWChem input format</option> - <option value="pcm">PCModel format</option> - <option value="pdb">Protein Data Bank format (pdb)</option> - <option value="pov">POV-Ray input format</option> - <option value="pqs">Parallel Quantum Solutions format</option> - <option value="qcin">Q-Chem input format</option> - <option value="report">Open Babel report format</option> - <option value="rxn">MDL RXN format</option> - <!--<option value="sd">MDL MOL format</option>--> - <option value="sdf">MDL MOL format (sdf)</option> - <option value="smi">SMILES format (smi)</option> - <!--<option value="sy2">Sybyl Mol2 format</option>--> - <option value="tdd">Thermo format</option> - <option value="test">Test format</option> - <option value="therm">Thermo format</option> - <option value="tmol">TurboMole Coordinate format</option> - <option value="txyz">Tinker MM2 format</option> - <option value="unixyz">UniChem XYZ format</option> - <option value="vmol">ViewMol format</option> - <option value="xed">XED format</option> - <option value="xyz">XYZ cartesian coordinates format</option> - <option value="yob">YASARA.org YOB format</option> - <option value="zin">ZINDO input format</option> - </param> - <param name="iso_chi" type="boolean" label="Do not include isotopic or chiral markings (-xi)" truevalue="i" falsevalue="" checked="false" /> - <param name="can" type="boolean" label="Output in canonical form (-xc)" truevalue="c" falsevalue="" checked="false" /> - <param name="exp_h" type="boolean" label="Output explicit hydrogens as such (-xh)" truevalue="h" falsevalue="" checked="false" /> - <param name="remove_h" type="boolean" label="Delete hydrogen atoms (-d)" truevalue="-d" falsevalue="" /> - <param name="ph" size="3" type="float" value="-1" label="Add hydrogens appropriate for pH (-p)" help="-1 means deactivated"/> - <param name="dative_bonds" type="boolean" label="Convert dative bonds (e.g. [N+]([O-])=O to N(=O)=O) (-b)" truevalue="-b" falsevalue="" /> + <conditional name="oformat"> + <param name="oformat_opts_selector" type="select" label="Output format"> + <option value="acr">Carine ASCI Crystal</option> + <option value="alc">Alchemy format</option> + <option value="bgf">MSI BGF format</option> + <option value="box">Dock 3.5 Box format</option> + <option value="bs">Ball and Stick format</option> + <option value="c3d1">Chem3D Cartesian 1 format</option> + <option value="c3d2">Chem3D Cartesian 2 format</option> + <option value="caccrt">Cacao Cartesian format</option> + <option value="cache">CAChe MolStruct format</option> + <option value="cacint">Cacao Internal format</option> + <option value="can" selected="True">Canonical SMILES format (can)</option> + <option value="cdxml">ChemDraw CDXML format</option> + <option value="cht">Chemtool format</option> + <option value="cif">Crystallographic Information File</option> + <option value="cml">Chemical Markup Language</option> + <option value="cmlr">CML Reaction format</option> + <option value="com">Gaussian 98/03 Cartesian Input</option> + <option value="copy">Copies raw text</option> + <option value="crk2d">Chemical Resource Kit 2D diagram format</option> + <option value="crk3d">Chemical Resource Kit 3D format</option> + <option value="csr">Accelrys/MSI Quanta CSR format</option> + <option value="cssr">CSD CSSR format</option> + <option value="ct">ChemDraw Connection Table format</option> + <option value="dmol">DMol3 coordinates format</option> + <!--<option value="ent">Protein Data Bank format</option> + <option value="fa">FASTA format</option>--> + <option value="fasta">FASTA format</option> + <option value="feat">Feature format</option> + <option value="fh">Fenske-Hall Z-Matrix format</option> + <option value="fix">SMILES FIX format</option> + <option value="fpt">Fingerprint format (fpt)</option> + <option value="fract">Free Form Fractional format</option> + <option value="fs">Open Babel FastSearching database (fs)</option> + <!--<option value="fsa">FASTA format</option>--> + <option value="gamin">GAMESS Input</option> + <option value="gau">Gaussian 98/03 Cartesian Input</option> + <!--<option value="gjc">Gaussian 98/03 Cartesian Input</option> + <option value="gjf">Gaussian 98/03 Cartesian Input</option>--> + <option value="gpr">Ghemical format</option> + <option value="gr96">GROMOS96 format</option> + <option value="hin">HyperChem HIN format</option> + <option value="inchi">IUPAC InChI</option> + <option value="inp">GAMESS Input</option> + <option value="jin">Jaguar input format</option> + <!--<option value="mdl">MDL MOL format (mol)</option>--> + <option value="mmd">MacroModel format</option> + <option value="mmod">MacroModel format</option> + <!--<option value="mol">MDL MOL format (mol)</option> use SDF--> + <option value="mol2">Sybyl Mol2 format (mol2)</option> + <option value="molreport">Open Babel molecule report</option> + <option value="mop">MOPAC Cartesian format</option> + <option value="mopcrt">MOPAC Cartesian format</option> + <option value="mopin">MOPAC Internal</option> + <option value="mpc">MOPAC Cartesian format</option> + <option value="mpd">Sybyl descriptor format</option> + <option value="mpqcin">MPQC simplified input format</option> + <option value="nw">NWChem input format</option> + <option value="pcm">PCModel format</option> + <option value="pdb">Protein Data Bank format (pdb)</option> + <option value="pov">POV-Ray input format</option> + <option value="pqs">Parallel Quantum Solutions format</option> + <option value="qcin">Q-Chem input format</option> + <option value="report">Open Babel report format</option> + <option value="rxn">MDL RXN format</option> + <!--<option value="sd">MDL MOL format</option>--> + <option value="sdf">MDL MOL format (sdf, mol)</option> + <option value="smi">SMILES format (smi)</option> + <!--<option value="sy2">Sybyl Mol2 format</option>--> + <option value="tdd">Thermo format</option> + <option value="test">Test format</option> + <option value="therm">Thermo format</option> + <option value="tmol">TurboMole Coordinate format</option> + <option value="txyz">Tinker MM2 format</option> + <option value="unixyz">UniChem XYZ format</option> + <option value="vmol">ViewMol format</option> + <option value="xed">XED format</option> + <option value="xyz">XYZ cartesian coordinates format</option> + <option value="yob">YASARA.org YOB format</option> + <option value="zin">ZINDO input format</option> + </param> + <when value="acr" /> + <when value="alc" /> + <when value="bgf" /> + <when value="box" /> + <when value="bs" /> + <when value="c3d1" /> + <when value="c3d2" /> + <when value="caccrt" /> + <when value="cache" /> + <when value="cacint" /> + <when value="can"> + <param name="can_exp_h" type="boolean" label="Output explicit hydrogens as such (-xh)" truevalue="-xh" falsevalue="" checked="false" /> + <param name="can_iso_chi" type="boolean" label="Do not include isotopic or chiral markings (-xi)" truevalue="-xi" falsevalue="" checked="false" /> + <param name="can_rad" type="boolean" label="Radicals lower case eg ethyl is Cc (-xr)" truevalue="-xr" falsevalue="" checked="false" /> + <param name="can_atomclass_out" type="boolean" label="Output atomclass like [C:2] (-xa)" truevalue="-xa" falsevalue="" checked="false" /> + </when> + <when value="cdxml" /> + <when value="cht" /> + <when value="cif" /> + <when value="cml"> + <param name="cml_cml1" type="boolean" label="convert to CML 1 (rather than CML 2) (-x1)" truevalue="-x1" falsevalue="" checked="false" /> + <param name="cml_array" type="boolean" label="write array format for atoms and bonds (-xa)" truevalue="-xa" falsevalue="" checked="false" /> + <param name="cml_aromatic" type="boolean" label="write aromatic bonds as such, not Kekule form (-xA)" truevalue="-xA" falsevalue="" checked="false" /> + <param name="cml_hydrogen" type="boolean" label="use hydrogen Count for all hydrogens (-xh)" truevalue="-xh" falsevalue="" checked="false" /> + <param name="cml_metadata" type="boolean" label="write metadata (-xm)" truevalue="-xm" falsevalue="" checked="false" /> + <param name="cml_omit" type="boolean" label="omit XML and namespace declarations (-xx)" truevalue="-xx" falsevalue="" checked="false" /> + <param name="cml_continuous" type="boolean" label="continuous output: no formatting (-xc)" truevalue="-xc" falsevalue="" checked="false" /> + <param name="cml_properties" type="boolean" label="write properties (-xp)" truevalue="-xp" falsevalue="" checked="false" /> + </when> + <when value="cmlr" /> + <when value="com" /> + <when value="copy" /> + <when value="crk2d" /> + <when value="crk3d" /> + <when value="csr" /> + <when value="cssr" /> + <when value="ct" /> + <when value="dmol" /> + <when value="fa" /> + <when value="fasta" /> + <when value="feat" /> + <when value="fh" /> + <when value="fix" /> + <when value="fpt"> + <param name="fpt_fptype" type="select" label="Fingerprint type"> + <option value="-xfFP2" selected="True">FP2</option> + <option value="-xfFP3">FP3</option> + <option value="-xfFP4">FP4</option> + <option value="-xfMACCS">MACCS</option> + </param> + <param name="fpt_fold" type="integer" value="0" size="20" label="Fold fingerprint to the number of specifed bits (32, 64, 128, etc.)" help="Use zero for default"> + <validator type="in_range" min="0" /> + </param> + <param name="fpt_hex_multiple" type="boolean" label="hex output when multiple molecules (-xh)" truevalue="-xh" falsevalue="" checked="false" /> + <param name="fpt_hex" type="boolean" label="hex output only (-xo)" truevalue="-xo" falsevalue="" checked="false" /> + <param name="fpt_set" type="boolean" label="describe each set bit (-xs)" truevalue="-xs" falsevalue="" checked="false" /> + <param name="fpt_unset" type="boolean" label="describe each unset bit (-xu)" truevalue="-xu" falsevalue="" checked="false" /> + </when> + <when value="fract" /> + <when value="fs"> + <param name="fs_fptype" type="select" label="Fingerprint type"> + <option value="-xfFP2" selected="True">FP2</option> + <option value="-xfFP3">FP3</option> + <option value="-xfFP4">FP4</option> + <option value="-xfMACCS">MACCS</option> + </param> + <param name="fs_fold" type="integer" value="0" size="20" label="Fold fingerprint to the number of specifed bits (32, 64, 128, etc.)" help="Use zero for default"> + <validator type="in_range" min="0" /> + </param> + </when> + <when value="gamin" /> + <when value="gau" /> + <when value="gjf" /> + <when value="gpr" /> + <when value="gr96" /> + <when value="hin" /> + <when value="inchi"> + <param name="inchi_key" type="boolean" label="output InChIKey only (-xK)" truevalue="-xK" falsevalue="" checked="false" /> + <param name="inchi_name" type="boolean" label="add molecule name after InChI (-xt)" truevalue="-xt" falsevalue="" checked="true" /> + <param name="inchi_unique" type="boolean" label="output only unique molecules (-xu)" truevalue="-xu" falsevalue="" checked="false" /> + <param name="inchi_unique_sort" type="boolean" label="output only unique molecules and sort them (-xU)" truevalue="-xU" falsevalue="" checked="false" /> + <param name="inchi_truncate" type="select" multiple="True" display="checkboxes" label="truncate InChI according to various parameters"> + <option value="/formula">formula only</option> + <option value="/connect">formula and connectivity only</option> + <option value="/nostereo">ignore E/Z and sp3 stereochemistry</option> + <option value="/sp3">ignore sp3 stereochemistry</option> + <option value="/noEZ">ignore E/Z steroeochemistry</option> + <option value="/nochg">ignore charge and protonation</option> + <option value="/noiso">ignore isotopes</option> + </param> + + <param name="inchi_additional" type="select" multiple="True" display="checkboxes" label="Additional InChI options" help="For more information please see the InChI documentation (http://www.inchi-trust.org/fileadmin/user_upload/html/inchifaq/inchi-faq.html)."> + <option value="NEWPSOFF">Narrow End of Wedge Points to Stereo is OFF (NEWPSOFF - stdInChI)</option> + <option value="DoNotAddH">Skip the addition of hydrogen atoms (DoNotAddH - stdInChI)</option> + <option value="SNon">Exclude stereo (SNon - stdInChI)</option> + <option value="SRel">Relative stereo (SRel)</option> + <option value="SRac">Racemic stereo (SRac)</option> + <option value="SUCF">Use Chiral Flag (SUCF)</option> + <option value="ChiralFlagON">Set Chiral Flag (ChrialFlagON)</option> + <option value="ChiralFlagOFF">Set Not-Chiral Flag (ChrialFlagOFF)</option> + <option value="SUU">Include omitted unknown/undefined stereo (SUU)</option> + <option value="SLUUD">Stereo labels for "unknown" and "undefined" are different, 'u' and '?', respectively (SLUUD) </option> + <option value="FixedH">Mobile H Perception Off (FixedH)</option> + <option value="RecMet">Include reconnected bond to metal results (RecMet)</option> + <option value="KET">Keto-enol tautomerism (KET)</option> + <option value="15T">1,5-tautomerism (15T)</option> + </param> + </when> + <when value="inp" /> + <when value="jin" /> + <when value="mmd" /> + <when value="mmod" /> + <when value="mol2"> + <param name="mol2_ignore_res" type="boolean" label="Output ignores residue information for ligands (-xl)" truevalue="-xl" falsevalue="" checked="false" /> + </when> + <when value="molreport" /> + <when value="mop" /> + <when value="mopcrt" /> + <when value="mopin" /> + <when value="mpc" /> + <when value="mpd" /> + <when value="mpqcin" /> + <when value="nw" /> + <when value="pcm" /> + <when value="pdb" /> + <when value="pov" /> + <when value="pqs" /> + <when value="qcin" /> + <when value="report" /> + <when value="rxn" /> + <when value="sdf"> + <param name="sdf_exp_h" type="boolean" label="output V3000 not V2000 (used for >999 atoms/bonds) (-x3)" truevalue="-x3" falsevalue="" checked="false" /> + <param name="sdf_no_prop" type="boolean" label="write no properties (-xm)" truevalue="-xm" falsevalue="" checked="false" /> + <param name="sdf_wedge_bonds" type="boolean" label="use wedge and hash bonds from input (2D structures only) (-xw)" truevalue="-xw" falsevalue="" checked="false" /> + <param name="sdf_alias_out" type="boolean" label="output in Alias form, e.g. Ph (-xA)" truevalue="-xA" falsevalue="" checked="false" /> + </when> + <when value="smi"> + <param name="smi_exp_h" type="boolean" label="Output explicit hydrogens as such (-xh)" truevalue="-xh" falsevalue="" checked="false" /> + <param name="smi_iso_chi" type="boolean" label="Do not include isotopic or chiral markings (-xi)" truevalue="-xi" falsevalue="" checked="false" /> + <param name="smi_rad" type="boolean" label="Radicals lower case eg ethyl is Cc (-xr)" truevalue="-xr" falsevalue="" checked="false" /> + <param name="smi_atomclass_out" type="boolean" label="Output atomclass like [C:2] (-xa)" truevalue="-xa" falsevalue="" checked="false" /> + <param name="smi_can" type="boolean" label="Output in canonical form (-xc)" truevalue="-xc" falsevalue="" checked="false" /> + <param name="smi_coordinates" type="boolean" label="append X/Y coordinates in canonical-SMILES order (-xx)" truevalue="-xx" falsevalue="" checked="false" /> + </when> + <when value="tdd" /> + <when value="test" /> + <when value="therm" /> + <when value="tmol" /> + <when value="txyz" /> + <when value="unixyz" /> + <when value="vmol" /> + <when value="xed" /> + <when value="xyz" /> + <when value="yob" /> + <when value="zin" /> + </conditional> + + + <!-- Options for all formats.--> + <param name="remove_h" type="boolean" label="Delete hydrogen atoms, make all hydrogen implicit (-d)" truevalue="-d" falsevalue="" /> + <param name="ph" size="5" type="float" value="-1" label="Add hydrogens appropriate for pH (-p)" help="-1 means deactivated"/> + <param name="dative_bonds" type="boolean" label="Convert dative bonds, e.g. [N+]([O-])=O to N(=O)=O (-b)" truevalue="-b" falsevalue="" /> + + <param name="appendtotitle" type="text" value="" size="20" label="Append the specified text after each molecule title"/> + + <!-- Uniqueness --> + <conditional name="unique"> + <param name="unique_opts_selector" type="select" label="Uniqueness according to"> + <option value="" selected="True">No unique filter</option> + <option value="inchi">InChI</option> + <option value="cansmi">canonical SMILES with stereochemical information</option> + <option value="cansmiNS">canonical SMILES without stereochemical information</option> + <option value="title">title</option> + </param> + <when value="" /> + <when value="cansmi" /> + <when value="cansmiNS" /> + <when value="title" /> + <when value="inchi"> + <param name="truncate" type="select" multiple="True" display="checkboxes" label="Uniqueness defined as truncated InChI"> + <option value="/formula">formula only</option> + <option value="/connect">formula and connectivity only</option> + <option value="/nostereo">ignore E/Z and sp3 stereochemistry</option> + <option value="/sp3">ignore sp3 stereochemistry</option> + <option value="/noEZ">ignore E/Z steroeochemistry</option> + <option value="/nochg">ignore charge and protonation</option> + <option value="/noiso">ignore isotopes</option> + </param> + </when> + </conditional> </inputs> + + <outputs> - <data name="outfile" type="data" format="text" label="Convert to ${out_format.input.value_label} from ${on_string}"> + <data name="outfile" type="data" format="text" label="Convert to ${oformat.oformat_opts_selector} from ${on_string}"> <change_format> - <when input="out_format" value="sdf" format="sdf"/> - <when input="out_format" value="smi" format="smi"/> - <when input="out_format" value="mol2" format="mol2"/> - <when input="out_format" value="inchi" format="inchi"/> - <when input="out_format" value="cml" format="cml"/> - <when input="out_format" value="mol" format="mol"/> - <when input="out_format" value="pdb" format="pdb"/> - <when input="out_format" value="fs" format="obfs"/> + <when input="oformat.oformat_opts_selector" value="sdf" format="sdf"/> + <when input="oformat.oformat_opts_selector" value="can" format="smi"/> + <when input="oformat.oformat_opts_selector" value="smi" format="smi"/> + <when input="oformat.oformat_opts_selector" value="mol2" format="mol2"/> + <when input="oformat.oformat_opts_selector" value="inchi" format="inchi"/> + <when input="oformat.oformat_opts_selector" value="cml" format="cml"/> + <when input="oformat.oformat_opts_selector" value="mol" format="mol"/> + <when input="oformat.oformat_opts_selector" value="pdb" format="pdb"/> + <when input="oformat.oformat_opts_selector" value="fs" format="obfs"/> </change_format> </data> </outputs>
--- a/filter/ob_filter.xml Fri Apr 26 11:05:19 2013 -0400 +++ b/filter/ob_filter.xml Sat May 11 17:11:45 2013 -0400 @@ -50,6 +50,10 @@ <option value="DrugLike">Drug-like properties</option> <option value="FragmentLike">Fragment-like properties</option> </param> + <when value="ruleof5" /> + <when value="LeadLike" /> + <when value="DrugLike" /> + <when value="FragmentLike" /> <when value="user"> <repeat name="filter_set" title="Filters selection"> <conditional name="filter_sel"> @@ -62,7 +66,8 @@ <option value="logp">Predicted value of LogP</option> <option value="mr">Predicted value for the Molecular Refractivity</option> <option value="atoms">Number of atoms</option> - <option value="hatoms">Number of heavy atoms</option> + <!-- Add later, we need to add a new smarts pattern to plugindefines.txt + <option value="hatoms">Number of heavy atoms</option>--> <!-- We skip that options, for further information please read: http://www.dalkescientific.com/writings/diary/archive/2011/06/04/dealing_with_sssr.html --> <!--<option value="rings">Number of rings</option>--> </param> @@ -116,6 +121,9 @@ <param name="filter_methods_opts" value="ruleof5" /> <output name="outfile" ftype="smi" file="ob_filter_on_CID2244.smi" /> </test> + <!-- + Limitation of the test framework: + https://trello.com/card/disambiguated-conditional-parameters-not-supported-in-unit-tests/506338ce32ae458f6d15e4b3/820 <test> <param name="infile" ftype="smi" value="CID_2244.smi"/> <param name="filter_methods_opts" value="user" /> @@ -124,6 +132,7 @@ <param name="hbd_max" value="5" /> <output name="outfile" ftype="smi" file="ob_filter_on_CID2244_2.smi" /> </test> + --> </tests> <help>
--- a/modify/ob_genProp.py Fri Apr 26 11:05:19 2013 -0400 +++ b/modify/ob_genProp.py Sat May 11 17:11:45 2013 -0400 @@ -14,9 +14,9 @@ def parse_command_line(argv): parser = argparse.ArgumentParser() - parser.add_argument('-iformat', default='sdf' , help='input file format') + parser.add_argument('--iformat', default='sdf' , help='input file format') parser.add_argument('-i', '--input', required=True, help='input file name') - parser.add_argument('-oformat', default='sdf', choices = ['sdf', 'table'] , help='output file format') + parser.add_argument('--oformat', default='sdf', choices = ['sdf', 'table'] , help='output file format') parser.add_argument('--header', type=bool, help='Include the header as the first line of the output table') parser.add_argument('-o', '--output', required=True, help='output file name') return parser.parse_args()
--- a/modify/ob_genProp.xml Fri Apr 26 11:05:19 2013 -0400 +++ b/modify/ob_genProp.xml Sat May 11 17:11:45 2013 -0400 @@ -7,8 +7,8 @@ <command interpreter="python"> ob_genProp.py -i "${infile}" - -iformat "${infile.ext}" - -oformat "${output_opts.output_format_types}" + --iformat "${infile.ext}" + --oformat "${output_opts.output_format_types}" #if $output_opts.header.value: --header $output_opts.header #end if
--- a/repository_dependencies.xml Fri Apr 26 11:05:19 2013 -0400 +++ b/repository_dependencies.xml Sat May 11 17:11:45 2013 -0400 @@ -1,4 +1,4 @@ <?xml version="1.0"?> <repositories description="This requires the Molecule datatype definitions (e.g. SMILES, InChI, SD-format)."> - <repository toolshed="http://testtoolshed.g2.bx.psu.edu/" name="molecule_datatypes" owner="bgruening" changeset_revision="e533de975501" /> + <repository toolshed="http://testtoolshed.g2.bx.psu.edu/" name="molecule_datatypes" owner="bgruening" changeset_revision="1a070566e9c6" /> </repositories>
--- a/search/ob_spectrophore_search.xml Fri Apr 26 11:05:19 2013 -0400 +++ b/search/ob_spectrophore_search.xml Sat May 11 17:11:45 2013 -0400 @@ -11,7 +11,7 @@ --column $column </command> <inputs> - <param name="target" type="data" format="sdf" label="Target molecule in sdf format (it must contain its Spectrophores(TM) stored as meta-data)"/> + <param name="target" type="data" format="sdf" label="Target molecule in SDF format (it must contain its Spectrophores(TM) stored as meta-data)"/> <param name="library" type="data" format="tabular" label="Tabular file with pre-computed Spectrophores(TM) in one column"/> <param name="column" label="Specify the column number containing the Spectrophores(TM) descriptors" type="data_column" data_ref="library" accept_default="true" /> </inputs>
--- a/subsearch/subsearch.py Fri Apr 26 11:05:19 2013 -0400 +++ b/subsearch/subsearch.py Sat May 11 17:11:45 2013 -0400 @@ -17,6 +17,7 @@ def parse_command_line(): parser = argparse.ArgumentParser() parser.add_argument('-i', '--infile', required=True, help='Molecule file.') + parser.add_argument('--iformat', help='Input format.') parser.add_argument('--fastsearch-index', dest="fastsearch_index", required=True, help='Path to the openbabel fastsearch index.') parser.add_argument('-o', '--outfile', required=True, help='Path to the output file.') @@ -45,7 +46,7 @@ opts = '-o%s' % args.oformat tmp = tempfile.NamedTemporaryFile(delete=False) - cmd = 'obabel %s -O %s %s -ifs -s%s -al %s' % (args.fastsearch_index, tmp.name, opts, query, args.max_candidates) + cmd = 'obabel -ifs %s -O %s %s -s%s -al %s' % (args.fastsearch_index, tmp.name, opts, query, args.max_candidates) child = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -64,12 +65,25 @@ return (tmp.name, query) +def get_smiles_or_smarts( args ): + """ + Wrapper to retrieve a striped SMILES or SMARTS string from different input formats. + """ + if args.iformat in ['smi', 'text', 'tabular']: + with open( args.infile ) as text_file: + for line in text_file: + yield line.split('\t')[0].strip() + else: + # inchi or sdf files + for mol in pybel.readfile( args.iformat, args.infile ): + yield mol.wrtie('smiles').split('\t')[0] + def substructure_search( args ): pool = multiprocessing.Pool( args.processors ) - for query in open( args.infile ): - pool.apply_async(mp_helper, args=(query.strip(), args), callback=mp_callback) - #mp_callback( mp_helper(query.strip(), args) ) + for query in get_smiles_or_smarts( args ): + pool.apply_async(mp_helper, args=(query, args), callback=mp_callback) + #mp_callback( mp_helper(query, args) ) pool.close() pool.join()
--- a/subsearch/subsearch.xml Fri Apr 26 11:05:19 2013 -0400 +++ b/subsearch/subsearch.xml Sat May 11 17:11:45 2013 -0400 @@ -7,6 +7,7 @@ subsearch.py -i $query + --iformat "${query.ext}" --fastsearch-index "${os.path.join($fastsearch.extra_files_path,'molecule.fs')}" -o "${outfile}" --oformat $oformat @@ -45,7 +46,7 @@ **What it does** -Substructure search in a Open Babel Fastsearch Index. You can search with SMILES or SMARTS pattern. +Substructure search in a Open Babel Fastsearch Index. You can search with SMILES or SMARTS pattern, SD- and InChI files will be converted to SMILES. -----