gsrap 0.7.1__py3-none-any.whl → 0.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gsrap/.ipynb_checkpoints/__init__-checkpoint.py +5 -1
- gsrap/__init__.py +5 -1
- gsrap/commons/.ipynb_checkpoints/__init__-checkpoint.py +1 -0
- gsrap/commons/.ipynb_checkpoints/downloads-checkpoint.py +1 -1
- gsrap/commons/.ipynb_checkpoints/escherutils-checkpoint.py +1 -1
- gsrap/commons/.ipynb_checkpoints/excelhub-checkpoint.py +94 -37
- gsrap/commons/.ipynb_checkpoints/figures-checkpoint.py +119 -0
- gsrap/commons/.ipynb_checkpoints/keggutils-checkpoint.py +145 -0
- gsrap/commons/__init__.py +1 -0
- gsrap/commons/downloads.py +1 -1
- gsrap/commons/escherutils.py +1 -1
- gsrap/commons/excelhub.py +94 -37
- gsrap/commons/figures.py +119 -0
- gsrap/commons/keggutils.py +145 -0
- gsrap/mkmodel/.ipynb_checkpoints/mkmodel-checkpoint.py +64 -20
- gsrap/mkmodel/.ipynb_checkpoints/pruner-checkpoint.py +72 -7
- gsrap/mkmodel/mkmodel.py +64 -20
- gsrap/mkmodel/pruner.py +72 -7
- gsrap/parsedb/.ipynb_checkpoints/completeness-checkpoint.py +124 -64
- gsrap/parsedb/.ipynb_checkpoints/introduce-checkpoint.py +8 -0
- gsrap/parsedb/.ipynb_checkpoints/parsedb-checkpoint.py +12 -5
- gsrap/parsedb/completeness.py +124 -64
- gsrap/parsedb/introduce.py +8 -0
- gsrap/parsedb/parsedb.py +12 -5
- gsrap/runsims/.ipynb_checkpoints/simplegrowth-checkpoint.py +2 -2
- gsrap/runsims/simplegrowth.py +2 -2
- {gsrap-0.7.1.dist-info → gsrap-0.8.0.dist-info}/METADATA +3 -1
- {gsrap-0.7.1.dist-info → gsrap-0.8.0.dist-info}/RECORD +31 -27
- {gsrap-0.7.1.dist-info → gsrap-0.8.0.dist-info}/LICENSE.txt +0 -0
- {gsrap-0.7.1.dist-info → gsrap-0.8.0.dist-info}/WHEEL +0 -0
- {gsrap-0.7.1.dist-info → gsrap-0.8.0.dist-info}/entry_points.txt +0 -0
|
@@ -17,6 +17,7 @@ from ..commons import show_contributions
|
|
|
17
17
|
from ..commons import adjust_biomass_precursors
|
|
18
18
|
from ..commons import count_undrawn_rids
|
|
19
19
|
from ..commons import format_expansion
|
|
20
|
+
from ..commons import download_keggorg
|
|
20
21
|
|
|
21
22
|
from .introduce import introduce_metabolites
|
|
22
23
|
from .introduce import introduce_reactions
|
|
@@ -72,7 +73,14 @@ def main(args, logger):
|
|
|
72
73
|
|
|
73
74
|
|
|
74
75
|
# format the --eggnog param
|
|
75
|
-
args.eggnog = format_expansion(logger, args.eggnog)
|
|
76
|
+
args.eggnog = format_expansion(logger, args.eggnog) # now 'args.eggnog' could still be '-'
|
|
77
|
+
|
|
78
|
+
# get the kegg organism if requested
|
|
79
|
+
if args.keggorg != '-':
|
|
80
|
+
response = download_keggorg(logger, args.keggorg, args.outdir)
|
|
81
|
+
if response == 1: return 1
|
|
82
|
+
|
|
83
|
+
|
|
76
84
|
|
|
77
85
|
|
|
78
86
|
# check and extract the required 'gsrap.maps' file
|
|
@@ -153,9 +161,8 @@ def main(args, logger):
|
|
|
153
161
|
|
|
154
162
|
###### CHECKS 1
|
|
155
163
|
# check universe completness
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
if response==1: return 1
|
|
164
|
+
df_C = check_completeness(logger, universe, args.progress, args.module, args.focus, args.eggnog, args.keggorg, idcollection_dict, summary_dict, args.outdir)
|
|
165
|
+
if type(df_C)==int: return 1
|
|
159
166
|
|
|
160
167
|
|
|
161
168
|
|
|
@@ -194,7 +201,7 @@ def main(args, logger):
|
|
|
194
201
|
cobra.io.write_sbml_model(universe, f'{args.outdir}/universe.xml') # groups are saved only to SBML
|
|
195
202
|
logger.info(f"'{args.outdir}/universe.xml' created!")
|
|
196
203
|
force_id_on_sbml(f'{args.outdir}/universe.xml', 'universe') # force introduction of the 'id=""' field
|
|
197
|
-
sheets_dict = write_excel_model(universe, f'{args.outdir}/universe.parsedb.xlsx', df_E, None, None, df_S)
|
|
204
|
+
sheets_dict = write_excel_model(universe, f'{args.outdir}/universe.parsedb.xlsx', args.nofigs, df_E, None, None, df_S, df_C)
|
|
198
205
|
logger.info(f"'{args.outdir}/universe.parsedb.xlsx' created!")
|
|
199
206
|
|
|
200
207
|
|
gsrap/parsedb/completeness.py
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
import pickle
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
|
|
1
6
|
import pandas as pnd
|
|
2
7
|
|
|
3
8
|
|
|
@@ -32,14 +37,39 @@ def parse_eggnog(model, eggnog, idcollection_dict):
|
|
|
32
37
|
return krs_org
|
|
33
38
|
|
|
34
39
|
|
|
40
|
+
|
|
41
|
+
def parse_keggorg(keggorg, outdir, idcollection_dict):
|
|
42
|
+
|
|
43
|
+
df_keggorg = pickle.load(open(os.path.join(outdir, f'{keggorg}.keggorg'), 'rb'))
|
|
44
|
+
df_keggorg = df_keggorg.set_index('gid', drop=True, verify_integrity=True)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
# PART 1. get KO codes available
|
|
48
|
+
kos_org = set([i for i in df_keggorg['ko'] if pnd.isna(i)==False])
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# PART 2. get reactions in the organism (even the GPR is not complete)
|
|
52
|
+
kr_to_kos = idcollection_dict['kr_to_kos']
|
|
53
|
+
krs_org = set()
|
|
54
|
+
for kr, kos in kr_to_kos.items():
|
|
55
|
+
if any([ko in kos_org for ko in kos]):
|
|
56
|
+
krs_org.add(kr)
|
|
35
57
|
|
|
36
|
-
|
|
58
|
+
|
|
59
|
+
return krs_org
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def check_completeness(logger, model, progress, module, focus, eggnog, keggorg, idcollection_dict, summary_dict, outdir):
|
|
37
64
|
# check KEGG annotations in the universe model to get '%' of completeness per pathway/module.
|
|
38
65
|
|
|
39
66
|
|
|
40
67
|
# get the reference set of kr codes (all kegg or organism specific):
|
|
41
68
|
kr_uni = set()
|
|
42
|
-
if
|
|
69
|
+
if keggorg != '-': # keggorg has precedence
|
|
70
|
+
kr_uni = parse_keggorg(keggorg, outdir, idcollection_dict)
|
|
71
|
+
kr_uni_label = f"organism code '{keggorg}'"
|
|
72
|
+
elif eggnog != '-':
|
|
43
73
|
for eggfile in eggnog:
|
|
44
74
|
eggset = parse_eggnog(model, eggfile, idcollection_dict)
|
|
45
75
|
kr_uni = kr_uni.union(eggset)
|
|
@@ -55,10 +85,22 @@ def check_completeness(logger, model, progress, module, focus, eggnog, zeroes, i
|
|
|
55
85
|
if 'kegg.reaction' in r.annotation.keys():
|
|
56
86
|
for kr_id in r.annotation['kegg.reaction']:
|
|
57
87
|
kr_ids_modeled.add(kr_id)
|
|
58
|
-
kr_uni_missing =
|
|
88
|
+
kr_uni_missing = kr_uni - kr_ids_modeled
|
|
59
89
|
kr_uni_coverage = len(kr_ids_modeled.intersection(kr_uni)) / len(kr_uni) * 100
|
|
60
|
-
logger.info(f"Coverage for
|
|
90
|
+
logger.info(f"Coverage for {kr_uni_label}: {round(kr_uni_coverage, 0)}% ({len(kr_uni_missing)} missing).")
|
|
91
|
+
|
|
61
92
|
|
|
93
|
+
# define the map?????, containing krs not included in maps
|
|
94
|
+
krs_in_maps = set()
|
|
95
|
+
for i in summary_dict: krs_in_maps = krs_in_maps.union(i['kr_ids'])
|
|
96
|
+
krs_not_in_maps = idcollection_dict['kr'] - krs_in_maps
|
|
97
|
+
summary_dict.append({
|
|
98
|
+
'map_id': 'map?????',
|
|
99
|
+
'map_name': 'Not included in maps',
|
|
100
|
+
'kr_ids': krs_not_in_maps,
|
|
101
|
+
'cnt_r': len(krs_not_in_maps),
|
|
102
|
+
'mds': []
|
|
103
|
+
})
|
|
62
104
|
|
|
63
105
|
|
|
64
106
|
# get all the map / md codes:
|
|
@@ -112,52 +154,77 @@ def check_completeness(logger, model, progress, module, focus, eggnog, zeroes, i
|
|
|
112
154
|
missing_logger = (map_id, missing)
|
|
113
155
|
|
|
114
156
|
|
|
157
|
+
# put the map in the right bucket:
|
|
115
158
|
if missing == set() and map_krs != set():
|
|
116
159
|
maps_finished.add(map_id)
|
|
117
|
-
|
|
118
160
|
elif map_krs == set():
|
|
119
161
|
maps_noreac.add(map_id)
|
|
120
|
-
|
|
121
162
|
elif missing == map_krs:
|
|
122
163
|
maps_missing.add(map_id)
|
|
123
|
-
|
|
124
|
-
if zeroes:
|
|
125
|
-
list_coverage.append({
|
|
126
|
-
'map_id': map_id,
|
|
127
|
-
'map_name_short': map_name_short,
|
|
128
|
-
'perc_completeness': 0,
|
|
129
|
-
'perc_completeness_str': ' 0',
|
|
130
|
-
'present': present,
|
|
131
|
-
'missing': missing,
|
|
132
|
-
'md_ids': [j['md_id'] for j in i['mds']],
|
|
133
|
-
})
|
|
134
|
-
|
|
135
164
|
elif len(missing) < len(map_krs):
|
|
136
165
|
maps_partial.add(map_id)
|
|
137
166
|
|
|
138
|
-
# get '%' of completeness:
|
|
139
|
-
perc_completeness = len(present)/len(map_krs)*100
|
|
140
|
-
perc_completeness_str = str(round(perc_completeness)) # version to be printed
|
|
141
|
-
if len(perc_completeness_str)==1:
|
|
142
|
-
perc_completeness_str = ' ' + perc_completeness_str
|
|
143
|
-
|
|
144
|
-
list_coverage.append({
|
|
145
|
-
'map_id': map_id,
|
|
146
|
-
'map_name_short': map_name_short,
|
|
147
|
-
'perc_completeness': perc_completeness,
|
|
148
|
-
'perc_completeness_str': perc_completeness_str,
|
|
149
|
-
'present': present,
|
|
150
|
-
'missing': missing,
|
|
151
|
-
'md_ids': [j['md_id'] for j in i['mds']],
|
|
152
|
-
})
|
|
153
167
|
|
|
168
|
+
# get '%' of completeness:
|
|
169
|
+
if len(map_krs) != 0: perc_completeness = len(present)/len(map_krs)*100
|
|
170
|
+
else: perc_completeness = 100 # for maps_noreac
|
|
171
|
+
perc_completeness_str = str(round(perc_completeness)) # version to be printed
|
|
172
|
+
if len(perc_completeness_str)==1:
|
|
173
|
+
perc_completeness_str = ' ' + perc_completeness_str
|
|
174
|
+
|
|
154
175
|
|
|
155
|
-
|
|
176
|
+
# append map to list:
|
|
177
|
+
list_coverage.append({
|
|
178
|
+
'map_id': map_id,
|
|
179
|
+
'map_name_short': map_name_short,
|
|
180
|
+
'perc_completeness': perc_completeness,
|
|
181
|
+
'perc_completeness_str': perc_completeness_str,
|
|
182
|
+
'present': present,
|
|
183
|
+
'missing': missing,
|
|
184
|
+
'md_ids': [j['md_id'] for j in i['mds']],
|
|
185
|
+
})
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
# create coverage dataframe
|
|
190
|
+
if eggnog != '-' and len(eggnog) >= 2:
|
|
191
|
+
df_coverage = {}
|
|
192
|
+
for i in list_coverage:
|
|
193
|
+
for kr in i['present'].union(i['missing']):
|
|
194
|
+
if kr not in df_coverage.keys():
|
|
195
|
+
df_coverage[kr] = {'map_ids': set()}
|
|
196
|
+
df_coverage[kr]['map_ids'].add(i['map_id'])
|
|
197
|
+
df_coverage = pnd.DataFrame.from_records(df_coverage).T
|
|
198
|
+
df_coverage['modeled'] = False
|
|
199
|
+
for kr, row in df_coverage.iterrows():
|
|
200
|
+
if kr in kr_ids_modeled:
|
|
201
|
+
df_coverage.loc[kr, 'modeled'] = True
|
|
202
|
+
# build strain columns all at once
|
|
203
|
+
df_strains = [] # list of small DataFrames
|
|
204
|
+
for eggfile in eggnog:
|
|
205
|
+
strain = Path(eggfile).stem
|
|
206
|
+
eggset = parse_eggnog(model, eggfile, idcollection_dict)
|
|
207
|
+
col = df_coverage.index.to_series().isin(eggset).astype(int) # integer: 0 or 1
|
|
208
|
+
df_strains.append(col.rename(strain))
|
|
209
|
+
df_strains = pnd.concat(df_strains, axis=1)
|
|
210
|
+
# sort rows: upper rows are present in more strains
|
|
211
|
+
#df_strains = df_strains.loc[df_strains.sum(axis=1).sort_values(ascending=False).index] # commented: now in charge of figures.py
|
|
212
|
+
df_coverage = df_coverage.loc[df_strains.index]
|
|
213
|
+
df_coverage = pnd.concat([df_coverage, df_strains], axis=1)
|
|
214
|
+
# split in 2: modeled above, non-modeled below:
|
|
215
|
+
#df_coverage = pnd.concat([df_coverage[df_coverage['modeled']==True], df_coverage[df_coverage['modeled']==False]]) # commented: now in charge of figures.py
|
|
216
|
+
else: # not interesting in a super-long table without strains in column
|
|
217
|
+
df_coverage = None
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
# order list by '%' of completness and print if needed:
|
|
156
222
|
list_coverage = sorted(list_coverage, key=lambda x: x['perc_completeness'], reverse=True)
|
|
157
223
|
for i in list_coverage:
|
|
158
224
|
if progress:
|
|
159
225
|
if focus=='-' or focus in i['md_ids'] or focus==i['map_id']:
|
|
160
|
-
|
|
226
|
+
if i['map_id'] in maps_missing or i['map_id'] in maps_partial:
|
|
227
|
+
logger.info(f"{i['map_id']}: {i['map_name_short']} {i['perc_completeness_str']}% completed, {len(i['present'])} added, {len(i['missing'])} missing.")
|
|
161
228
|
|
|
162
229
|
|
|
163
230
|
# get the correspondent pathway element of the 'summary_dict'
|
|
@@ -199,50 +266,43 @@ def check_completeness(logger, model, progress, module, focus, eggnog, zeroes, i
|
|
|
199
266
|
missing_logger = (md_id, missing)
|
|
200
267
|
|
|
201
268
|
|
|
269
|
+
# put the map in the right bucket:
|
|
202
270
|
if missing == set() and md_krs != set():
|
|
203
271
|
mds_completed.add(md_id)
|
|
204
|
-
|
|
205
272
|
elif md_krs == set():
|
|
206
273
|
mds_noreac.add(md_id)
|
|
207
|
-
|
|
208
274
|
elif missing == md_krs:
|
|
209
275
|
mds_missing.add(md_id)
|
|
210
|
-
|
|
211
|
-
if zeroes:
|
|
212
|
-
list_coverage_md.append({
|
|
213
|
-
'md_id': md_id,
|
|
214
|
-
'md_name_short': md_name_short,
|
|
215
|
-
'perc_completeness': 0,
|
|
216
|
-
'perc_completeness_str': ' 0',
|
|
217
|
-
'present': present,
|
|
218
|
-
'missing': missing,
|
|
219
|
-
})
|
|
220
|
-
|
|
221
276
|
elif len(missing) < len(md_krs):
|
|
222
277
|
mds_partial.add(md_id)
|
|
223
278
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
279
|
+
|
|
280
|
+
# get '%' of completeness:
|
|
281
|
+
if len(md_krs) != 0: perc_completeness = len(present)/len(md_krs)*100
|
|
282
|
+
else: perc_completeness = 100 # for mds_noreac
|
|
283
|
+
perc_completeness_str = str(round(perc_completeness)) # version to be printed
|
|
284
|
+
if len(perc_completeness_str)==1:
|
|
285
|
+
perc_completeness_str = ' ' + perc_completeness_str
|
|
229
286
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
287
|
+
|
|
288
|
+
# append md to list:
|
|
289
|
+
list_coverage_md.append({
|
|
290
|
+
'md_id': md_id,
|
|
291
|
+
'md_name_short': md_name_short,
|
|
292
|
+
'perc_completeness': perc_completeness,
|
|
293
|
+
'perc_completeness_str': perc_completeness_str,
|
|
294
|
+
'present': present,
|
|
295
|
+
'missing': missing,
|
|
296
|
+
})
|
|
238
297
|
|
|
239
298
|
|
|
240
|
-
# order list by '%' of completness and print:
|
|
299
|
+
# order list by '%' of completness and print if needed:
|
|
241
300
|
list_coverage_md = sorted(list_coverage_md, key=lambda x: x['perc_completeness'], reverse=True)
|
|
242
301
|
for z in list_coverage_md:
|
|
243
302
|
if module:
|
|
244
303
|
if focus=='-' or focus==z['md_id']:
|
|
245
|
-
|
|
304
|
+
if z['md_id'] in mds_missing or z['md_id'] in mds_partial:
|
|
305
|
+
logger.info(f"{spacer}{z['md_id']}: {z['md_name_short']} {z['perc_completeness_str']}% completed, {len(z['present'])} added, {len(z['missing'])} missing.")
|
|
246
306
|
|
|
247
307
|
|
|
248
308
|
# print summary:
|
|
@@ -254,6 +314,6 @@ def check_completeness(logger, model, progress, module, focus, eggnog, zeroes, i
|
|
|
254
314
|
logger.info(f"Maps: finished {len(maps_finished)} - partial {len(maps_partial)} - missing {len(maps_missing)} - noreac {len(maps_noreac)}")
|
|
255
315
|
|
|
256
316
|
|
|
257
|
-
return
|
|
317
|
+
return df_coverage
|
|
258
318
|
|
|
259
319
|
|
gsrap/parsedb/introduce.py
CHANGED
|
@@ -143,6 +143,14 @@ def introduce_metabolites(logger, db, model, idcollection_dict, kegg_compound_to
|
|
|
143
143
|
m.annotation[ankey] = list(m.annotation[ankey])
|
|
144
144
|
|
|
145
145
|
|
|
146
|
+
# replace inchikey with manually-curated
|
|
147
|
+
if m.annotation['inchikey'] != [] and m.annotation['inchikey'] != [row['inchikey']]:
|
|
148
|
+
logger.debug(f"Metabolite '{pure_mid}': manual-curated inchikey ({[row['inchikey']]}) is diferent from the one derived from MNX ({m.annotation['inchikey']}).")
|
|
149
|
+
m.annotation['inchikey'] = [row['inchikey']] # force the manual-curated version
|
|
150
|
+
if m.annotation['inchikey'] == ['XXXXXXXXXXXXXX-XXXXXXXXXX-X']:
|
|
151
|
+
m.annotation['inchikey'] = []
|
|
152
|
+
|
|
153
|
+
|
|
146
154
|
# add SBO annotation
|
|
147
155
|
m.annotation['sbo'] = ['SBO:0000247'] # generic metabolite
|
|
148
156
|
|
gsrap/parsedb/parsedb.py
CHANGED
|
@@ -17,6 +17,7 @@ from ..commons import show_contributions
|
|
|
17
17
|
from ..commons import adjust_biomass_precursors
|
|
18
18
|
from ..commons import count_undrawn_rids
|
|
19
19
|
from ..commons import format_expansion
|
|
20
|
+
from ..commons import download_keggorg
|
|
20
21
|
|
|
21
22
|
from .introduce import introduce_metabolites
|
|
22
23
|
from .introduce import introduce_reactions
|
|
@@ -72,7 +73,14 @@ def main(args, logger):
|
|
|
72
73
|
|
|
73
74
|
|
|
74
75
|
# format the --eggnog param
|
|
75
|
-
args.eggnog = format_expansion(logger, args.eggnog)
|
|
76
|
+
args.eggnog = format_expansion(logger, args.eggnog) # now 'args.eggnog' could still be '-'
|
|
77
|
+
|
|
78
|
+
# get the kegg organism if requested
|
|
79
|
+
if args.keggorg != '-':
|
|
80
|
+
response = download_keggorg(logger, args.keggorg, args.outdir)
|
|
81
|
+
if response == 1: return 1
|
|
82
|
+
|
|
83
|
+
|
|
76
84
|
|
|
77
85
|
|
|
78
86
|
# check and extract the required 'gsrap.maps' file
|
|
@@ -153,9 +161,8 @@ def main(args, logger):
|
|
|
153
161
|
|
|
154
162
|
###### CHECKS 1
|
|
155
163
|
# check universe completness
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
if response==1: return 1
|
|
164
|
+
df_C = check_completeness(logger, universe, args.progress, args.module, args.focus, args.eggnog, args.keggorg, idcollection_dict, summary_dict, args.outdir)
|
|
165
|
+
if type(df_C)==int: return 1
|
|
159
166
|
|
|
160
167
|
|
|
161
168
|
|
|
@@ -194,7 +201,7 @@ def main(args, logger):
|
|
|
194
201
|
cobra.io.write_sbml_model(universe, f'{args.outdir}/universe.xml') # groups are saved only to SBML
|
|
195
202
|
logger.info(f"'{args.outdir}/universe.xml' created!")
|
|
196
203
|
force_id_on_sbml(f'{args.outdir}/universe.xml', 'universe') # force introduction of the 'id=""' field
|
|
197
|
-
sheets_dict = write_excel_model(universe, f'{args.outdir}/universe.parsedb.xlsx', df_E, None, None, df_S)
|
|
204
|
+
sheets_dict = write_excel_model(universe, f'{args.outdir}/universe.parsedb.xlsx', args.nofigs, df_E, None, None, df_S, df_C)
|
|
198
205
|
logger.info(f"'{args.outdir}/universe.parsedb.xlsx' created!")
|
|
199
206
|
|
|
200
207
|
|
|
@@ -57,9 +57,9 @@ def grow_on_media(logger, model, dbexp, media, fva, universe_in_parsedb=False):
|
|
|
57
57
|
df_G.loc[obj_id, f'{medium}'] = res_fba
|
|
58
58
|
if universe_in_parsedb:
|
|
59
59
|
if res_fba == 'infeasible' or res_fba == 0.0:
|
|
60
|
-
logger.warning(f"Growth on '{medium}': {res_fba}.")
|
|
60
|
+
logger.warning(f"Growth on medium '{medium}': {res_fba}.")
|
|
61
61
|
else:
|
|
62
|
-
logger.info(f"Growth on '{medium}': {res_fba}.")
|
|
62
|
+
logger.info(f"Growth on medium '{medium}': {res_fba}.")
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
# perform FVA if requested:
|
gsrap/runsims/simplegrowth.py
CHANGED
|
@@ -57,9 +57,9 @@ def grow_on_media(logger, model, dbexp, media, fva, universe_in_parsedb=False):
|
|
|
57
57
|
df_G.loc[obj_id, f'{medium}'] = res_fba
|
|
58
58
|
if universe_in_parsedb:
|
|
59
59
|
if res_fba == 'infeasible' or res_fba == 0.0:
|
|
60
|
-
logger.warning(f"Growth on '{medium}': {res_fba}.")
|
|
60
|
+
logger.warning(f"Growth on medium '{medium}': {res_fba}.")
|
|
61
61
|
else:
|
|
62
|
-
logger.info(f"Growth on '{medium}': {res_fba}.")
|
|
62
|
+
logger.info(f"Growth on medium '{medium}': {res_fba}.")
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
# perform FVA if requested:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: gsrap
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0
|
|
4
4
|
Summary:
|
|
5
5
|
License: GNU General Public License v3.0
|
|
6
6
|
Author: Gioele Lazzari
|
|
@@ -17,9 +17,11 @@ Requires-Dist: cobra (>=0.29)
|
|
|
17
17
|
Requires-Dist: colorlog (>=6.9.0)
|
|
18
18
|
Requires-Dist: gdown (>=5.2.0)
|
|
19
19
|
Requires-Dist: gempipe (>=1.38.1)
|
|
20
|
+
Requires-Dist: matplotlib (>=3.9.0)
|
|
20
21
|
Requires-Dist: memote (>=0.17.0)
|
|
21
22
|
Requires-Dist: openpyxl (>=3.1.0)
|
|
22
23
|
Requires-Dist: pandas (>=2.0.0)
|
|
24
|
+
Requires-Dist: xlsxwriter (>=3.1.0)
|
|
23
25
|
Description-Content-Type: text/markdown
|
|
24
26
|
|
|
25
27
|
Source code for `gsrap`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
gsrap/.ipynb_checkpoints/__init__-checkpoint.py,sha256=
|
|
2
|
-
gsrap/__init__.py,sha256=
|
|
1
|
+
gsrap/.ipynb_checkpoints/__init__-checkpoint.py,sha256=JlR5ICkhkJwQrMHJOFOZg1R-0aYQAZu9h51SlC67Mtw,14064
|
|
2
|
+
gsrap/__init__.py,sha256=JlR5ICkhkJwQrMHJOFOZg1R-0aYQAZu9h51SlC67Mtw,14064
|
|
3
3
|
gsrap/assets/.ipynb_checkpoints/PM1-checkpoint.csv,sha256=0qjaMVG_t9aFxbHbxON6ecmEUnWPwN9nhmxc61QFeCU,8761
|
|
4
4
|
gsrap/assets/.ipynb_checkpoints/PM2A-checkpoint.csv,sha256=rjYTdwe8lpRS552BYiUP3J71juG2ywVdR5Sux6fjZTY,8816
|
|
5
5
|
gsrap/assets/.ipynb_checkpoints/PM3B-checkpoint.csv,sha256=42IGX_2O5bRYSiHoMuVKT-T-bzVj0cSRZBvGOrbnQMA,8130
|
|
@@ -11,24 +11,28 @@ gsrap/assets/PM4A.csv,sha256=f_5__0Ap_T0KYje5h9veW29I2qB4yU0h7Hr7WpaHjSc,9081
|
|
|
11
11
|
gsrap/assets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
gsrap/assets/kegg_compound_to_others.pickle,sha256=pz1897cfQ7PLsYZiBVcoMQPzvRzT-nHUdgphBe0g5ZQ,8233860
|
|
13
13
|
gsrap/assets/kegg_reaction_to_others.pickle,sha256=AGW8CGN5hKeXZoYn3JRF4Xu832WyNrTlMcLw7luttlc,1703146
|
|
14
|
-
gsrap/commons/.ipynb_checkpoints/__init__-checkpoint.py,sha256=
|
|
14
|
+
gsrap/commons/.ipynb_checkpoints/__init__-checkpoint.py,sha256=QuHINLSWNb0XKagHRWXzU5UVxw3ECTncvR7llRKblso,241
|
|
15
15
|
gsrap/commons/.ipynb_checkpoints/biomass-checkpoint.py,sha256=4u7WBaUgo42tBoXDU1D0VUjICatb44e0jfswZrBeHYs,17987
|
|
16
16
|
gsrap/commons/.ipynb_checkpoints/coeffs-checkpoint.py,sha256=qI3_GuqHkeA2KbK9pYdkqJaFwYemAVZJGLRR4QtHt6w,19182
|
|
17
|
-
gsrap/commons/.ipynb_checkpoints/downloads-checkpoint.py,sha256=
|
|
18
|
-
gsrap/commons/.ipynb_checkpoints/escherutils-checkpoint.py,sha256=
|
|
19
|
-
gsrap/commons/.ipynb_checkpoints/excelhub-checkpoint.py,sha256=
|
|
17
|
+
gsrap/commons/.ipynb_checkpoints/downloads-checkpoint.py,sha256=e-7ffMD4R07MWEgXyGcwjhScbWnG7A3L100YWbpNMk0,8461
|
|
18
|
+
gsrap/commons/.ipynb_checkpoints/escherutils-checkpoint.py,sha256=_y0TgM0-Im0RT8W8z5rr4vlnGK55iRFds6DlDsjGD-8,1151
|
|
19
|
+
gsrap/commons/.ipynb_checkpoints/excelhub-checkpoint.py,sha256=zFTR6H7I3XeAt9_ORL0dfrwMRvshU3JPRmGif7fSY7w,7971
|
|
20
|
+
gsrap/commons/.ipynb_checkpoints/figures-checkpoint.py,sha256=IRHSQXrCi4SQoISEfNB0rDhvUzbjcgsPi9zUSefsRto,4316
|
|
20
21
|
gsrap/commons/.ipynb_checkpoints/fluxbal-checkpoint.py,sha256=jgC3-vI9Tbjvqohh2mJwFra4rl_pbUzHWrSa_QAxVO4,1262
|
|
22
|
+
gsrap/commons/.ipynb_checkpoints/keggutils-checkpoint.py,sha256=M2nhHRiNH_xObHSxOIdt7ix59MrPdl9q3HNICC8X36M,4514
|
|
21
23
|
gsrap/commons/.ipynb_checkpoints/logutils-checkpoint.py,sha256=VsnrkIsUftS3MOOwAd0n0peQ7a2X5ZEx930eCtzmW7g,1317
|
|
22
24
|
gsrap/commons/.ipynb_checkpoints/medium-checkpoint.py,sha256=VYKN8X1PNERP6uQDbznZXfgflLEvnw4j1T8AIAdrE7s,2902
|
|
23
25
|
gsrap/commons/.ipynb_checkpoints/metrics-checkpoint.py,sha256=gvqF2c0e31m5qQWQ11JF4-eMqxtuONy_7lUiC7uaXX4,3291
|
|
24
26
|
gsrap/commons/.ipynb_checkpoints/sbmlutils-checkpoint.py,sha256=gkY02qbGXrbYStn2F8J0KM0fmqati2Nbvi128EF7coI,365
|
|
25
|
-
gsrap/commons/__init__.py,sha256=
|
|
27
|
+
gsrap/commons/__init__.py,sha256=QuHINLSWNb0XKagHRWXzU5UVxw3ECTncvR7llRKblso,241
|
|
26
28
|
gsrap/commons/biomass.py,sha256=4u7WBaUgo42tBoXDU1D0VUjICatb44e0jfswZrBeHYs,17987
|
|
27
29
|
gsrap/commons/coeffs.py,sha256=qI3_GuqHkeA2KbK9pYdkqJaFwYemAVZJGLRR4QtHt6w,19182
|
|
28
|
-
gsrap/commons/downloads.py,sha256=
|
|
29
|
-
gsrap/commons/escherutils.py,sha256=
|
|
30
|
-
gsrap/commons/excelhub.py,sha256=
|
|
30
|
+
gsrap/commons/downloads.py,sha256=e-7ffMD4R07MWEgXyGcwjhScbWnG7A3L100YWbpNMk0,8461
|
|
31
|
+
gsrap/commons/escherutils.py,sha256=_y0TgM0-Im0RT8W8z5rr4vlnGK55iRFds6DlDsjGD-8,1151
|
|
32
|
+
gsrap/commons/excelhub.py,sha256=zFTR6H7I3XeAt9_ORL0dfrwMRvshU3JPRmGif7fSY7w,7971
|
|
33
|
+
gsrap/commons/figures.py,sha256=IRHSQXrCi4SQoISEfNB0rDhvUzbjcgsPi9zUSefsRto,4316
|
|
31
34
|
gsrap/commons/fluxbal.py,sha256=jgC3-vI9Tbjvqohh2mJwFra4rl_pbUzHWrSa_QAxVO4,1262
|
|
35
|
+
gsrap/commons/keggutils.py,sha256=M2nhHRiNH_xObHSxOIdt7ix59MrPdl9q3HNICC8X36M,4514
|
|
32
36
|
gsrap/commons/logutils.py,sha256=VsnrkIsUftS3MOOwAd0n0peQ7a2X5ZEx930eCtzmW7g,1317
|
|
33
37
|
gsrap/commons/medium.py,sha256=VYKN8X1PNERP6uQDbznZXfgflLEvnw4j1T8AIAdrE7s,2902
|
|
34
38
|
gsrap/commons/metrics.py,sha256=gvqF2c0e31m5qQWQ11JF4-eMqxtuONy_7lUiC7uaXX4,3291
|
|
@@ -43,29 +47,29 @@ gsrap/mkmodel/.ipynb_checkpoints/__init__-checkpoint.py,sha256=PNze-26HMOwfdJ92K
|
|
|
43
47
|
gsrap/mkmodel/.ipynb_checkpoints/biologcuration-checkpoint.py,sha256=Nn7z-js-mzzeO23kVM2L7sJ5PNle7AkCUeBcEAYjlFU,15378
|
|
44
48
|
gsrap/mkmodel/.ipynb_checkpoints/gapfill-checkpoint.py,sha256=BPZw4sszlBhAYfHnV0pA7EpG0b2ePwS6kUfFt0Ww-ss,5159
|
|
45
49
|
gsrap/mkmodel/.ipynb_checkpoints/gapfillutils-checkpoint.py,sha256=S6nFUZ1Bbdf13nVJhGK2S5C_V3hd5zwTg2o5nzejngg,3123
|
|
46
|
-
gsrap/mkmodel/.ipynb_checkpoints/mkmodel-checkpoint.py,sha256=
|
|
50
|
+
gsrap/mkmodel/.ipynb_checkpoints/mkmodel-checkpoint.py,sha256=0ekGXmNULzVbkl6QW_Z8xDrHlevgtVDWEURJJR2uQRM,10323
|
|
47
51
|
gsrap/mkmodel/.ipynb_checkpoints/polishing-checkpoint.py,sha256=R1UdFPxN8N27Iu0jsYW2N_1BkWEbBHaMYW6NkCYZK_k,3256
|
|
48
|
-
gsrap/mkmodel/.ipynb_checkpoints/pruner-checkpoint.py,sha256=
|
|
52
|
+
gsrap/mkmodel/.ipynb_checkpoints/pruner-checkpoint.py,sha256=FAZid-0H6j66wR2dVKRAaMaDREVt1edflmZXbX7blXg,9836
|
|
49
53
|
gsrap/mkmodel/__init__.py,sha256=PNze-26HMOwfdJ92KiXpr--VV1ftVfo3CAxBZgeokp8,92
|
|
50
54
|
gsrap/mkmodel/biologcuration.py,sha256=Nn7z-js-mzzeO23kVM2L7sJ5PNle7AkCUeBcEAYjlFU,15378
|
|
51
55
|
gsrap/mkmodel/gapfill.py,sha256=BPZw4sszlBhAYfHnV0pA7EpG0b2ePwS6kUfFt0Ww-ss,5159
|
|
52
56
|
gsrap/mkmodel/gapfillutils.py,sha256=S6nFUZ1Bbdf13nVJhGK2S5C_V3hd5zwTg2o5nzejngg,3123
|
|
53
|
-
gsrap/mkmodel/mkmodel.py,sha256=
|
|
57
|
+
gsrap/mkmodel/mkmodel.py,sha256=0ekGXmNULzVbkl6QW_Z8xDrHlevgtVDWEURJJR2uQRM,10323
|
|
54
58
|
gsrap/mkmodel/polishing.py,sha256=R1UdFPxN8N27Iu0jsYW2N_1BkWEbBHaMYW6NkCYZK_k,3256
|
|
55
|
-
gsrap/mkmodel/pruner.py,sha256=
|
|
59
|
+
gsrap/mkmodel/pruner.py,sha256=FAZid-0H6j66wR2dVKRAaMaDREVt1edflmZXbX7blXg,9836
|
|
56
60
|
gsrap/parsedb/.ipynb_checkpoints/__init__-checkpoint.py,sha256=1k2K1gz4lIdXAwHEdJ0OhdkPu83woGv0Z4TpT1kGrTk,97
|
|
57
61
|
gsrap/parsedb/.ipynb_checkpoints/annotation-checkpoint.py,sha256=Y02_zXJj_tS1GyBdfuLBy9YJjMgx3mjX6tqr1KhQ-9Q,4810
|
|
58
|
-
gsrap/parsedb/.ipynb_checkpoints/completeness-checkpoint.py,sha256=
|
|
59
|
-
gsrap/parsedb/.ipynb_checkpoints/introduce-checkpoint.py,sha256=
|
|
62
|
+
gsrap/parsedb/.ipynb_checkpoints/completeness-checkpoint.py,sha256=yhFiEslK1qmMCk_GWZ7UZtX02FUqLU39UafG5886WsY,12016
|
|
63
|
+
gsrap/parsedb/.ipynb_checkpoints/introduce-checkpoint.py,sha256=TpW-Hp_rq6AGUQ-IVFwU8Vhij6poKWz8EF-NhdsAOsI,17414
|
|
60
64
|
gsrap/parsedb/.ipynb_checkpoints/manual-checkpoint.py,sha256=F16wU8vLyM6V4F611ABuMJtwSAskL5KEgCJ7EQm_F9Y,2177
|
|
61
|
-
gsrap/parsedb/.ipynb_checkpoints/parsedb-checkpoint.py,sha256=
|
|
65
|
+
gsrap/parsedb/.ipynb_checkpoints/parsedb-checkpoint.py,sha256=OPc8PrTVD2szrmvZISlyhP1Q51AlaoQ_EghAJs4jfFU,7465
|
|
62
66
|
gsrap/parsedb/.ipynb_checkpoints/repeating-checkpoint.py,sha256=9PgsSw-H84eN_dFUwK5FLgbqvydsdic4-VjCrZqkfnY,5703
|
|
63
67
|
gsrap/parsedb/__init__.py,sha256=1k2K1gz4lIdXAwHEdJ0OhdkPu83woGv0Z4TpT1kGrTk,97
|
|
64
68
|
gsrap/parsedb/annotation.py,sha256=Y02_zXJj_tS1GyBdfuLBy9YJjMgx3mjX6tqr1KhQ-9Q,4810
|
|
65
|
-
gsrap/parsedb/completeness.py,sha256=
|
|
66
|
-
gsrap/parsedb/introduce.py,sha256=
|
|
69
|
+
gsrap/parsedb/completeness.py,sha256=yhFiEslK1qmMCk_GWZ7UZtX02FUqLU39UafG5886WsY,12016
|
|
70
|
+
gsrap/parsedb/introduce.py,sha256=TpW-Hp_rq6AGUQ-IVFwU8Vhij6poKWz8EF-NhdsAOsI,17414
|
|
67
71
|
gsrap/parsedb/manual.py,sha256=F16wU8vLyM6V4F611ABuMJtwSAskL5KEgCJ7EQm_F9Y,2177
|
|
68
|
-
gsrap/parsedb/parsedb.py,sha256=
|
|
72
|
+
gsrap/parsedb/parsedb.py,sha256=OPc8PrTVD2szrmvZISlyhP1Q51AlaoQ_EghAJs4jfFU,7465
|
|
69
73
|
gsrap/parsedb/repeating.py,sha256=9PgsSw-H84eN_dFUwK5FLgbqvydsdic4-VjCrZqkfnY,5703
|
|
70
74
|
gsrap/runsims/.ipynb_checkpoints/__init__-checkpoint.py,sha256=6E6E1gWgH0V7ls4Omx4mxxC85gMJ_27YqhjugJzlZtY,97
|
|
71
75
|
gsrap/runsims/.ipynb_checkpoints/biosynth-checkpoint.py,sha256=fUlHUo4CfB4rGX9Dth87B1p5E5sz7i6spR7ZoqDDGaI,2836
|
|
@@ -74,7 +78,7 @@ gsrap/runsims/.ipynb_checkpoints/essentialgenes-checkpoint.py,sha256=MzHiuaU1gwi
|
|
|
74
78
|
gsrap/runsims/.ipynb_checkpoints/growthfactors-checkpoint.py,sha256=r_W4idtOSJBDh7HURRsU8s1TqfOZ3TfeVw2HHDxmnGU,2265
|
|
75
79
|
gsrap/runsims/.ipynb_checkpoints/precursors-checkpoint.py,sha256=1RNt_Rxs0L1lolDmYh4_CiZgiwHfU5B_AcomJO6vJ28,2219
|
|
76
80
|
gsrap/runsims/.ipynb_checkpoints/runsims-checkpoint.py,sha256=2FC5Gs8oSYyZTjHF3A7aXB_O6myVfcn3bCxQfLJlZTk,2842
|
|
77
|
-
gsrap/runsims/.ipynb_checkpoints/simplegrowth-checkpoint.py,sha256=
|
|
81
|
+
gsrap/runsims/.ipynb_checkpoints/simplegrowth-checkpoint.py,sha256=tCQHTMUqum1YwlBKRTNaQoag2co_yQlCaKmISOARAlE,2353
|
|
78
82
|
gsrap/runsims/.ipynb_checkpoints/singleomission-checkpoint.py,sha256=jMuKAi0pINP8Jlrm-yI-tX7D110VzttR3YfTSnDRe4I,2847
|
|
79
83
|
gsrap/runsims/__init__.py,sha256=6E6E1gWgH0V7ls4Omx4mxxC85gMJ_27YqhjugJzlZtY,97
|
|
80
84
|
gsrap/runsims/biosynth.py,sha256=fUlHUo4CfB4rGX9Dth87B1p5E5sz7i6spR7ZoqDDGaI,2836
|
|
@@ -83,10 +87,10 @@ gsrap/runsims/essentialgenes.py,sha256=MzHiuaU1gwiPdjZAgG7tkdYzkTTvoNCLp5tkezZhz
|
|
|
83
87
|
gsrap/runsims/growthfactors.py,sha256=r_W4idtOSJBDh7HURRsU8s1TqfOZ3TfeVw2HHDxmnGU,2265
|
|
84
88
|
gsrap/runsims/precursors.py,sha256=1RNt_Rxs0L1lolDmYh4_CiZgiwHfU5B_AcomJO6vJ28,2219
|
|
85
89
|
gsrap/runsims/runsims.py,sha256=2FC5Gs8oSYyZTjHF3A7aXB_O6myVfcn3bCxQfLJlZTk,2842
|
|
86
|
-
gsrap/runsims/simplegrowth.py,sha256=
|
|
90
|
+
gsrap/runsims/simplegrowth.py,sha256=tCQHTMUqum1YwlBKRTNaQoag2co_yQlCaKmISOARAlE,2353
|
|
87
91
|
gsrap/runsims/singleomission.py,sha256=jMuKAi0pINP8Jlrm-yI-tX7D110VzttR3YfTSnDRe4I,2847
|
|
88
|
-
gsrap-0.
|
|
89
|
-
gsrap-0.
|
|
90
|
-
gsrap-0.
|
|
91
|
-
gsrap-0.
|
|
92
|
-
gsrap-0.
|
|
92
|
+
gsrap-0.8.0.dist-info/LICENSE.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
93
|
+
gsrap-0.8.0.dist-info/METADATA,sha256=T5COI9B29df6TdmUbZvFrQsficCTN3SVzJGHJ5yw4Us,898
|
|
94
|
+
gsrap-0.8.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
95
|
+
gsrap-0.8.0.dist-info/entry_points.txt,sha256=S9MY0DjfnbKGlZbp5bV7W6dNFy3APoEV84u9x6MV1eI,36
|
|
96
|
+
gsrap-0.8.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|