Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor 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
openstructure
Commits
f3744766
Commit
f3744766
authored
3 years ago
by
Studer Gabriel
Browse files
Options
Downloads
Patches
Plain Diff
add function to extract number of contacts expected for a certain chain
parent
db020c14
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/mol/alg/pymod/lddt.py
+24
-0
24 additions, 0 deletions
modules/mol/alg/pymod/lddt.py
with
24 additions
and
0 deletions
modules/mol/alg/pymod/lddt.py
+
24
−
0
View file @
f3744766
...
...
@@ -496,6 +496,30 @@ class lDDTScorer:
else
:
return
lDDT
,
per_res_lDDT
def
GetNContacts
(
self
,
target_chain
,
no_interchain
=
False
):
"""
Returns number of contacts expected for a certain chain in *target*
:param target_chain: Chain in *target* for which you want the number
of expected contacts
:type target_chain: :class:`str`
:param no_interchain: Whether to exclude interchain contacts
:type no_interchain: :class:`bool`
:raises: :class:`RuntimeError` if specified chain doesnt exist
"""
if
target_chain
not
in
self
.
chain_names
:
raise
RuntimeError
(
f
"
Specified chain name (
{
target_chain
}
) not in
"
f
"
target
"
)
ch_idx
=
self
.
chain_names
.
index
(
target_chain
)
s
=
self
.
chain_start_indices
[
ch_idx
]
e
=
self
.
n_atoms
if
ch_idx
+
1
<
len
(
self
.
chain_names
):
e
=
self
.
chain_start_indices
[
ch_idx
+
1
]
if
no_interchain
:
return
self
.
_GetNExp
(
list
(
range
(
s
,
e
)),
self
.
ref_indices_sc
)
else
:
return
self
.
_GetNExp
(
list
(
range
(
s
,
e
)),
self
.
ref_indices
)
def
_GetExtraModelChainPenalty
(
self
,
model
,
chain_mapping
):
"""
Counts n distances in extra model chains to be added as penalty
"""
...
...
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