Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Alphafold3
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
RC Data Science
community-containers
Alphafold3
Commits
23e3d46d
Commit
23e3d46d
authored
6 months ago
by
Augustin Zidek
Browse files
Options
Downloads
Patches
Plain Diff
Fix setup to work with Python 3.12
PiperOrigin-RevId: 698035568
parent
025701f0
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Cloned AlphaFold 3 repo into this one
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pyproject.toml
+2
-1
2 additions, 1 deletion
pyproject.toml
src/alphafold3/build_data.py
+11
-2
11 additions, 2 deletions
src/alphafold3/build_data.py
src/alphafold3/model/mkdssp_pybind.cc
+19
-9
19 additions, 9 deletions
src/alphafold3/model/mkdssp_pybind.cc
with
32 additions
and
12 deletions
pyproject.toml
+
2
−
1
View file @
23e3d46d
...
@@ -22,11 +22,12 @@ dependencies = [
...
@@ -22,11 +22,12 @@ dependencies = [
"jax=
=
0.4
.
34
",
"jax=
=
0.4
.
34
",
"jax[cuda12]=
=
0.4
.
34
",
"jax[cuda12]=
=
0.4
.
34
",
"jax-triton=
=
0.2
.
0
",
"jax-triton=
=
0.2
.
0
",
"jaxtyping"
,
"jaxtyping
=
=
0.2
.
34
",
"numpy"
,
"numpy"
,
"rdkit=
=
2024.3
.
5
",
"rdkit=
=
2024.3
.
5
",
"triton=
=
3.1
.
0
",
"triton=
=
3.1
.
0
",
"tqdm"
,
"tqdm"
,
"typeguard=
=
2.13
.
3
",
"zstandard"
,
"zstandard"
,
]
]
...
...
This diff is collapsed.
Click to expand it.
src/alphafold3/build_data.py
+
11
−
2
View file @
23e3d46d
...
@@ -11,15 +11,24 @@
...
@@ -11,15 +11,24 @@
"""
Script for building intermediate data.
"""
"""
Script for building intermediate data.
"""
from
importlib
import
resources
from
importlib
import
resources
import
pathlib
import
site
import
alphafold3.constants.converters
import
alphafold3.constants.converters
from
alphafold3.constants.converters
import
ccd_pickle_gen
from
alphafold3.constants.converters
import
ccd_pickle_gen
from
alphafold3.constants.converters
import
chemical_component_sets_gen
from
alphafold3.constants.converters
import
chemical_component_sets_gen
import
share.libcifpp
def
build_data
():
def
build_data
():
cif_path
=
resources
.
files
(
share
.
libcifpp
).
joinpath
(
'
components.cif
'
)
"""
Builds intermediate data.
"""
for
site_path
in
site
.
getsitepackages
():
path
=
pathlib
.
Path
(
site_path
)
/
'
share/libcifpp/components.cif
'
if
path
.
exists
():
cif_path
=
path
break
else
:
raise
ValueError
(
'
Could not find components.cif
'
)
out_root
=
resources
.
files
(
alphafold3
.
constants
.
converters
)
out_root
=
resources
.
files
(
alphafold3
.
constants
.
converters
)
ccd_pickle_path
=
out_root
.
joinpath
(
'
ccd.pickle
'
)
ccd_pickle_path
=
out_root
.
joinpath
(
'
ccd.pickle
'
)
chemical_component_sets_pickle_path
=
out_root
.
joinpath
(
chemical_component_sets_pickle_path
=
out_root
.
joinpath
(
...
...
This diff is collapsed.
Click to expand it.
src/alphafold3/model/mkdssp_pybind.cc
+
19
−
9
View file @
23e3d46d
...
@@ -10,8 +10,7 @@
...
@@ -10,8 +10,7 @@
#include
"alphafold3/model/mkdssp_pybind.h"
#include
"alphafold3/model/mkdssp_pybind.h"
#include
<stdlib.h>
#include
<filesystem>
#include
<string>
#include
<cif++/file.hpp>
#include
<cif++/file.hpp>
#include
<cif++/pdb.hpp>
#include
<cif++/pdb.hpp>
...
@@ -20,18 +19,29 @@
...
@@ -20,18 +19,29 @@
#include
"absl/strings/string_view.h"
#include
"absl/strings/string_view.h"
#include
"pybind11/pybind11.h"
#include
"pybind11/pybind11.h"
#include
"pybind11/pytypes.h"
namespace
alphafold3
{
namespace
alphafold3
{
namespace
py
=
pybind11
;
namespace
py
=
pybind11
;
void
RegisterModuleMkdssp
(
pybind11
::
module
m
)
{
void
RegisterModuleMkdssp
(
pybind11
::
module
m
)
{
py
::
module
resources
=
py
::
module
::
import
(
"importlib.resources"
);
py
::
module
site
=
py
::
module
::
import
(
"site"
);
py
::
module
share_libcifpp
=
py
::
module
::
import
(
"share.libcifpp"
);
py
::
list
paths
=
py
::
cast
<
py
::
list
>
(
site
.
attr
(
"getsitepackages"
)());
std
::
string
data_dir
=
// Find the first path that contains the libcifpp components.cif file.
py
::
cast
<
std
::
string
>
(
resources
.
attr
(
"files"
)(
share_libcifpp
)
bool
found
=
false
;
.
attr
(
"joinpath"
)(
'.'
)
for
(
const
auto
&
py_path
:
paths
)
{
.
attr
(
"as_posix"
)());
auto
path_str
=
setenv
(
"LIBCIFPP_DATA_DIR"
,
data_dir
.
c_str
(),
0
);
std
::
filesystem
::
path
(
py
::
cast
<
absl
::
string_view
>
(
py_path
))
/
"share/libcifpp/components.cif"
;
if
(
std
::
filesystem
::
exists
(
path_str
))
{
setenv
(
"LIBCIFPP_DATA_DIR"
,
path_str
.
parent_path
().
c_str
(),
0
);
found
=
true
;
break
;
}
}
if
(
!
found
)
{
throw
py
::
type_error
(
"Could not find the libcifpp components.cif file."
);
}
m
.
def
(
m
.
def
(
"get_dssp"
,
"get_dssp"
,
[](
absl
::
string_view
mmcif
,
int
model_no
,
[](
absl
::
string_view
mmcif
,
int
model_no
,
...
...
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