Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
af2-at-scicore
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
af2-at-scicore
Commits
6d289167
Commit
6d289167
authored
3 years ago
by
Bienchen
Browse files
Options
Downloads
Patches
Plain Diff
Change preset to db[-_]preset.
parent
0cd2602e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
run_af2/bin/submit-af2
+3
-3
3 additions, 3 deletions
run_af2/bin/submit-af2
run_af2/src/run_af2/_shared.py
+8
-8
8 additions, 8 deletions
run_af2/src/run_af2/_shared.py
run_af2/src/run_af2/run_singularity.py
+19
-18
19 additions, 18 deletions
run_af2/src/run_af2/run_singularity.py
with
30 additions
and
29 deletions
run_af2/bin/submit-af2
+
3
−
3
View file @
6d289167
...
...
@@ -27,7 +27,7 @@
# handle command line arguments
if
test
$#
-lt
2
;
then
echo
"usage: submit-af2 [--use-gpu]"
echo
" [--preset {reduced_dbs,full_dbs}]"
echo
" [--
db-
preset {reduced_dbs,full_dbs}]"
echo
" [--max-template-date YYYY-MM-DD]"
echo
" <OUTPUT DIR> <FASTA FILE> [<FASTA FILE> ...]"
exit
1
...
...
@@ -41,9 +41,9 @@ for i in 1 2 3; do
shift
SLURM_AF_PARAMS
=
"--partition=a100,rtx8000 --gres=gpu:1"
AF_PIPELINE_PARAM
=
"
${
AF_PIPELINE_PARAM
}
--use-gpu"
else if
test
x
"
${
1
}
"
=
x
"--preset"
;
then
else if
test
x
"
${
1
}
"
=
x
"--
db-
preset"
;
then
shift
AF_PIPELINE_PARAM
=
"
${
AF_PIPELINE_PARAM
}
--preset
${
1
}
"
AF_PIPELINE_PARAM
=
"
${
AF_PIPELINE_PARAM
}
--
db-
preset
${
1
}
"
shift
else if
test
x
"
${
1
}
"
=
x
"--max-template-date"
;
then
shift
...
...
This diff is collapsed.
Click to expand it.
run_af2/src/run_af2/_shared.py
+
8
−
8
View file @
6d289167
...
...
@@ -58,7 +58,7 @@ def parse_af2_arguments(parser):
:returns: :class:`argparse.Namespace` object from
`argparse.ArgumentParser.parse_args`.
"""
preset_choices
=
{
db_
preset_choices
=
{
"
reduced_dbs
"
:
[
"
bfd_database_path
"
,
"
uniclust30_database_path
"
],
"
full_dbs
"
:
[
"
small_bfd_database_path
"
],
}
...
...
@@ -102,8 +102,8 @@ def parse_af2_arguments(parser):
)
af2_group
.
add_argument
(
"
-p
"
,
"
--preset
"
,
choices
=
preset_choices
.
keys
(),
"
--
db-
preset
"
,
choices
=
db_
preset_choices
.
keys
(),
help
=
"
Choose model configuration - no ensembling and smaller genetic
"
+
"
databases (reduced_dbs), no ensembling and full genetic databases
"
+
"
configuration (full_dbs), the casp14 preset is not available right
"
...
...
@@ -113,7 +113,7 @@ def parse_af2_arguments(parser):
af2_group
.
add_argument
(
"
--version
"
,
action
=
"
version
"
,
version
=
"
%(prog)s {}
"
.
format
(
get_version
()
)
,
version
=
f
"
{
get_version
()
}
"
,
help
=
"
Show the version number and exit.
"
,
)
af2_group
.
add_argument
(
...
...
@@ -149,7 +149,7 @@ def parse_af2_arguments(parser):
"
--small-bfd-database-path
"
,
type
=
str
,
help
=
"
Path to the small version of the BFD database, used with
"
+
"'
--preset reduced_dbs
'
.
"
,
+
"'
--
db-
preset reduced_dbs
'
.
"
,
metavar
=
"
<PATH/ PREFIX>
"
,
default
=
None
,
)
...
...
@@ -190,11 +190,11 @@ def parse_af2_arguments(parser):
)
opts
=
parser
.
parse_args
()
# check that the preset setting makes sense
for
arg
in
preset_choices
[
opts
.
preset
]:
# check that the
db_
preset setting makes sense
for
arg
in
db_
preset_choices
[
opts
.
db_
preset
]:
if
getattr
(
opts
,
arg
)
is
not
None
:
print
(
f
"
WARNING:
'
--preset
{
opts
.
preset
}
'
disables use of
"
f
"
WARNING:
'
--
db-
preset
{
opts
.
db_
preset
}
'
disables use of
"
+
f
"'
--
{
(
arg
).
replace
(
'
_
'
,
'
-
'
)
}
'
.
"
,
file
=
sys
.
stderr
,
flush
=
True
,
...
...
This diff is collapsed.
Click to expand it.
run_af2/src/run_af2/run_singularity.py
+
19
−
18
View file @
6d289167
...
...
@@ -115,7 +115,7 @@ def _assemble_singularity_call( # pylint: disable=too-many-arguments
tmpdir
,
binds
,
use_gpu
,
preset
,
db_
preset
,
data_paths
,
):
"""
Assemble the command to run AF2 from the Singularity image.
"""
...
...
@@ -147,7 +147,7 @@ def _assemble_singularity_call( # pylint: disable=too-many-arguments
f
"
--output_dir=
{
snglrty_out
}
"
,
f
"
--model_names=
{
'
,
'
.
join
(
model_names
)
}
"
,
f
"
--max_template_date=
{
max_template_date
}
"
,
f
"
--preset=
{
preset
}
"
,
f
"
--
db_
preset=
{
db_
preset
}
"
,
"
--logtostderr
"
,
]
)
...
...
@@ -188,7 +188,7 @@ def run_af2_singularity_image( # pylint: disable=too-many-arguments
max_template_date
=
None
,
model_names
=
None
,
use_gpu
=
False
,
preset
=
"
full_dbs
"
,
db_
preset
=
"
full_dbs
"
,
af2_image_file
=
None
,
# "/export/soft/singularity-containers/alphafold",
af2_image_dir
=
"
/scicore/home/schwede/GROUP/alphafold_data/
"
,
...
...
@@ -236,11 +236,11 @@ def run_af2_singularity_image( # pylint: disable=too-many-arguments
:type model_names: :class:`list` of :class:`str`
:param use_gpu: Run the AF2 pipeline using GPUs or not.
:type use_gpu: :class:`bool`
:param preset: Model configuration - no ensembling and smaller genetic
databases (reduced_dbs), no ensembling and full genetic
databases configuration (full_dbs). Corresponds to the
preset
parameter in AF2.
:type preset: :class:`str`
:param
db_
preset: Model configuration - no ensembling and smaller genetic
databases (reduced_dbs), no ensembling and full genetic
databases configuration (full_dbs). Corresponds to the
preset
parameter in AF2.
:type
db_
preset: :class:`str`
:param af2_image_file: Declare a Singularity image to run the AF2 pipeline
from. If None, an image from af2_image_dir will be
used.
...
...
@@ -269,9 +269,10 @@ def run_af2_singularity_image( # pylint: disable=too-many-arguments
bfd_database_path in AF2.
:type bfd_database_path: :class:`str`
:param small_bfd_database_path: Small BFD database path, used with
preset=
"
reduced_dbs
"
, not a HHblits prefix
as for the large BFD database. Corresponds to
small_bfd_database_path in AF2.
db_preset=
"
reduced_dbs
"
, not a HHblits
prefix as for the large BFD database.
Corresponds to small_bfd_database_path in
AF2.
:type small_bfd_database_path: :class:`str`
:param uniclust30_database_path: Uniclust30 database prefix. Corresponds to
uniclust30_database_path in AF2.
...
...
@@ -298,9 +299,9 @@ def run_af2_singularity_image( # pylint: disable=too-many-arguments
tmpdir
=
os
.
getenv
(
tmpdir_var
)
if
tmpdir
is
None
:
raise
ValueError
(
f
"
tmpdir_var
{
tmpdir_var
}
must not be empty.
"
)
if
preset
not
in
[
"
full_dbs
"
,
"
reduced_dbs
"
]:
if
db_
preset
not
in
[
"
full_dbs
"
,
"
reduced_dbs
"
]:
raise
ValueError
(
f
"
preset
{
preset
}
not allowed, known values:
"
f
"
db_
preset
{
db_
preset
}
not allowed, known values:
"
+
"'
full_dbs
'
,
'
reduced_dbs
'"
)
...
...
@@ -313,10 +314,10 @@ def run_af2_singularity_image( # pylint: disable=too-many-arguments
"
template_mmcif_dir
"
:
template_mmcif_dir
,
"
obsolete_pdbs_path
"
:
obsolete_pdbs_path
,
}
if
preset
==
"
full_dbs
"
:
if
db_
preset
==
"
full_dbs
"
:
data_paths
[
"
bfd_database_path
"
]
=
bfd_database_path
data_paths
[
"
uniclust30_database_path
"
]
=
uniclust30_database_path
elif
preset
==
"
reduced_dbs
"
:
elif
db_
preset
==
"
reduced_dbs
"
:
data_paths
[
"
small_bfd_database_path
"
]
=
small_bfd_database_path
# Collect bind mountpoints for singularity, mountpoints for input data plus
...
...
@@ -344,7 +345,7 @@ def run_af2_singularity_image( # pylint: disable=too-many-arguments
tmpdir
,
binds
,
use_gpu
,
preset
,
db_
preset
,
data_paths
,
)
...
...
@@ -369,7 +370,7 @@ def run_af2_singularity_image( # pylint: disable=too-many-arguments
if
proc
.
returncode
:
raise
RuntimeError
(
"
Singularity/ AF2 did not finish successfully,
"
+
"
exit code:
%d
"
%
proc
.
returncode
,
+
f
"
exit code:
{
proc
.
returncode
}
"
,
proc
.
returncode
,
)
...
...
@@ -407,7 +408,7 @@ def main():
opts
.
max_template_date
,
opts
.
model_names
,
opts
.
use_gpu
,
opts
.
preset
,
opts
.
db_
preset
,
af2_image_file
=
opts
.
singularity_image
,
**
data_paths
,
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment