# HG changeset patch # User bimib # Date 1584285576 14400 # Node ID 7b57a93ac594333cab12c2cdcf5c54e37a720d93 # Parent 88b7180d7b796c2e83b0c1106adcacf0ac5a12d6 Uploaded diff -r 88b7180d7b79 -r 7b57a93ac594 Marea/marea.py --- a/Marea/marea.py Fri Mar 13 14:26:31 2020 -0400 +++ b/Marea/marea.py Sun Mar 15 11:19:36 2020 -0400 @@ -537,36 +537,6 @@ warning('Warning: wrong format rule in ' + str(err_rules) + '\n') return (split_rules, list(set(tmp_gene_in_rule))) -def make_recon(data): - try: - import cobra as cb - import warnings - with warnings.catch_warnings(): - warnings.simplefilter('ignore') - recon = cb.io.read_sbml_model(data) - react = recon.reactions - rules = [react[i].gene_reaction_rule for i in range(len(react))] - ids = [react[i].id for i in range(len(react))] - except cb.io.sbml.CobraSBMLError: - try: - data = (pd.read_csv(data, sep = '\t', dtype = str, engine='python')).fillna('') - if len(data.columns) < 2: - sys.exit('Execution aborted: wrong format of '+ - 'custom datarules\n') - if not len(data.columns) == 2: - warning('Warning: more than 2 columns in custom datarules.\n' + - 'Extra columns have been disregarded\n') - ids = list(data.iloc[:, 0]) - rules = list(data.iloc[:, 1]) - except pd.errors.EmptyDataError: - sys.exit('Execution aborted: wrong format of custom datarules\n') - except pd.errors.ParserError: - sys.exit('Execution aborted: wrong format of custom datarules\n') - split_rules, tmp_genes = do_rules(rules) - gene_in_rule = {} - for i in tmp_genes: - gene_in_rule[i] = 'ok' - return (ids, split_rules, gene_in_rule) ############################ gene ############################################# @@ -812,9 +782,6 @@ if os.path.isdir('result') == False: os.makedirs('result') - - if args.custom_rules == 'true': - ids, rules, gene_in_rule = make_recon(args.custom_rule) class_pat = {}