Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
298e13fc
Commit
298e13fc
authored
6 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
secondary structure, handle models without protein residues, tweaks
parent
02402c9c
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
src/mol-model/structure/model/properties/utils/secondary-structure.ts
+36
-26
36 additions, 26 deletions
...l/structure/model/properties/utils/secondary-structure.ts
with
36 additions
and
26 deletions
src/mol-model/structure/model/properties/utils/secondary-structure.ts
+
36
−
26
View file @
298e13fc
...
@@ -298,13 +298,16 @@ function assignBends(ctx: DSSPContext) {
...
@@ -298,13 +298,16 @@ function assignBends(ctx: DSSPContext) {
const
position
=
(
i
:
number
,
v
:
Vec3
)
=>
Vec3
.
set
(
v
,
x
[
i
],
y
[
i
],
z
[
i
])
const
position
=
(
i
:
number
,
v
:
Vec3
)
=>
Vec3
.
set
(
v
,
x
[
i
],
y
[
i
],
z
[
i
])
const
caPosPrev2
=
Vec3
.
zero
()
const
caPosPrev2
=
Vec3
()
const
caPos
=
Vec3
.
zero
()
const
caPos
=
Vec3
()
const
caPosNext2
=
Vec3
.
zero
()
const
caPosNext2
=
Vec3
()
const
nIndices
=
ctx
.
backboneIndices
.
nIndices
const
nIndices
=
ctx
.
backboneIndices
.
nIndices
const
cPos
=
Vec3
.
zero
()
const
cPos
=
Vec3
()
const
nPosNext
=
Vec3
.
zero
()
const
nPosNext
=
Vec3
()
const
caMinus2
=
Vec3
()
const
caPlus2
=
Vec3
()
f1
:
for
(
let
i
=
2
;
i
<
residueCount
-
2
;
i
++
)
{
f1
:
for
(
let
i
=
2
;
i
<
residueCount
-
2
;
i
++
)
{
// check for peptide bond
// check for peptide bond
...
@@ -329,9 +332,6 @@ function assignBends(ctx: DSSPContext) {
...
@@ -329,9 +332,6 @@ function assignBends(ctx: DSSPContext) {
position
(
caAtom
,
caPos
)
position
(
caAtom
,
caPos
)
position
(
caAtomNext2
,
caPosNext2
)
position
(
caAtomNext2
,
caPosNext2
)
const
caMinus2
=
Vec3
.
zero
()
const
caPlus2
=
Vec3
.
zero
()
Vec3
.
sub
(
caMinus2
,
caPosPrev2
,
caPos
)
Vec3
.
sub
(
caMinus2
,
caPosPrev2
,
caPos
)
Vec3
.
sub
(
caPlus2
,
caPos
,
caPosNext2
)
Vec3
.
sub
(
caPlus2
,
caPos
,
caPosNext2
)
...
@@ -349,21 +349,29 @@ function calculateDihedralAngles(hierarchy: AtomicHierarchy, conformation: Atomi
...
@@ -349,21 +349,29 @@ function calculateDihedralAngles(hierarchy: AtomicHierarchy, conformation: Atomi
const
{
traceElementIndex
}
=
hierarchy
.
derived
.
residue
const
{
traceElementIndex
}
=
hierarchy
.
derived
.
residue
const
residueCount
=
proteinResidues
.
length
const
residueCount
=
proteinResidues
.
length
const
position
=
(
i
:
number
,
v
:
Vec3
)
=>
Vec3
.
set
(
v
,
x
[
i
],
y
[
i
],
z
[
i
])
const
position
=
(
i
:
number
,
v
:
Vec3
)
=>
i
===
-
1
?
Vec3
.
setNaN
(
v
)
:
Vec3
.
set
(
v
,
x
[
i
],
y
[
i
],
z
[
i
])
let
cPosPrev
=
Vec3
(),
caPosPrev
=
Vec3
(),
nPosPrev
=
Vec3
()
let
cPos
=
Vec3
(),
caPos
=
Vec3
(),
nPos
=
Vec3
()
let
cPosNext
=
Vec3
(),
caPosNext
=
Vec3
(),
nPosNext
=
Vec3
()
let
cPosPrev
=
Vec3
.
zero
(),
caPosPrev
=
Vec3
.
zero
(),
nPosPrev
=
Vec3
.
zero
()
if
(
residueCount
===
0
)
return
{
phi
:
new
Float32Array
(
0
),
psi
:
new
Float32Array
(
0
)
}
let
cPos
=
Vec3
.
zero
(),
caPos
=
Vec3
.
zero
(),
nPos
=
Vec3
.
zero
()
let
cPosNext
=
Vec3
.
zero
(),
caPosNext
=
Vec3
.
zero
(),
nPosNext
=
Vec3
.
zero
()
const
phi
:
Float32Array
=
new
Float32Array
(
residueCount
-
1
)
const
phi
:
Float32Array
=
new
Float32Array
(
residueCount
-
1
)
const
psi
:
Float32Array
=
new
Float32Array
(
residueCount
-
1
)
const
psi
:
Float32Array
=
new
Float32Array
(
residueCount
-
1
)
const
cAtomPrev
=
cIndices
[
-
1
],
caAtomPrev
=
traceElementIndex
[
proteinResidues
[
-
1
]],
nAtomPrev
=
nIndices
[
-
1
]
position
(
-
1
,
cPosPrev
)
position
(
cAtomPrev
,
cPosPrev
),
position
(
caAtomPrev
,
caPosPrev
),
position
(
nAtomPrev
,
nPosPrev
)
position
(
-
1
,
caPosPrev
)
const
cAtom
=
cIndices
[
0
],
caAtom
=
traceElementIndex
[
proteinResidues
[
0
]],
nAtom
=
nIndices
[
0
]
position
(
-
1
,
nPosPrev
)
position
(
cAtom
,
cPos
),
position
(
caAtom
,
caPos
),
position
(
nAtom
,
nPos
)
const
cAtomNext
=
cIndices
[
1
],
caAtomNext
=
traceElementIndex
[
proteinResidues
[
1
]],
nAtomNext
=
nIndices
[
1
]
position
(
cIndices
[
0
],
cPos
)
position
(
cAtomNext
,
cPosNext
),
position
(
caAtomNext
,
caPosNext
),
position
(
nAtomNext
,
nPosNext
)
position
(
traceElementIndex
[
proteinResidues
[
0
]],
caPos
)
position
(
nIndices
[
0
],
nPos
)
position
(
cIndices
[
1
],
cPosNext
)
position
(
traceElementIndex
[
proteinResidues
[
1
]],
caPosNext
)
position
(
nIndices
[
1
],
nPosNext
)
for
(
let
i
=
0
;
i
<
residueCount
-
1
;
++
i
)
{
for
(
let
i
=
0
;
i
<
residueCount
-
1
;
++
i
)
{
// ignore C-terminal residue as acceptor
// ignore C-terminal residue as acceptor
if
(
index
.
findAtomOnResidue
(
proteinResidues
[
i
],
'
OXT
'
)
!==
-
1
)
continue
if
(
index
.
findAtomOnResidue
(
proteinResidues
[
i
],
'
OXT
'
)
!==
-
1
)
continue
...
@@ -375,7 +383,9 @@ function calculateDihedralAngles(hierarchy: AtomicHierarchy, conformation: Atomi
...
@@ -375,7 +383,9 @@ function calculateDihedralAngles(hierarchy: AtomicHierarchy, conformation: Atomi
cPosPrev
=
cPos
,
caPosPrev
=
caPos
,
nPosPrev
=
nPos
cPosPrev
=
cPos
,
caPosPrev
=
caPos
,
nPosPrev
=
nPos
cPos
=
cPosNext
,
caPos
=
caPosNext
,
nPos
=
nPosNext
cPos
=
cPosNext
,
caPos
=
caPosNext
,
nPos
=
nPosNext
position
(
cIndices
[
i
+
1
],
cPosNext
),
position
(
traceElementIndex
[
proteinResidues
[
i
+
1
]],
caPosNext
),
position
(
nIndices
[
i
+
1
],
nPosNext
)
position
(
cIndices
[
i
+
1
],
cPosNext
)
position
(
traceElementIndex
[
proteinResidues
[
i
+
1
]],
caPosNext
)
position
(
nIndices
[
i
+
1
],
nPosNext
)
}
}
return
{
phi
,
psi
};
return
{
phi
,
psi
};
...
@@ -394,14 +404,14 @@ function calcBackboneHbonds(hierarchy: AtomicHierarchy, conformation: AtomicConf
...
@@ -394,14 +404,14 @@ function calcBackboneHbonds(hierarchy: AtomicHierarchy, conformation: AtomicConf
const
nAtomResidues
:
number
[]
=
[];
const
nAtomResidues
:
number
[]
=
[];
const
energies
:
number
[]
=
[];
const
energies
:
number
[]
=
[];
const
oPos
=
Vec3
.
zero
()
const
oPos
=
Vec3
()
const
cPos
=
Vec3
.
zero
()
const
cPos
=
Vec3
()
const
caPos
=
Vec3
.
zero
()
const
caPos
=
Vec3
()
const
nPos
=
Vec3
.
zero
()
const
nPos
=
Vec3
()
const
hPos
=
Vec3
.
zero
()
const
hPos
=
Vec3
()
const
cPosPrev
=
Vec3
.
zero
()
const
cPosPrev
=
Vec3
()
const
oPosPrev
=
Vec3
.
zero
()
const
oPosPrev
=
Vec3
()
for
(
let
i
=
0
,
il
=
proteinResidues
.
length
;
i
<
il
;
++
i
)
{
for
(
let
i
=
0
,
il
=
proteinResidues
.
length
;
i
<
il
;
++
i
)
{
const
oPI
=
i
const
oPI
=
i
...
...
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