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
de07730f
Commit
de07730f
authored
Oct 16, 2021
by
Gustaf Ahdritz
Browse files
Restore missing license notices
parent
5497655c
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
205 additions
and
35 deletions
+205
-35
openfold/data/__init__.py
openfold/data/__init__.py
+0
-0
openfold/data/data_pipeline.py
openfold/data/data_pipeline.py
+21
-6
openfold/data/data_transforms.py
openfold/data/data_transforms.py
+17
-2
openfold/data/feature_pipeline.py
openfold/data/feature_pipeline.py
+19
-4
openfold/data/input_pipeline.py
openfold/data/input_pipeline.py
+17
-1
openfold/data/mmcif_parsing.py
openfold/data/mmcif_parsing.py
+15
-0
openfold/data/parsers.py
openfold/data/parsers.py
+16
-1
openfold/data/templates.py
openfold/data/templates.py
+18
-3
openfold/data/tools/__init__.py
openfold/data/tools/__init__.py
+0
-0
openfold/data/tools/hhblits.py
openfold/data/tools/hhblits.py
+17
-4
openfold/data/tools/hhsearch.py
openfold/data/tools/hhsearch.py
+17
-5
openfold/data/tools/jackhmmer.py
openfold/data/tools/jackhmmer.py
+15
-1
openfold/data/tools/kalign.py
openfold/data/tools/kalign.py
+15
-1
openfold/data/tools/utils.py
openfold/data/tools/utils.py
+16
-2
run_pretrained_openfold.py
run_pretrained_openfold.py
+2
-5
No files found.
openfold/
features
/__init__.py
→
openfold/
data
/__init__.py
View file @
de07730f
File moved
openfold/
features
/data_pipeline.py
→
openfold/
data
/data_pipeline.py
View file @
de07730f
# Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
os
import
datetime
from
typing
import
Mapping
,
Optional
,
Sequence
,
Any
import
numpy
as
np
from
typing
import
Mapping
,
Optional
,
Sequence
,
Any
from
openfold.
features
import
templates
,
parsers
,
mmcif_parsing
from
openfold.
features.np
import
jackhmmer
,
hhblits
,
hhsearch
from
openfold.
features.np
.utils
import
to_date
from
openfold.
data
import
templates
,
parsers
,
mmcif_parsing
from
openfold.
data.tools
import
jackhmmer
,
hhblits
,
hhsearch
from
openfold.
data.tools
.utils
import
to_date
from
openfold.np
import
residue_constants
...
...
@@ -286,7 +301,7 @@ class DataPipeline:
alignments
[
'mgnify_deletion_matrix'
]
)
)
return
{
**
sequence_features
,
**
msa_features
,
**
templates_result
.
features
}
return
{
**
sequence_features
,
**
msa_features
,
**
templates_result
.
data
}
def
process_mmcif
(
self
,
mmcif
:
mmcif_parsing
.
MmcifObject
,
# parsing is expensive, so no path
...
...
@@ -333,4 +348,4 @@ class DataPipeline:
)
)
return
{
**
mmcif_feats
,
**
templates_result
.
features
,
**
msa_features
}
return
{
**
mmcif_feats
,
**
templates_result
.
data
,
**
msa_features
}
openfold/
features
/data_transforms.py
→
openfold/
data
/data_transforms.py
View file @
de07730f
# Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
itertools
from
functools
import
reduce
from
operator
import
add
import
numpy
as
np
import
torch
from
operator
import
add
from
openfold.config
import
NUM_RES
,
NUM_EXTRA_SEQ
,
NUM_TEMPLATES
,
NUM_MSA_SEQ
from
openfold.
np
import
residue_constants
as
rc
from
openfold.
tools
import
residue_constants
as
rc
from
openfold.utils.affine_utils
import
T
from
openfold.utils.tensor_utils
import
tree_map
,
tensor_tree_map
,
batched_gather
...
...
openfold/
features
/feature_pipeline.py
→
openfold/
data
/feature_pipeline.py
View file @
de07730f
# Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
copy
from
typing
import
Mapping
,
Tuple
,
List
,
Optional
,
Dict
,
Sequence
import
ml_collections
import
torch
from
typing
import
Mapping
,
Tuple
,
List
,
Optional
,
Dict
,
Sequence
import
numpy
as
np
import
torch
from
openfold.data
import
input_pipeline
from
openfold.features
import
input_pipeline
FeatureDict
=
Mapping
[
str
,
np
.
ndarray
]
TensorDict
=
Dict
[
str
,
torch
.
Tensor
]
def
np_to_tensor_dict
(
np_example
:
Mapping
[
str
,
np
.
ndarray
],
features
:
Sequence
[
str
],
...
...
openfold/
features
/input_pipeline.py
→
openfold/
data
/input_pipeline.py
View file @
de07730f
# Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from
functools
import
partial
import
torch
from
openfold.
features
import
data_transforms
from
openfold.
data
import
data_transforms
def
nonensembled_transform_fns
(
common_cfg
,
mode_cfg
):
...
...
openfold/
features
/mmcif_parsing.py
→
openfold/
data
/mmcif_parsing.py
View file @
de07730f
# Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Parses the mmCIF file format."""
import
collections
import
dataclasses
...
...
openfold/
features
/parsers.py
→
openfold/
data
/parsers.py
View file @
de07730f
# Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Functions for parsing various file formats."""
import
collections
import
dataclasses
...
...
@@ -5,8 +20,8 @@ import re
import
string
from
typing
import
Dict
,
Iterable
,
List
,
Optional
,
Sequence
,
Tuple
DeletionMatrix
=
Sequence
[
Sequence
[
int
]]
DeletionMatrix
=
Sequence
[
Sequence
[
int
]]
@
dataclasses
.
dataclass
(
frozen
=
True
)
class
TemplateHit
:
...
...
openfold/
features
/templates.py
→
openfold/
data
/templates.py
View file @
de07730f
# Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Functions for getting templates and calculating template features."""
import
dataclasses
import
datetime
...
...
@@ -10,9 +25,9 @@ from typing import Any, Dict, Mapping, Optional, Sequence, Tuple
import
numpy
as
np
from
openfold.
features
import
parsers
,
mmcif_parsing
from
openfold.
features.np
import
kalign
from
openfold.
features.np
.utils
import
to_date
from
openfold.
data
import
parsers
,
mmcif_parsing
from
openfold.
data.tools
import
kalign
from
openfold.
data.tools
.utils
import
to_date
from
openfold.np
import
residue_constants
...
...
openfold/
features/np
/__init__.py
→
openfold/
data/tools
/__init__.py
View file @
de07730f
File moved
openfold/
features/np
/hhblits.py
→
openfold/
data/tools
/hhblits.py
View file @
de07730f
"""Library to run HHblits from Python."""
# Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Library to run HHblits from Python."""
import
glob
import
logging
import
os
import
subprocess
from
typing
import
Any
,
Mapping
,
Optional
,
Sequence
from
absl
import
logging
from
openfold.data.tools
import
utils
from
openfold.features.np
import
utils
_HHBLITS_DEFAULT_P
=
20
_HHBLITS_DEFAULT_Z
=
500
...
...
openfold/
features/np
/hhsearch.py
→
openfold/
data/tools
/hhsearch.py
View file @
de07730f
"""Library to run HHsearch from Python."""
# Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Library to run HHsearch from Python."""
import
glob
import
logging
import
os
import
subprocess
from
typing
import
Sequence
from
absl
import
logging
from
openfold.features.np
import
utils
from
openfold.data.np
import
utils
class
HHSearch
:
...
...
openfold/
features/np
/jackhmmer.py
→
openfold/
data/tools
/jackhmmer.py
View file @
de07730f
# Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Library to run Jackhmmer from Python."""
...
...
@@ -9,7 +23,7 @@ import subprocess
from
typing
import
Any
,
Callable
,
Mapping
,
Optional
,
Sequence
from
urllib
import
request
from
openfold.
features.np
import
utils
from
openfold.
data.tools
import
utils
class
Jackhmmer
:
...
...
openfold/
features/np
/kalign.py
→
openfold/
data/tools
/kalign.py
View file @
de07730f
# Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""A Python wrapper for Kalign."""
import
os
...
...
@@ -6,7 +20,7 @@ from typing import Sequence
from
absl
import
logging
from
openfold.
features.np
import
utils
from
openfold.
data.tools
import
utils
def
_to_a3m
(
sequences
:
Sequence
[
str
])
->
str
:
...
...
openfold/
features/np
/utils.py
→
openfold/
data/tools
/utils.py
View file @
de07730f
# Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Common utilities for data pipeline tools."""
import
contextlib
import
datetime
import
logging
import
shutil
import
tempfile
import
time
from
typing
import
Optional
from
absl
import
logging
@
contextlib
.
contextmanager
def
tmpdir_manager
(
base_dir
:
Optional
[
str
]
=
None
):
...
...
run_pretrained_openfold.py
View file @
de07730f
...
...
@@ -16,6 +16,7 @@
import
argparse
from
datetime
import
date
import
logging
import
numpy
as
np
import
os
# A hack to get OpenMM and PyTorch to peacefully coexist
...
...
@@ -24,15 +25,11 @@ os.environ["OPENMM_DEFAULT_PLATFORM"] = "OpenCL"
import
pickle
import
random
import
sys
from
openfold.features
import
templates
,
feature_pipeline
,
data_pipeline
import
time
import
numpy
as
np
import
torch
from
openfold.config
import
model_config
from
openfold.data
import
templates
,
feature_pipeline
,
data_pipeline
from
openfold.model.model
import
AlphaFold
from
openfold.np
import
residue_constants
,
protein
import
openfold.np.relax.relax
as
relax
...
...
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