debase 0.4.1__py3-none-any.whl → 0.4.2__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.
- debase/_version.py +1 -1
- debase/enzyme_lineage_extractor.py +14 -8
- debase/lineage_format.py +335 -56
- debase/reaction_info_extractor.py +60 -32
- debase/substrate_scope_extractor.py +366 -93
- debase/wrapper.py +37 -11
- {debase-0.4.1.dist-info → debase-0.4.2.dist-info}/METADATA +1 -1
- debase-0.4.2.dist-info/RECORD +16 -0
- debase-0.4.1.dist-info/RECORD +0 -16
- {debase-0.4.1.dist-info → debase-0.4.2.dist-info}/WHEEL +0 -0
- {debase-0.4.1.dist-info → debase-0.4.2.dist-info}/entry_points.txt +0 -0
- {debase-0.4.1.dist-info → debase-0.4.2.dist-info}/licenses/LICENSE +0 -0
- {debase-0.4.1.dist-info → debase-0.4.2.dist-info}/top_level.txt +0 -0
debase/wrapper.py
CHANGED
@@ -120,25 +120,36 @@ def run_sequence_cleanup(input_csv: Path, output_csv: Path) -> Path:
|
|
120
120
|
def run_reaction_extraction(manuscript: Path, si: Path, lineage_csv: Path, output: Path, debug_dir: Path = None) -> Path:
|
121
121
|
"""
|
122
122
|
Step 3a: Extract reaction performance metrics
|
123
|
-
Calls: reaction_info_extractor.py
|
123
|
+
Calls: reaction_info_extractor.py main function to get full functionality including campaign CSV saving
|
124
124
|
Returns output path even if extraction fails (creates empty file)
|
125
125
|
"""
|
126
126
|
logger.info(f"Extracting reaction info for enzymes in {lineage_csv.name}")
|
127
127
|
|
128
128
|
try:
|
129
|
-
|
130
|
-
|
129
|
+
import sys
|
130
|
+
|
131
|
+
# Call reaction_info_extractor.main() directly in same process for token tracking
|
132
|
+
old_argv = sys.argv
|
133
|
+
sys.argv = [
|
134
|
+
"reaction_info_extractor",
|
135
|
+
"--manuscript", str(manuscript),
|
136
|
+
"--lineage-csv", str(lineage_csv),
|
137
|
+
"--output", str(output)
|
138
|
+
]
|
139
|
+
|
140
|
+
# Add optional arguments
|
141
|
+
if si:
|
142
|
+
sys.argv.extend(["--si", str(si)])
|
143
|
+
if debug_dir:
|
144
|
+
sys.argv.extend(["--debug-dir", str(debug_dir)])
|
131
145
|
|
132
|
-
#
|
133
|
-
|
146
|
+
# Import and call main() directly
|
147
|
+
from .reaction_info_extractor import main
|
148
|
+
main()
|
134
149
|
|
135
|
-
#
|
136
|
-
|
137
|
-
extractor = ReactionExtractor(manuscript, si, cfg, debug_dir=debug_dir)
|
138
|
-
df_metrics = extractor.run(enzyme_df)
|
150
|
+
# Restore original argv
|
151
|
+
sys.argv = old_argv
|
139
152
|
|
140
|
-
# Save results
|
141
|
-
df_metrics.to_csv(output, index=False)
|
142
153
|
logger.info(f"Reaction extraction complete: {output}")
|
143
154
|
return output
|
144
155
|
|
@@ -156,6 +167,21 @@ def run_reaction_extraction(manuscript: Path, si: Path, lineage_csv: Path, outpu
|
|
156
167
|
|
157
168
|
logger.info(f"Empty reaction file created: {output}")
|
158
169
|
return output
|
170
|
+
|
171
|
+
except Exception as e:
|
172
|
+
logger.warning(f"Reaction extraction failed: {e}")
|
173
|
+
logger.info("Creating empty reaction info file to continue pipeline...")
|
174
|
+
|
175
|
+
# Create empty reaction CSV with basic columns
|
176
|
+
import pandas as pd
|
177
|
+
empty_df = pd.DataFrame(columns=[
|
178
|
+
'enzyme', 'substrate', 'product', 'yield_percent', 'ee_percent',
|
179
|
+
'conversion_percent', 'reaction_type', 'reaction_conditions', 'notes'
|
180
|
+
])
|
181
|
+
empty_df.to_csv(output, index=False)
|
182
|
+
|
183
|
+
logger.info(f"Empty reaction file created: {output}")
|
184
|
+
return output
|
159
185
|
|
160
186
|
|
161
187
|
def run_substrate_scope_extraction(manuscript: Path, si: Path, lineage_csv: Path, output: Path, debug_dir: Path = None) -> Path:
|
@@ -0,0 +1,16 @@
|
|
1
|
+
debase/__init__.py,sha256=YeKveGj_8fwuu5ozoK2mUU86so_FjiCwsvg1d_lYVZU,586
|
2
|
+
debase/__main__.py,sha256=LbxYt2x9TG5Ced7LpzzX_8gkWyXeZSlVHzqHfqAiPwQ,160
|
3
|
+
debase/_version.py,sha256=WDlHvBix-yPlJxEgBTyb1Z8IXZmUbhOOQSbpA2mamvU,49
|
4
|
+
debase/build_db.py,sha256=bW574GxsL1BJtDwM19urLbciPcejLzfraXZPpzm09FQ,7167
|
5
|
+
debase/cleanup_sequence.py,sha256=ngxb_tPekjCWvampAjyuFqK4wLk_meFSj_TwfvOxheQ,33978
|
6
|
+
debase/enzyme_lineage_extractor.py,sha256=Gcb-AzmAs5uTR65ncQ83Ds2JrK3cuzrPyS70OyLniMo,124278
|
7
|
+
debase/lineage_format.py,sha256=Q6kpqKPUxJsMYpb0Yt8IbVlp6VDYX2vkITuGhT9MEbw,47056
|
8
|
+
debase/reaction_info_extractor.py,sha256=q-iHgfVLXP4r2Se8yA9I0AvtnAhHBltTztrXspl3EKU,151949
|
9
|
+
debase/substrate_scope_extractor.py,sha256=eaVimhxmmaRj-9dRN6RKK4yStCmZAuX8xBaarsIsmUo,114212
|
10
|
+
debase/wrapper.py,sha256=r0xxoiBvmMIktiGPOD4w9hne8m0SLzZ03WeWnBuDW0A,25236
|
11
|
+
debase-0.4.2.dist-info/licenses/LICENSE,sha256=5sk9_tcNmr1r2iMIUAiioBo7wo38u8BrPlO7f0seqgE,1075
|
12
|
+
debase-0.4.2.dist-info/METADATA,sha256=__XUoQUlZPLGT3TXgb6EBfuUdJ07-g5gBQBOiEiGXLA,10789
|
13
|
+
debase-0.4.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
14
|
+
debase-0.4.2.dist-info/entry_points.txt,sha256=hUcxA1b4xORu-HHBFTe9u2KTdbxPzt0dwz95_6JNe9M,48
|
15
|
+
debase-0.4.2.dist-info/top_level.txt,sha256=2BUeq-4kmQr0Rhl06AnRzmmZNs8WzBRK9OcJehkcdk8,7
|
16
|
+
debase-0.4.2.dist-info/RECORD,,
|
debase-0.4.1.dist-info/RECORD
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
debase/__init__.py,sha256=YeKveGj_8fwuu5ozoK2mUU86so_FjiCwsvg1d_lYVZU,586
|
2
|
-
debase/__main__.py,sha256=LbxYt2x9TG5Ced7LpzzX_8gkWyXeZSlVHzqHfqAiPwQ,160
|
3
|
-
debase/_version.py,sha256=qJBDmAhFTv4pYwvc3Umy_Lwc_v8doVBVCiysT7Eoh3E,49
|
4
|
-
debase/build_db.py,sha256=bW574GxsL1BJtDwM19urLbciPcejLzfraXZPpzm09FQ,7167
|
5
|
-
debase/cleanup_sequence.py,sha256=ngxb_tPekjCWvampAjyuFqK4wLk_meFSj_TwfvOxheQ,33978
|
6
|
-
debase/enzyme_lineage_extractor.py,sha256=laIw9A5AuJ_kJe9h6Fp_WzMh_ctCN31bo2b2-RKrFd4,124019
|
7
|
-
debase/lineage_format.py,sha256=IS9ig-Uv7KxtI9enZKM6YgQ7sitqwOo4cdXbOy38J3s,34232
|
8
|
-
debase/reaction_info_extractor.py,sha256=xRyYoQKqSzer-k8FZwg55nDd0D-6QBc0F-HAyfvisG0,150368
|
9
|
-
debase/substrate_scope_extractor.py,sha256=JLXHEEeMDFiFQRt8gVCnnhimrxDF23-z0jq3N4-3gn8,101469
|
10
|
-
debase/wrapper.py,sha256=TGU5eq0qWTrkRR35ztsp8WMb1E9Nt64BdbHuYHROmYA,24279
|
11
|
-
debase-0.4.1.dist-info/licenses/LICENSE,sha256=5sk9_tcNmr1r2iMIUAiioBo7wo38u8BrPlO7f0seqgE,1075
|
12
|
-
debase-0.4.1.dist-info/METADATA,sha256=kSH58QfBv6WGb8Ds3mcei-DUmWQormuSyPHNOmpbcQ8,10789
|
13
|
-
debase-0.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
14
|
-
debase-0.4.1.dist-info/entry_points.txt,sha256=hUcxA1b4xORu-HHBFTe9u2KTdbxPzt0dwz95_6JNe9M,48
|
15
|
-
debase-0.4.1.dist-info/top_level.txt,sha256=2BUeq-4kmQr0Rhl06AnRzmmZNs8WzBRK9OcJehkcdk8,7
|
16
|
-
debase-0.4.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|