Skip to content

Commit 025e656

Browse files
committed
Create optional dependencies
1 parent c4a89f2 commit 025e656

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

im2deep/__main__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ def setup_logging(passed_level):
5151
)
5252

5353

54+
def check_optional_dependencies():
55+
try:
56+
import torch
57+
import im2deeptrainer
58+
except ImportError:
59+
LOGGER.error(
60+
"In order to run multiconformational precursor CCS predictions, IM2Deep requires the installation of 'torch' and 'im2deeptrainer'.\nPlease re-install IM2Deep with the optional dependencies by running 'pip install 'im2deep[er]'."
61+
)
62+
sys.exit(1)
63+
64+
5465
# Command line arguments TODO: Make config_parser script
5566
@click.command()
5667
@click.argument("psm-file", type=click.Path(exists=True, dir_okay=False))
@@ -159,7 +170,6 @@ def main(
159170
psm_list_pred = PSMList(psm_list=list_of_psms)
160171

161172
else:
162-
# psm_list_pred = read_file(file_pred)
163173
try:
164174
psm_list_pred = read_file(psm_file)
165175
except PSMUtilsIOException:

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies = [
2424
"psm_utils",
2525
"pandas",
2626
"numpy",
27-
"rich"
27+
"rich",
2828
]
2929

3030
[project.optional-dependencies]
@@ -39,6 +39,9 @@ docs = [
3939
"sphinx_rtd_theme",
4040
"sphinx-autobuild",
4141
]
42+
er = [
43+
"im2deeptrainer",
44+
"torch==2.3.0"]
4245

4346
[project.urls]
4447
GitHub = "https://github.com/CompOmics/IM2Deep"

0 commit comments

Comments
 (0)