Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
OpenFold
Commits
e8e0b66f
Commit
e8e0b66f
authored
Oct 08, 2021
by
Gustaf Ahdritz
Browse files
Make minor formatting edits
parent
f8c81df4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
29 deletions
+26
-29
openfold/features/np/data_pipeline.py
openfold/features/np/data_pipeline.py
+17
-17
openfold/utils/affine_utils.py
openfold/utils/affine_utils.py
+1
-1
run_pretrained_alphafold.py
run_pretrained_alphafold.py
+8
-11
No files found.
openfold/features/np/data_pipeline.py
View file @
e8e0b66f
...
...
@@ -62,7 +62,7 @@ class DataPipeline:
"""Runs the alignment tools and assembles the input features."""
def
__init__
(
self
,
jackh
a
mmer_binary_path
:
str
,
jackhmmer_binary_path
:
str
,
hhblits_binary_path
:
str
,
hhsearch_binary_path
:
str
,
uniref90_database_path
:
str
,
...
...
@@ -79,12 +79,12 @@ class DataPipeline:
"""Constructs a feature dict for a given FASTA file."""
self
.
_use_small_bfd
=
use_small_bfd
self
.
jackhmmer_uniref90_runner
=
jackhmmer
.
Jackhmmer
(
binary_path
=
jackh
a
mmer_binary_path
,
binary_path
=
jackhmmer_binary_path
,
database_path
=
uniref90_database_path
)
if
use_small_bfd
:
self
.
jackhmmer_small_bfd_runner
=
jackhmmer
.
Jackhmmer
(
binary_path
=
jackh
a
mmer_binary_path
,
binary_path
=
jackhmmer_binary_path
,
database_path
=
small_bfd_database_path
)
else
:
...
...
@@ -93,7 +93,7 @@ class DataPipeline:
databases
=
[
bfd_database_path
,
uniclust30_database_path
]
)
self
.
jackhmmer_mgnify_runner
=
jackhmmer
.
Jackhmmer
(
binary_path
=
jackh
a
mmer_binary_path
,
binary_path
=
jackhmmer_binary_path
,
database_path
=
mgnify_database_path
)
self
.
hhsearch_pdb70_runner
=
hhsearch
.
HHSearch
(
...
...
openfold/utils/affine_utils.py
View file @
e8e0b66f
...
...
@@ -198,7 +198,7 @@ class T:
denom
=
torch
.
sqrt
(
sum
((
c
*
c
for
c
in
e0
))
+
eps
)
e0
=
[
c
/
denom
for
c
in
e0
]
dot
=
sum
((
c1
*
c2
for
c1
,
c2
in
zip
(
e0
,
e1
)))
e1
=
[
c
1
-
c
2
*
dot
for
c1
,
c2
in
zip
(
e
1
,
e
0
)]
e1
=
[
c
2
-
c
1
*
dot
for
c1
,
c2
in
zip
(
e
0
,
e
1
)]
denom
=
torch
.
sqrt
(
sum
((
c
*
c
for
c
in
e1
))
+
eps
)
e1
=
[
c
/
denom
for
c
in
e1
]
e2
=
[
...
...
run_pretrained_alphafold.py
View file @
e8e0b66f
...
...
@@ -63,10 +63,11 @@ def main(args):
max_hits
=
MAX_TEMPLATE_HITS
,
kalign_binary_path
=
args
.
kalign_binary_path
,
release_dates_path
=
None
,
obsolete_pdbs_path
=
args
.
obsolete_pdbs_path
)
obsolete_pdbs_path
=
args
.
obsolete_pdbs_path
)
data_processor
=
data_pipeline
.
DataPipeline
(
jackh
a
mmer_binary_path
=
args
.
jackhmmer_binary_path
,
jackhmmer_binary_path
=
args
.
jackhmmer_binary_path
,
hhblits_binary_path
=
args
.
hhblits_binary_path
,
hhsearch_binary_path
=
args
.
hhsearch_binary_path
,
uniref90_database_path
=
args
.
uniref90_database_path
,
...
...
@@ -94,16 +95,11 @@ def main(args):
print
(
"Collecting data..."
)
feature_dict
=
data_processor
.
process
(
input_fasta_path
=
args
.
fasta_path
,
msa_output_dir
=
msa_output_dir
)
# Output the features
features_output_path
=
os
.
path
.
join
(
output_dir_base
,
'features.pkl'
)
with
open
(
features_output_path
,
'wb'
)
as
f
:
pickle
.
dump
(
feature_dict
,
f
,
protocol
=
4
)
print
(
"Generating features..."
)
processed_feature_dict
=
feature_processor
.
process_features
(
feature_dict
,
random_seed
)
with
open
(
os
.
path
.
join
(
output_dir_base
,
'processed_feats.pkl'
),
'wb'
)
as
f
:
pickle
.
dump
(
processed_feature_dict
,
f
,
protocol
=
4
)
processed_feature_dict
=
feature_processor
.
process_features
(
feature_dict
,
random_seed
)
print
(
"Executing model..."
)
batch
=
processed_feature_dict
...
...
@@ -209,7 +205,8 @@ if __name__ == "__main__":
parser
.
add_argument
(
'--kalign_binary_path'
,
type
=
str
,
default
=
'/usr/bin/kalign'
)
parser
.
add_argument
(
'--uniref90_database_path'
,
type
=
str
,
default
=
None
,
required
=
True
parser
.
add_argument
(
'--uniref90_database_path'
,
type
=
str
,
default
=
None
,
required
=
True
)
parser
.
add_argument
(
'--mgnify_database_path'
,
type
=
str
,
default
=
None
,
required
=
True
...
...
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