# HG changeset patch
# User francesco_lapi
# Date 1757279786 0
# Node ID ccccb731c95363804a8bb98158811f658379f53e
# Parent 6c7ddf68381ad9a7fe612bee0f673b93052496b3
Uploaded
diff -r 6c7ddf68381a -r ccccb731c953 COBRAxy/ras_generator.py
--- a/COBRAxy/ras_generator.py Sun Sep 07 20:29:23 2025 +0000
+++ b/COBRAxy/ras_generator.py Sun Sep 07 21:16:26 2025 +0000
@@ -28,7 +28,7 @@
description = "process some value's genes to create a comparison's map.")
parser.add_argument("-rl", "--model_upload", type = str,
- help = "path to input file with custom rules, if provided")
+ help = "path to input file containing the rules")
parser.add_argument("-rn", "--model_upload_name", type = str, help = "custom rules name")
# ^ I need this because galaxy converts my files into .dat but I need to know what extension they were in
diff -r 6c7ddf68381a -r ccccb731c953 COBRAxy/rps_generator.py
--- a/COBRAxy/rps_generator.py Sun Sep 07 20:29:23 2025 +0000
+++ b/COBRAxy/rps_generator.py Sun Sep 07 21:16:26 2025 +0000
@@ -25,14 +25,11 @@
parser = argparse.ArgumentParser(usage = '%(prog)s [options]',
description = 'process some value\'s'+
' abundances and reactions to create RPS scores.')
- parser.add_argument('-rc', '--reaction_choice',
- type = str,
- default = 'default',
- choices = ['default','custom'],
- help = 'chose which type of reaction dataset you want use')
- parser.add_argument('-cm', '--custom',
- type = str,
- help='your dataset if you want custom reactions')
+
+ parser.add_argument("-rl", "--model_upload", type = str,
+ help = "path to input file containing the reactions")
+
+ # model_upload custom
parser.add_argument('-td', '--tool_dir',
type = str,
required = True,
@@ -205,7 +202,6 @@
cell_lines = dataset[0][1:]
abundances_dict = {}
- translationIsApplied = ARGS.reaction_choice == "default"
for row in dataset[1:]:
id = get_metabolite_id(row[0], syn_dict) #if translationIsApplied else row[0]
if id:
@@ -245,22 +241,22 @@
dataset = utils.readCsv(utils.FilePath.fromStrPath(ARGS.input), '\t', skipHeader = False)
tmp_dict = None
- if ARGS.reaction_choice == 'default':
- reactions = pk.load(open(ARGS.tool_dir + '/local/pickle files/reactions.pickle', 'rb'))
- substrateFreqTable = pk.load(open(ARGS.tool_dir + '/local/pickle files/substrate_frequencies.pickle', 'rb'))
+ #if ARGS.reaction_choice == 'default':
+ # reactions = pk.load(open(ARGS.tool_dir + '/local/pickle files/reactions.pickle', 'rb'))
+ # substrateFreqTable = pk.load(open(ARGS.tool_dir + '/local/pickle files/substrate_frequencies.pickle', 'rb'))
- elif ARGS.reaction_choice == 'custom':
- reactions = reactionUtils.parse_custom_reactions(ARGS.custom)
- for r, s in reactions.items():
- tmp_list = list(s.keys())
- for k in tmp_list:
- if k[-2] == '_':
- s[k[:-2]] = s.pop(k)
- substrateFreqTable = {}
- for _, substrates in reactions.items():
- for substrateName, _ in substrates.items():
- if substrateName not in substrateFreqTable: substrateFreqTable[substrateName] = 0
- substrateFreqTable[substrateName] += 1
+ #elif ARGS.reaction_choice == 'custom':
+ reactions = reactionUtils.parse_custom_reactions(ARGS.model_upload)
+ for r, s in reactions.items():
+ tmp_list = list(s.keys())
+ for k in tmp_list:
+ if k[-2] == '_':
+ s[k[:-2]] = s.pop(k)
+ substrateFreqTable = {}
+ for _, substrates in reactions.items():
+ for substrateName, _ in substrates.items():
+ if substrateName not in substrateFreqTable: substrateFreqTable[substrateName] = 0
+ substrateFreqTable[substrateName] += 1
print(f"Reactions: {reactions}")
print(f"Substrate Frequencies: {substrateFreqTable}")
diff -r 6c7ddf68381a -r ccccb731c953 COBRAxy/rps_generator.xml
--- a/COBRAxy/rps_generator.xml Sun Sep 07 20:29:23 2025 +0000
+++ b/COBRAxy/rps_generator.xml Sun Sep 07 21:16:26 2025 +0000
@@ -12,29 +12,19 @@
-
+
+
+
-
-
-
-
-
-
-
-
-
-