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
0bd7bdfe
Commit
0bd7bdfe
authored
6 years ago
by
Sebastian Bittrich
Browse files
Options
Downloads
Patches
Plain Diff
summing up ASA values for residues
parent
e8e79ab0
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/accessible-surface-area.ts
+13
-10
13 additions, 10 deletions
...ructure/model/properties/utils/accessible-surface-area.ts
with
13 additions
and
10 deletions
src/mol-model/structure/model/properties/utils/accessible-surface-area.ts
+
13
−
10
View file @
0bd7bdfe
...
...
@@ -36,7 +36,7 @@ function calculateASA(ctx: ASAContext) {
const
{
x
,
y
,
z
}
=
ctx
.
conformation
;
const
radii
:
number
[]
=
[];
const
atomAsa
:
number
[]
=
[];
//
const atomAsa: number[] = [];
const
residueAsa
:
number
[]
=
[];
console
.
log
(
ctx
.
hierarchy
);
...
...
@@ -46,7 +46,7 @@ function calculateASA(ctx: ASAContext) {
const
a1Pos
=
Vec3
.
zero
();
const
a2Pos
=
Vec3
.
zero
();
//
1.
extract all heavy atoms
// extract all heavy atoms
// TODO can be more elegant by obtaining residue info once and then using offset to navigate to next residue
for
(
let
i
=
0
;
i
<
type_symbol
.
rowCount
;
++
i
)
{
// skip hydrogen atoms
...
...
@@ -67,11 +67,13 @@ function calculateASA(ctx: ASAContext) {
const
atomId
=
atoms
.
label_atom_id
.
value
(
i
);
const
compId
=
residues
.
label_comp_id
.
value
(
groupIndex
);
const
element
=
type_symbol
.
value
(
i
);
//
2.
assign radius to all heavy atoms - depends on element and bonding patterns
// assign radius to all heavy atoms - depends on element and bonding patterns
radii
[
radii
.
length
]
=
determineRadius
(
atomId
,
element
,
compId
);
// set ASA of corresponding group to 0
residueAsa
[
groupIndex
]
=
0.0
;
}
//
3.
calculate the individual ASA of each atom
// calculate the individual ASA of each atom
// TODO again might be more elegant to use offsets
// TODO distance is symmetric, omit redudant calcuations
for
(
let
i
=
0
;
i
<
radii
.
length
;
++
i
)
{
...
...
@@ -79,7 +81,7 @@ function calculateASA(ctx: ASAContext) {
// skip invalid entries
if
(
radius
===
valueForIgnoredAtom
)
{
atomAsa
[
atomAsa
.
length
]
=
valueForIgnoredAtom
;
//
atomAsa[atomAsa.length] = valueForIgnoredAtom;
continue
;
}
...
...
@@ -124,13 +126,14 @@ function calculateASA(ctx: ASAContext) {
}
}
atomAsa
[
atomAsa
.
length
]
=
cons
*
accessiblePoints
*
r
*
r
;
const
value
=
cons
*
accessiblePoints
*
r
*
r
;
// atomAsa[atomAsa.length] = value;
// sum up values for each residue
residueAsa
[
residueAtomSegments
.
index
[
i
]]
+=
value
;
}
// 3. for each residue
// 3b. sum up
// 3c. (optionally) normalize by maximum value expected for a particular amino acid - needs lookup of max values
console
.
log
(
atomAsa
);
// TODO (optionally) normalize by maximum value expected for a particular amino acid - needs lookup of max values
console
.
log
(
residueAsa
);
}
/**
...
...
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