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
a1aee20d
Commit
a1aee20d
authored
6 years ago
by
Sebastian Bittrich
Browse files
Options
Downloads
Patches
Plain Diff
introduces Float32Array, rolling assignment
parent
bea4d12b
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
+20
-41
20 additions, 41 deletions
...l/structure/model/properties/utils/secondary-structure.ts
with
20 additions
and
41 deletions
src/mol-model/structure/model/properties/utils/secondary-structure.ts
+
20
−
41
View file @
a1aee20d
...
@@ -14,6 +14,7 @@ import { IntAdjacencyGraph } from 'mol-math/graph';
...
@@ -14,6 +14,7 @@ import { IntAdjacencyGraph } from 'mol-math/graph';
import
{
BitFlags
}
from
'
mol-util
'
;
import
{
BitFlags
}
from
'
mol-util
'
;
import
{
ElementIndex
}
from
'
mol-model/structure/model/indexing
'
;
import
{
ElementIndex
}
from
'
mol-model/structure/model/indexing
'
;
import
{
AtomicHierarchy
,
AtomicConformation
}
from
'
../atomic
'
;
import
{
AtomicHierarchy
,
AtomicConformation
}
from
'
../atomic
'
;
import
{
Float
}
from
'
servers/volume/common/binary-schema
'
;
/**
/**
* TODO bugs to fix:
* TODO bugs to fix:
...
@@ -55,7 +56,7 @@ interface DSSPContext {
...
@@ -55,7 +56,7 @@ interface DSSPContext {
flags
:
Uint32Array
flags
:
Uint32Array
hbonds
:
DsspHbonds
,
hbonds
:
DsspHbonds
,
torsionAngles
:
{
phi
:
number
[],
psi
:
number
[]
},
torsionAngles
:
{
phi
:
Float32Array
,
psi
:
Float32Array
},
backboneIndices
:
BackboneAtomIndices
,
backboneIndices
:
BackboneAtomIndices
,
conformation
:
AtomicConformation
,
conformation
:
AtomicConformation
,
ladders
:
Ladder
[],
ladders
:
Ladder
[],
...
@@ -351,7 +352,7 @@ function assignBends(ctx: DSSPContext) {
...
@@ -351,7 +352,7 @@ function assignBends(ctx: DSSPContext) {
}
}
}
}
function
calculateDihedralAngles
(
hierarchy
:
AtomicHierarchy
,
conformation
:
AtomicConformation
,
proteinResidues
:
SortedArray
<
ResidueIndex
>
,
backboneIndices
:
BackboneAtomIndices
):
{
phi
:
number
[],
psi
:
number
[]
/*, omega: number[]*/
}
{
function
calculateDihedralAngles
(
hierarchy
:
AtomicHierarchy
,
conformation
:
AtomicConformation
,
proteinResidues
:
SortedArray
<
ResidueIndex
>
,
backboneIndices
:
BackboneAtomIndices
):
{
phi
:
Float32Array
,
psi
:
Float32Array
}
{
const
{
cIndices
,
nIndices
}
=
backboneIndices
const
{
cIndices
,
nIndices
}
=
backboneIndices
const
{
index
}
=
hierarchy
const
{
index
}
=
hierarchy
const
{
x
,
y
,
z
}
=
conformation
const
{
x
,
y
,
z
}
=
conformation
...
@@ -360,52 +361,30 @@ function calculateDihedralAngles(hierarchy: AtomicHierarchy, conformation: Atomi
...
@@ -360,52 +361,30 @@ function calculateDihedralAngles(hierarchy: AtomicHierarchy, conformation: Atomi
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
)
=>
Vec3
.
set
(
v
,
x
[
i
],
y
[
i
],
z
[
i
])
const
cPosPrev
=
Vec3
.
zero
()
let
cPosPrev
=
Vec3
.
zero
(),
caPosPrev
=
Vec3
.
zero
(),
nPosPrev
=
Vec3
.
zero
()
const
caPosPrev
=
Vec3
.
zero
()
let
cPos
=
Vec3
.
zero
(),
caPos
=
Vec3
.
zero
(),
nPos
=
Vec3
.
zero
()
const
nPosPrev
=
Vec3
.
zero
()
let
cPosNext
=
Vec3
.
zero
(),
caPosNext
=
Vec3
.
zero
(),
nPosNext
=
Vec3
.
zero
()
const
cPos
=
Vec3
.
zero
()
const
caPos
=
Vec3
.
zero
()
const
nPos
=
Vec3
.
zero
()
const
cPosNext
=
Vec3
.
zero
()
const
caPosNext
=
Vec3
.
zero
()
const
nPosNext
=
Vec3
.
zero
()
const
phi
:
number
[]
=
[]
const
phi
:
Float32Array
=
new
Float32Array
(
residueCount
-
1
)
const
psi
:
number
[]
=
[]
const
psi
:
Float32Array
=
new
Float32Array
(
residueCount
-
1
)
const
cAtomPrev
=
cIndices
[
-
1
],
caAtomPrev
=
traceElementIndex
[
proteinResidues
[
-
1
]],
nAtomPrev
=
nIndices
[
-
1
]
position
(
cAtomPrev
,
cPosPrev
),
position
(
caAtomPrev
,
caPosPrev
),
position
(
nAtomPrev
,
nPosPrev
)
const
cAtom
=
cIndices
[
0
],
caAtom
=
traceElementIndex
[
proteinResidues
[
0
]],
nAtom
=
nIndices
[
0
]
position
(
cAtom
,
cPos
),
position
(
caAtom
,
caPos
),
position
(
nAtom
,
nPos
)
const
cAtomNext
=
cIndices
[
1
],
caAtomNext
=
traceElementIndex
[
proteinResidues
[
1
]],
nAtomNext
=
nIndices
[
1
]
position
(
cAtomNext
,
cPosNext
),
position
(
caAtomNext
,
caPosNext
),
position
(
nAtomNext
,
nPosNext
)
for
(
let
i
=
0
;
i
<
residueCount
-
1
;
++
i
)
{
for
(
let
i
=
0
;
i
<
residueCount
-
1
;
++
i
)
{
const
oPIprev
=
i
-
1
const
oRIprev
=
proteinResidues
[
i
-
1
]
const
oPI
=
i
const
oRI
=
proteinResidues
[
i
]
const
oPInext
=
i
+
1
const
oRInext
=
proteinResidues
[
i
+
1
]
const
cAtomPrev
=
cIndices
[
oPIprev
]
const
caAtomPrev
=
traceElementIndex
[
oRIprev
]
const
nAtomPrev
=
nIndices
[
oPIprev
]
const
cAtom
=
cIndices
[
oPI
]
const
caAtom
=
traceElementIndex
[
oRI
]
const
nAtom
=
nIndices
[
oPI
]
const
cAtomNext
=
cIndices
[
oPInext
]
const
caAtomNext
=
traceElementIndex
[
oRInext
]
const
nAtomNext
=
nIndices
[
oRInext
]
// ignore C-terminal residue as acceptor
// ignore C-terminal residue as acceptor
if
(
index
.
findAtomOnResidue
(
oRI
,
'
OXT
'
)
!==
-
1
)
continue
if
(
index
.
findAtomOnResidue
(
proteinResidues
[
i
],
'
OXT
'
)
!==
-
1
)
continue
position
(
cAtomPrev
,
cPosPrev
)
position
(
caAtomPrev
,
caPosPrev
)
position
(
nAtomPrev
,
nPosPrev
)
position
(
cAtom
,
cPos
)
position
(
caAtom
,
caPos
)
position
(
nAtom
,
nPos
)
position
(
cAtomNext
,
cPosNext
)
position
(
caAtomNext
,
caPosNext
)
position
(
nAtomNext
,
nPosNext
)
phi
[
phi
.
length
]
=
calculatePhi
(
cPosPrev
,
nPos
,
caPos
,
cPos
)
phi
[
phi
.
length
]
=
calculatePhi
(
cPosPrev
,
nPos
,
caPos
,
cPos
)
psi
[
psi
.
length
]
=
calculatePsi
(
nPos
,
caPos
,
cPos
,
nPosNext
)
psi
[
psi
.
length
]
=
calculatePsi
(
nPos
,
caPos
,
cPos
,
nPosNext
)
cPosPrev
=
cPos
,
caPosPrev
=
caPos
,
nPosPrev
=
nPos
cPos
=
cPosNext
,
caPos
=
caPosNext
,
nPos
=
nPosNext
position
(
cIndices
[
i
+
1
],
cPosNext
),
position
(
traceElementIndex
[
proteinResidues
[
i
+
1
]],
caPosNext
),
position
(
nIndices
[
i
+
1
],
nPosNext
)
}
}
return
{
phi
,
psi
};
return
{
phi
,
psi
};
...
...
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