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
Merge requests
!1
Cloned AlphaFold 3 repo into this one
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Cloned AlphaFold 3 repo into this one
clone-alphafold3-github
into
main
Overview
0
Commits
29
Pipelines
0
Changes
182
Merged
Fortune Iriaye
requested to merge
clone-alphafold3-github
into
main
7 months ago
Overview
0
Commits
29
Pipelines
0
Changes
3
Expand
PiperOrigin-RevId: 695257954
👍
0
👎
0
Merge request reports
Viewing commit
23e3d46d
Prev
Next
Show latest version
3 files
+
32
−
12
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
23e3d46d
Fix setup to work with Python 3.12
· 23e3d46d
Augustin Zidek
authored
7 months ago
PiperOrigin-RevId: 698035568
src/alphafold3/model/mkdssp_pybind.cc
+
19
−
9
Options
@@ -10,8 +10,7 @@
#include
"alphafold3/model/mkdssp_pybind.h"
#include
<stdlib.h>
#include
<string>
#include
<filesystem>
#include
<cif++/file.hpp>
#include
<cif++/pdb.hpp>
@@ -20,18 +19,29 @@
#include
"absl/strings/string_view.h"
#include
"pybind11/pybind11.h"
#include
"pybind11/pytypes.h"
namespace
alphafold3
{
namespace
py
=
pybind11
;
void
RegisterModuleMkdssp
(
pybind11
::
module
m
)
{
py
::
module
resources
=
py
::
module
::
import
(
"importlib.resources"
);
py
::
module
share_libcifpp
=
py
::
module
::
import
(
"share.libcifpp"
);
std
::
string
data_dir
=
py
::
cast
<
std
::
string
>
(
resources
.
attr
(
"files"
)(
share_libcifpp
)
.
attr
(
"joinpath"
)(
'.'
)
.
attr
(
"as_posix"
)());
setenv
(
"LIBCIFPP_DATA_DIR"
,
data_dir
.
c_str
(),
0
);
py
::
module
site
=
py
::
module
::
import
(
"site"
);
py
::
list
paths
=
py
::
cast
<
py
::
list
>
(
site
.
attr
(
"getsitepackages"
)());
// Find the first path that contains the libcifpp components.cif file.
bool
found
=
false
;
for
(
const
auto
&
py_path
:
paths
)
{
auto
path_str
=
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
(
"get_dssp"
,
[](
absl
::
string_view
mmcif
,
int
model_no
,
Loading