# HG changeset patch # User bgruening # Date 1586441391 14400 # Node ID 340f8d63c1f46c2ba64107992e8058ca7b178cac # Parent da0059ee548ad21e2ab2dbf79884812c5b2cb320 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit cda909c5e0b88fa3d12abe43fc72b8dd0729417a" diff -r da0059ee548a -r 340f8d63c1f4 macros.xml --- a/macros.xml Wed Mar 25 16:49:41 2020 -0400 +++ b/macros.xml Thu Apr 09 10:09:51 2020 -0400 @@ -1,5 +1,5 @@ - 2.4.2.1 + 2.4.2.2 diff -r da0059ee548a -r 340f8d63c1f4 ob_filter.py --- a/ob_filter.py Wed Mar 25 16:49:41 2020 -0400 +++ b/ob_filter.py Thu Apr 09 10:09:51 2020 -0400 @@ -40,7 +40,7 @@ for mol in pybel.readfile('sdf', args.input): for key, elem in filters.items(): # map the short description to the larger metadata names stored in the sdf file - property = cheminfolib.ColumnNames[key] + property = cheminfolib.ColumnNames.get(key, key) min = elem[0] max = elem[1] if float(mol.data[property]) >= float(min) and float(mol.data[property]) <= float(max): @@ -113,7 +113,7 @@ # Check if the sdf file contains all of the required metadata to invoke the precalculation filtering mol = next(pybel.readfile('sdf', args.input)) for key, elem in filters.items(): - property = cheminfolib.ColumnNames[key] + property = cheminfolib.ColumnNames.get(key, key) if not property in mol.data: break else: diff -r da0059ee548a -r 340f8d63c1f4 ob_filter.xml --- a/ob_filter.xml Wed Mar 25 16:49:41 2020 -0400 +++ b/ob_filter.xml Thu Apr 09 10:09:51 2020 -0400 @@ -10,40 +10,45 @@ python '$__tool_directory__/ob_filter.py' -i '${infile}' -o '${outfile}' - -iformat '${infile.ext}' - -oformat '${infile.ext}' + -iformat "${infile.ext}" + -oformat "${infile.ext}" #if $filter_methods.filter_methods_opts == "__filter_by_name__": --list_of_names '$name_file' --filters '__filter_by_name__' #else - --filters '{ - #if $filter_methods.filter_methods_opts == "ruleof5": - "hbd" : [0, 5], - "hba" : [0, 10], - "molwt" : [0, 500], - "logp" : [-5, 5], - #elif $filter_methods.filter_methods_opts == "LeadLike": - "rotbonds" : [0, 7], - "molwt" : [0, 350], - "logp" : [-5, 3.5], - #elif $filter_methods.filter_methods_opts == "DrugLike": - "hba" : [0, 10], - "rotbonds" : [0, 8], - "molwt" : [150, 500], - "logp" : [-5, 5], - "psa" : [0, 150], - #elif $filter_methods.filter_methods_opts == "FragmentLike": - "rotbonds" : [0, 5], - "molwt" : [0, 250], - "logp" : [-5, 2.5], - #else: - #for $filter in $filter_methods.filter_set: + --filters '{ + #if $filter_methods.filter_methods_opts == "ruleof5": + "hbd" : [0, 5], + "hba" : [0, 10], + "molwt" : [0, 500], + "logp" : [-5, 5], + #elif $filter_methods.filter_methods_opts == "LeadLike": + "rotbonds" : [0, 7], + "molwt" : [0, 350], + "logp" : [-5, 3.5], + #elif $filter_methods.filter_methods_opts == "DrugLike": + "hba" : [0, 10], + "rotbonds" : [0, 8], + "molwt" : [150, 500], + "logp" : [-5, 5], + "psa" : [0, 150], + #elif $filter_methods.filter_methods_opts == "FragmentLike": + "rotbonds" : [0, 5], + "molwt" : [0, 250], + "logp" : [-5, 2.5], + #else: + #for $filter in $filter_methods.filter_set: + #if $filter.filter_sel.filter_sel_opts == "field": + #set $filter_selected = $filter.filter_sel['field_name'] + "$filter_selected": [$filter.filter_sel['field_min'], $filter.filter_sel['field_max'] ], + #else: #set $filter_selected = $filter.filter_sel.filter_sel_opts #set $filter_min = $filter_selected + "_min" #set $filter_max = $filter_selected + "_max" "$filter_selected" : [$filter.filter_sel[$filter_min], $filter.filter_sel[$filter_max] ], - #end for - #end if + #end if + #end for + #end if }' #end if ]]> @@ -80,6 +85,7 @@ + @@ -117,6 +123,19 @@ + + + + + + + + + + + + +