Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
modelcif-converters
Manage
Activity
Members
Code
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
Analyze
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
schwede
modelcif-converters
Commits
8eff857b
Commit
8eff857b
authored
1 year ago
by
Bienchen
Browse files
Options
Downloads
Patches
Plain Diff
Add local pLDDT from b-factors
parent
904b0278
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
projects/novelfams/translate2modelcif.py
+25
-9
25 additions, 9 deletions
projects/novelfams/translate2modelcif.py
with
25 additions
and
9 deletions
projects/novelfams/translate2modelcif.py
+
25
−
9
View file @
8eff857b
...
...
@@ -165,7 +165,6 @@ def _get_ch_name(ch, use_auth=False):
return
ch
.
name
# ToDo: are those Ab Initio Models?
class
_OST2ModelCIF
(
modelcif
.
model
.
AbInitioModel
):
"""
Map OST entity elements to ihm.model
"""
...
...
@@ -210,6 +209,23 @@ class _OST2ModelCIF(modelcif.model.AbInitioModel):
occupancy
=
atm
.
occupancy
,
)
def
add_scores
(
self
):
"""
Add QA metrics from AF2 scores.
"""
# local scores
i
=
0
for
chn_i
in
self
.
ost_entity
.
chains
:
ch_name
=
_get_ch_name
(
chn_i
,
self
.
use_auth
)
for
res_i
in
chn_i
.
residues
:
# local pLDDT
res_num
=
_get_res_num
(
res_i
,
self
.
use_auth
)
self
.
qa_metrics
.
append
(
_LocalPLDDT
(
self
.
asym
[
ch_name
].
residue
(
res_num
),
self
.
plddts
[
i
],
)
)
i
+=
1
def
_get_metadata
(
metadata_file
):
"""
Read csv file with metedata and prepare for next steps.
"""
...
...
@@ -535,7 +551,7 @@ def _store_as_modelcif(
scores_json
=
data_json
,
name
=
mdl_name
,
)
model
.
add_scores
()
model_group
=
modelcif
.
model
.
ModelGroup
([
model
])
system
.
model_groups
.
append
(
model_group
)
...
...
@@ -700,14 +716,14 @@ def _translate2modelcif(f_name, af2_lst, opts):
# ToDo: re-enable Pylint
# pylint: disable=too-many-locals
# skip if done already
if
opts
.
compress
:
cifext
=
"
cif.gz
"
else
:
cifext
=
"
cif
"
mdl_path
=
os
.
path
.
join
(
opts
.
out_dir
,
f
"
{
f_name
}
.
{
cifext
}
"
)
# ToDo: re-enable for final version
#if os.path.exists(mdl_path):
# skip if done already
# if opts.compress:
# cifext = "cif.gz"
# else:
# cifext = "cif"
# mdl_path = os.path.join(opts.out_dir, f"{f_name}.{cifext}")
# if os.path.exists(mdl_path):
# print(f" {f_name} already done")
# return
...
...
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