# HG changeset patch # User pieter.lukasse@wur.nl # Date 1394112595 -3600 # Node ID cd4f13119afad476e58af654922c6efc8ec4abb0 # Parent 19d8fd10248e3db74fd8851e3ed0c7bfd669bc8a Small fix in filters part and improvement in query_metexp time logging diff -r 19d8fd10248e -r cd4f13119afa primsfilters.py --- a/primsfilters.py Wed Mar 05 17:20:11 2014 +0100 +++ b/primsfilters.py Thu Mar 06 14:29:55 2014 +0100 @@ -21,7 +21,9 @@ """ # for debugging: import pydevd;pydevd.settrace("L0136815.wurnet.nl") user = context.trans.user - metabolomics_tools = [ "msclust2", "combine_output", "create_poly_model", "lookup_library", "NDIStext2tabular", "rankfilterGCMS_tabular", "filter_on_rank" ] + metabolomics_tools = [ "msclust2", "combine_output", "create_poly_model", "lookup_library", + "NDIStext2tabular", "rankfilterGCMS_tabular", "filter_on_rank", + "export_to_metexp_tabular", "query_metexp" ] found_match = False # iterate over the tool (partial)ids and look for a match (this is compatible with tool shed given ids): for partial_id in metabolomics_tools: diff -r 19d8fd10248e -r cd4f13119afa query_metexp.py --- a/query_metexp.py Wed Mar 05 17:20:11 2014 +0100 +++ b/query_metexp.py Thu Mar 06 14:29:55 2014 +0100 @@ -14,6 +14,7 @@ import sys import fileinput import urllib2 +import time from collections import OrderedDict __author__ = "Pieter Lukasse" @@ -44,6 +45,8 @@ This method will iterate over the record in the input_data and will enrich them with the related information found (if any) in the MetExp Database. + + # TODO : could optimize this with multi-threading, see also nice example at http://stackoverflow.com/questions/2846653/python-multithreading-for-dummies ''' merged = [] @@ -247,6 +250,8 @@ and one for the formula of the respective identification. These two columns are then used to query against MetExp Database. ''' + seconds_start = int(round(time.time())) + input_file = sys.argv[1] casid_col = sys.argv[2] formula_col = sys.argv[3] @@ -267,7 +272,11 @@ 'METEXP hits: experiments','METEXP hits: user names','METEXP hits: column types', 'METEXP hits: CAS nrs', 'Link to METEXP hits'] _save_data(enriched_data, headers, output_result) - + + seconds_end = int(round(time.time())) + print "Took " + str(seconds_end - seconds_start) + " seconds" + + if __name__ == '__main__': main()