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
fbfbd808
"lib/bindings/git@developer.sourcefind.cn:OpenDAS/dynamo.git" did not exist on "a745a980dd7cc6361cc96ab2622842410dd80931"
Commit
fbfbd808
authored
Jun 02, 2023
by
Christina Floristean
Browse files
Merge branch 'main' into multimer
parents
c1129bef
103d0370
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
27 additions
and
26 deletions
+27
-26
Dockerfile
Dockerfile
+1
-1
README.md
README.md
+1
-1
environment.yml
environment.yml
+1
-1
notebooks/OpenFold.ipynb
notebooks/OpenFold.ipynb
+11
-12
openfold/model/msa.py
openfold/model/msa.py
+0
-3
openfold/model/triangular_multiplicative_update.py
openfold/model/triangular_multiplicative_update.py
+5
-2
openfold/np/relax/relax.py
openfold/np/relax/relax.py
+1
-1
openfold/np/residue_constants.py
openfold/np/residue_constants.py
+3
-1
openfold/utils/script_utils.py
openfold/utils/script_utils.py
+2
-2
scripts/install_third_party_dependencies.sh
scripts/install_third_party_dependencies.sh
+1
-1
setup.py
setup.py
+1
-1
No files found.
Dockerfile
View file @
fbfbd808
...
@@ -31,6 +31,6 @@ COPY setup.py /opt/openfold/setup.py
...
@@ -31,6 +31,6 @@ COPY setup.py /opt/openfold/setup.py
COPY
lib/openmm.patch /opt/openfold/lib/openmm.patch
COPY
lib/openmm.patch /opt/openfold/lib/openmm.patch
RUN
wget
-q
-P
/opt/openfold/openfold/resources
\
RUN
wget
-q
-P
/opt/openfold/openfold/resources
\
https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt
https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt
RUN
patch
-p0
-d
/opt/conda/lib/python3.
7
/site-packages/ < /opt/openfold/lib/openmm.patch
RUN
patch
-p0
-d
/opt/conda/lib/python3.
9
/site-packages/ < /opt/openfold/lib/openmm.patch
WORKDIR
/opt/openfold
WORKDIR
/opt/openfold
RUN
python3 setup.py
install
RUN
python3 setup.py
install
README.md
View file @
fbfbd808
...
@@ -298,7 +298,7 @@ python3 scripts/generate_chain_data_cache.py \
...
@@ -298,7 +298,7 @@ python3 scripts/generate_chain_data_cache.py \
```
```
where the
`cluster_file`
argument is a file of chain clusters, one cluster
where the
`cluster_file`
argument is a file of chain clusters, one cluster
per line
(e.g.
[
PDB40
](
https://cdn.rcsb.org/resources/sequence/clusters/clusters-by-entity-40.txt
)
)
.
per line.
Optionally, download an AlphaFold-style validation set from
Optionally, download an AlphaFold-style validation set from
[
CAMEO
](
https://cameo3d.org
)
using
`scripts/download_cameo.py`
. Use the
[
CAMEO
](
https://cameo3d.org
)
using
`scripts/download_cameo.py`
. Use the
...
...
environment.yml
View file @
fbfbd808
...
@@ -4,7 +4,7 @@ channels:
...
@@ -4,7 +4,7 @@ channels:
-
bioconda
-
bioconda
-
pytorch
-
pytorch
dependencies
:
dependencies
:
-
conda-forge::python=3.
7
-
conda-forge::python=3.
9
-
conda-forge::setuptools=59.5.0
-
conda-forge::setuptools=59.5.0
-
conda-forge::pip
-
conda-forge::pip
-
conda-forge::openmm=7.5.1
-
conda-forge::openmm=7.5.1
...
...
notebooks/OpenFold.ipynb
View file @
fbfbd808
...
@@ -97,6 +97,7 @@
...
@@ -97,6 +97,7 @@
"#@markdown **Note**: This installs the software on the Colab \n",
"#@markdown **Note**: This installs the software on the Colab \n",
"#@markdown notebook in the cloud and not on your computer.\n",
"#@markdown notebook in the cloud and not on your computer.\n",
"\n",
"\n",
"import sys\n",
"from IPython.utils import io\n",
"from IPython.utils import io\n",
"import os\n",
"import os\n",
"import subprocess\n",
"import subprocess\n",
...
@@ -104,6 +105,8 @@
...
@@ -104,6 +105,8 @@
"\n",
"\n",
"TQDM_BAR_FORMAT = '{l_bar}{bar}| {n_fmt}/{total_fmt} [elapsed: {elapsed} remaining: {remaining}]'\n",
"TQDM_BAR_FORMAT = '{l_bar}{bar}| {n_fmt}/{total_fmt} [elapsed: {elapsed} remaining: {remaining}]'\n",
"\n",
"\n",
"python_version = '.'.join(sys.version.split('.')[:2]) #get string like \"3.9\"\n",
"\n",
"try:\n",
"try:\n",
" with io.capture_output() as captured:\n",
" with io.capture_output() as captured:\n",
" %shell sudo apt install --quiet --yes hmmer\n",
" %shell sudo apt install --quiet --yes hmmer\n",
...
@@ -125,12 +128,15 @@
...
@@ -125,12 +128,15 @@
" %shell conda install -y -q -c conda-forge -c bioconda \\\n",
" %shell conda install -y -q -c conda-forge -c bioconda \\\n",
" kalign2=2.04 \\\n",
" kalign2=2.04 \\\n",
" hhsuite=3.3.0 \\\n",
" hhsuite=3.3.0 \\\n",
" python=3.8 \\\n",
" python={python_version} \\\n",
" openmm=7.7.0 \\\n",
" pdbfixer \\\n",
" 2>&1 1>/dev/null\n",
" 2>&1 1>/dev/null\n",
" %shell pip install -q \\\n",
" %shell pip install -q \\\n",
" ml-collections==0.1.0 \\\n",
" ml-collections==0.1.0 \\\n",
" PyYAML==5.4.1 \\\n",
" PyYAML==5.4.1 \\\n",
" biopython==1.79\n",
" biopython==1.79 \\\n",
" modelcif==0.7\n",
"\n",
"\n",
" # Create a ramdisk to store a database chunk to make Jackhmmer run fast.\n",
" # Create a ramdisk to store a database chunk to make Jackhmmer run fast.\n",
" %shell sudo mkdir -m 777 --parents /tmp/ramdisk\n",
" %shell sudo mkdir -m 777 --parents /tmp/ramdisk\n",
...
@@ -181,13 +187,6 @@
...
@@ -181,13 +187,6 @@
" %shell cp -f /content/stereo_chemical_props.txt /content/openfold/openfold/resources\n",
" %shell cp -f /content/stereo_chemical_props.txt /content/openfold/openfold/resources\n",
" %shell /usr/bin/python3 -m pip install -q ./openfold\n",
" %shell /usr/bin/python3 -m pip install -q ./openfold\n",
"\n",
"\n",
" %shell conda install -y -q -c conda-forge openmm=7.5.1\n",
" # Apply OpenMM patch.\n",
" %shell pushd /opt/conda/lib/python3.8/site-packages/ && \\\n",
" patch -p0 < /content/openfold/lib/openmm.patch && \\\n",
" popd\n",
" %shell conda install -y -q -c conda-forge pdbfixer=1.7\n",
"\n",
" if(weight_set == 'AlphaFold'):\n",
" if(weight_set == 'AlphaFold'):\n",
" %shell mkdir --parents \"{ALPHAFOLD_PARAMS_DIR}\"\n",
" %shell mkdir --parents \"{ALPHAFOLD_PARAMS_DIR}\"\n",
" %shell wget -O {ALPHAFOLD_PARAMS_PATH} {ALPHAFOLD_PARAM_SOURCE_URL}\n",
" %shell wget -O {ALPHAFOLD_PARAMS_PATH} {ALPHAFOLD_PARAM_SOURCE_URL}\n",
...
@@ -220,8 +219,8 @@
...
@@ -220,8 +219,8 @@
"import unittest.mock\n",
"import unittest.mock\n",
"import sys\n",
"import sys\n",
"\n",
"\n",
"sys.path.insert(0, '/usr/local/lib/python
3.8
/site-packages/')\n",
"sys.path.insert(0,
f
'/usr/local/lib/python
{python_version}
/site-packages/')\n",
"sys.path.append('/opt/conda/lib/python
3.8
/site-packages')\n",
"sys.path.append(
f
'/opt/conda/lib/python
{python_version}
/site-packages')\n",
"\n",
"\n",
"# Allows us to skip installing these packages\n",
"# Allows us to skip installing these packages\n",
"unnecessary_modules = [\n",
"unnecessary_modules = [\n",
...
@@ -791,4 +790,4 @@
...
@@ -791,4 +790,4 @@
]
]
}
}
]
]
}
}
\ No newline at end of file
openfold/model/msa.py
View file @
fbfbd808
...
@@ -457,9 +457,6 @@ class MSAColumnGlobalAttention(nn.Module):
...
@@ -457,9 +457,6 @@ class MSAColumnGlobalAttention(nn.Module):
m
=
m
.
transpose
(
-
2
,
-
3
)
m
=
m
.
transpose
(
-
2
,
-
3
)
mask
=
mask
.
transpose
(
-
1
,
-
2
)
mask
=
mask
.
transpose
(
-
1
,
-
2
)
# [*, N_res, N_seq, C_in]
#m = self.layer_norm_m(m)
if
chunk_size
is
not
None
:
if
chunk_size
is
not
None
:
m
=
self
.
_chunk
(
m
,
mask
,
chunk_size
,
use_lma
=
use_lma
)
m
=
self
.
_chunk
(
m
,
mask
,
chunk_size
,
use_lma
=
use_lma
)
else
:
else
:
...
...
openfold/model/triangular_multiplicative_update.py
View file @
fbfbd808
...
@@ -433,8 +433,11 @@ class TriangleMultiplicativeUpdate(BaseTriangleMultiplicativeUpdate):
...
@@ -433,8 +433,11 @@ class TriangleMultiplicativeUpdate(BaseTriangleMultiplicativeUpdate):
# Prevents overflow of torch.matmul in combine projections in
# Prevents overflow of torch.matmul in combine projections in
# reduced-precision modes
# reduced-precision modes
a
=
a
/
a
.
std
()
a_std
=
a
.
std
()
b
=
b
/
b
.
std
()
b_std
=
b
.
std
()
if
(
a_std
!=
0.
and
b_std
!=
0.
):
a
=
a
/
a
.
std
()
b
=
b
/
b
.
std
()
if
(
is_fp16_enabled
()):
if
(
is_fp16_enabled
()):
with
torch
.
cuda
.
amp
.
autocast
(
enabled
=
False
):
with
torch
.
cuda
.
amp
.
autocast
(
enabled
=
False
):
...
...
openfold/np/relax/relax.py
View file @
fbfbd808
...
@@ -57,7 +57,7 @@ class AmberRelaxation(object):
...
@@ -57,7 +57,7 @@ class AmberRelaxation(object):
self
.
_use_gpu
=
use_gpu
self
.
_use_gpu
=
use_gpu
def
process
(
def
process
(
self
,
*
,
prot
:
protein
.
Protein
,
cif_output
:
bool
self
,
*
,
prot
:
protein
.
Protein
,
cif_output
:
bool
=
False
)
->
Tuple
[
str
,
Dict
[
str
,
Any
],
np
.
ndarray
]:
)
->
Tuple
[
str
,
Dict
[
str
,
Any
],
np
.
ndarray
]:
"""Runs Amber relax on a prediction, adds hydrogens, returns PDB string."""
"""Runs Amber relax on a prediction, adds hydrogens, returns PDB string."""
out
=
amber_minimize
.
run_pipeline
(
out
=
amber_minimize
.
run_pipeline
(
...
...
openfold/np/residue_constants.py
View file @
fbfbd808
...
@@ -409,7 +409,9 @@ residue_atoms = {
...
@@ -409,7 +409,9 @@ residue_atoms = {
# (The LDDT paper lists 7 amino acids as ambiguous, but the naming ambiguities
# (The LDDT paper lists 7 amino acids as ambiguous, but the naming ambiguities
# in LEU, VAL and ARG can be resolved by using the 3d constellations of
# in LEU, VAL and ARG can be resolved by using the 3d constellations of
# the 'ambiguous' atoms and their neighbours)
# the 'ambiguous' atoms and their neighbours)
# TODO: ^ interpret this
# Because for LEU, VAL and ARG, no ambiguous exist when the prediction output is chi angle instead of the location of individual atoms.
# For the rest, ASP and others, when you rotate the bond 180 degree, you get the same configuraiton due to symmetry.
residue_atom_renaming_swaps
=
{
residue_atom_renaming_swaps
=
{
"ASP"
:
{
"OD1"
:
"OD2"
},
"ASP"
:
{
"OD1"
:
"OD2"
},
"GLU"
:
{
"OE1"
:
"OE2"
},
"GLU"
:
{
"OE1"
:
"OE2"
},
...
...
openfold/utils/script_utils.py
View file @
fbfbd808
...
@@ -228,7 +228,7 @@ def prep_output(out, batch, feature_dict, feature_processor, config_preset, mult
...
@@ -228,7 +228,7 @@ def prep_output(out, batch, feature_dict, feature_processor, config_preset, mult
return
unrelaxed_protein
return
unrelaxed_protein
def
relax_protein
(
config
,
model_device
,
unrelaxed_protein
,
output_directory
,
output_name
,
cif_output
):
def
relax_protein
(
config
,
model_device
,
unrelaxed_protein
,
output_directory
,
output_name
,
cif_output
=
False
):
amber_relaxer
=
relax
.
AmberRelaxation
(
amber_relaxer
=
relax
.
AmberRelaxation
(
use_gpu
=
(
model_device
!=
"cpu"
),
use_gpu
=
(
model_device
!=
"cpu"
),
**
config
.
relax
,
**
config
.
relax
,
...
@@ -257,4 +257,4 @@ def relax_protein(config, model_device, unrelaxed_protein, output_directory, out
...
@@ -257,4 +257,4 @@ def relax_protein(config, model_device, unrelaxed_protein, output_directory, out
with
open
(
relaxed_output_path
,
'w'
)
as
fp
:
with
open
(
relaxed_output_path
,
'w'
)
as
fp
:
fp
.
write
(
struct_str
)
fp
.
write
(
struct_str
)
logger
.
info
(
f
"Relaxed output written to
{
relaxed_output_path
}
..."
)
logger
.
info
(
f
"Relaxed output written to
{
relaxed_output_path
}
..."
)
\ No newline at end of file
scripts/install_third_party_dependencies.sh
View file @
fbfbd808
...
@@ -27,7 +27,7 @@ cd $CUR_DIR
...
@@ -27,7 +27,7 @@ cd $CUR_DIR
# Install DeepMind's OpenMM patch
# Install DeepMind's OpenMM patch
OPENFOLD_DIR
=
$PWD
OPENFOLD_DIR
=
$PWD
pushd
lib/conda/envs/
$ENV_NAME
/lib/python3.
7
/site-packages/
\
pushd
lib/conda/envs/
$ENV_NAME
/lib/python3.
9
/site-packages/
\
&&
patch
-p0
<
$OPENFOLD_DIR
/lib/openmm.patch
\
&&
patch
-p0
<
$OPENFOLD_DIR
/lib/openmm.patch
\
&&
popd
&&
popd
...
...
setup.py
View file @
fbfbd808
...
@@ -130,7 +130,7 @@ setup(
...
@@ -130,7 +130,7 @@ setup(
classifiers
=
[
classifiers
=
[
'License :: OSI Approved :: Apache Software License'
,
'License :: OSI Approved :: Apache Software License'
,
'Operating System :: POSIX :: Linux'
,
'Operating System :: POSIX :: Linux'
,
'Programming Language :: Python :: 3.
7
,'
'Programming Language :: Python :: 3.
9
,'
'Topic :: Scientific/Engineering :: Artificial Intelligence'
,
'Topic :: Scientific/Engineering :: Artificial Intelligence'
,
],
],
)
)
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