Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SENSE-PPI
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Konstantin Volzhenin
SENSE-PPI
Commits
aa239099
Commit
aa239099
authored
Sep 12, 2023
by
Konstantin Volzhenin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0.5.0 senseppi.ckpt added to the package as a default model
parent
6f5330e5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
11 deletions
+14
-11
__init__.py
senseppi/__init__.py
+1
-1
predict.py
senseppi/commands/predict.py
+3
-2
predict_string.py
senseppi/commands/predict_string.py
+3
-2
test.py
senseppi/commands/test.py
+7
-6
senseppi.ckpt
senseppi/senseppi.ckpt
+0
-0
No files found.
senseppi/__init__.py
View file @
aa239099
__version__
=
"0.
4.1
"
__version__
=
"0.
5.0
"
__author__
=
"Konstantin Volzhenin"
__author__
=
"Konstantin Volzhenin"
from
.
import
model
,
commands
,
esm2_model
,
dataset
,
utils
,
network_utils
from
.
import
model
,
commands
,
esm2_model
,
dataset
,
utils
,
network_utils
...
...
senseppi/commands/predict.py
View file @
aa239099
...
@@ -65,11 +65,12 @@ def add_args(parser):
...
@@ -65,11 +65,12 @@ def add_args(parser):
parser
=
add_general_args
(
parser
)
parser
=
add_general_args
(
parser
)
predict_args
=
parser
.
add_argument_group
(
title
=
"Predict args"
)
predict_args
=
parser
.
add_argument_group
(
title
=
"Predict args"
)
parser
.
_action_groups
[
0
]
.
add_argument
(
"model_path"
,
type
=
str
,
help
=
"A path to .ckpt file that contains weights to a pretrained model."
)
parser
.
_action_groups
[
0
]
.
add_argument
(
"fasta_file"
,
type
=
pathlib
.
Path
,
parser
.
_action_groups
[
0
]
.
add_argument
(
"fasta_file"
,
type
=
pathlib
.
Path
,
help
=
"FASTA file on which to extract the ESM2 representations and then test."
,
help
=
"FASTA file on which to extract the ESM2 representations and then test."
,
)
)
predict_args
.
add_argument
(
"--model_path"
,
type
=
str
,
default
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
".."
,
"senseppi.ckpt"
),
help
=
"A path to .ckpt file that contains weights to a pretrained model. If "
"None, the senseppi trained version is used."
)
predict_args
.
add_argument
(
"--pairs_file"
,
type
=
str
,
default
=
None
,
predict_args
.
add_argument
(
"--pairs_file"
,
type
=
str
,
default
=
None
,
help
=
"A path to a .tsv file with pairs of proteins to test (Optional). If not provided, "
help
=
"A path to a .tsv file with pairs of proteins to test (Optional). If not provided, "
"all-to-all pairs will be generated."
)
"all-to-all pairs will be generated."
)
...
...
senseppi/commands/predict_string.py
View file @
aa239099
...
@@ -184,11 +184,12 @@ def add_args(parser):
...
@@ -184,11 +184,12 @@ def add_args(parser):
parser
=
add_general_args
(
parser
)
parser
=
add_general_args
(
parser
)
string_pred_args
=
parser
.
add_argument_group
(
title
=
"General options"
)
string_pred_args
=
parser
.
add_argument_group
(
title
=
"General options"
)
parser
.
_action_groups
[
0
]
.
add_argument
(
"model_path"
,
type
=
str
,
help
=
"A path to .ckpt file that contains weights to a pretrained model."
)
parser
.
_action_groups
[
0
]
.
add_argument
(
"genes"
,
type
=
str
,
nargs
=
"+"
,
parser
.
_action_groups
[
0
]
.
add_argument
(
"genes"
,
type
=
str
,
nargs
=
"+"
,
help
=
"Name of gene to fetch from STRING database. Several names can be "
help
=
"Name of gene to fetch from STRING database. Several names can be "
"typed (separated by whitespaces)."
)
"typed (separated by whitespaces)."
)
string_pred_args
.
add_argument
(
"--model_path"
,
type
=
str
,
default
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
".."
,
"senseppi.ckpt"
),
help
=
"A path to .ckpt file that contains weights to a pretrained model. If "
"None, the senseppi trained version is used."
)
string_pred_args
.
add_argument
(
"-s"
,
"--species"
,
type
=
int
,
default
=
9606
,
string_pred_args
.
add_argument
(
"-s"
,
"--species"
,
type
=
int
,
default
=
9606
,
help
=
"Species from STRING database. Default: 9606 (H. Sapiens)"
)
help
=
"Species from STRING database. Default: 9606 (H. Sapiens)"
)
string_pred_args
.
add_argument
(
"-n"
,
"--nodes"
,
type
=
int
,
default
=
10
,
string_pred_args
.
add_argument
(
"-n"
,
"--nodes"
,
type
=
int
,
default
=
10
,
...
...
senseppi/commands/test.py
View file @
aa239099
...
@@ -37,8 +37,6 @@ def add_args(parser):
...
@@ -37,8 +37,6 @@ def add_args(parser):
parser
=
add_general_args
(
parser
)
parser
=
add_general_args
(
parser
)
test_args
=
parser
.
add_argument_group
(
title
=
"Predict args"
)
test_args
=
parser
.
add_argument_group
(
title
=
"Predict args"
)
parser
.
_action_groups
[
0
]
.
add_argument
(
"model_path"
,
type
=
str
,
help
=
"A path to .ckpt file that contains weights to a pretrained model."
)
parser
.
_action_groups
[
0
]
.
add_argument
(
"pairs_file"
,
type
=
str
,
default
=
None
,
parser
.
_action_groups
[
0
]
.
add_argument
(
"pairs_file"
,
type
=
str
,
default
=
None
,
help
=
"A path to a .tsv file with pairs of proteins to test."
)
help
=
"A path to a .tsv file with pairs of proteins to test."
)
parser
.
_action_groups
[
0
]
.
add_argument
(
"fasta_file"
,
parser
.
_action_groups
[
0
]
.
add_argument
(
"fasta_file"
,
...
@@ -46,12 +44,15 @@ def add_args(parser):
...
@@ -46,12 +44,15 @@ def add_args(parser):
help
=
"FASTA file on which to extract the ESM2 "
help
=
"FASTA file on which to extract the ESM2 "
"representations and then evaluate."
,
"representations and then evaluate."
,
)
)
test_args
.
add_argument
(
"--model_path"
,
type
=
str
,
default
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
".."
,
"senseppi.ckpt"
),
help
=
"A path to .ckpt file that contains weights to a pretrained model. If "
"None, the senseppi trained version is used."
)
test_args
.
add_argument
(
"-o"
,
"--output"
,
type
=
str
,
default
=
"test_metrics"
,
test_args
.
add_argument
(
"-o"
,
"--output"
,
type
=
str
,
default
=
"test_metrics"
,
help
=
"A path to a file where the test metrics will be saved. "
help
=
"A path to a file where the test metrics will be saved. "
"(.tsv format will be added automatically)"
)
"(.tsv format will be added automatically)"
)
test_args
.
add_argument
(
"--crop_data_to_model_lims"
,
action
=
"store_true"
,
test_args
.
add_argument
(
"--crop_data_to_model_lims"
,
action
=
"store_true"
,
help
=
"If set, the data will be cropped to the limits of the model: "
help
=
"If set, the data will be cropped to the limits of the model: "
"evaluations will be done only for proteins >50aa and <800aa."
)
"evaluations will be done only for proteins >50aa and <800aa."
)
parser
=
SensePPIModel
.
add_model_specific_args
(
parser
)
parser
=
SensePPIModel
.
add_model_specific_args
(
parser
)
remove_argument
(
parser
,
"--lr"
)
remove_argument
(
parser
,
"--lr"
)
...
...
senseppi/senseppi.ckpt
0 → 100644
View file @
aa239099
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment