Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pdb-ligand-env
Manage
Activity
Members
Labels
Plan
Issues
5
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
pdbe
web-components
pdb-ligand-env
Commits
ee7fc49d
Commit
ee7fc49d
authored
3 months ago
by
Ibrahim Roshan Kunnakkattu
Browse files
Options
Downloads
Patches
Plain Diff
change aggregated interaction values to percentages
parent
0dc5133c
No related branches found
No related tags found
1 merge request
!5
Refactored code for diplaying aggregated ligand interactions
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/plugin/depiction.ts
+21
-11
21 additions, 11 deletions
src/plugin/depiction.ts
src/plugin/manager.ts
+0
-4
0 additions, 4 deletions
src/plugin/manager.ts
src/plugin/model.ts
+1
-1
1 addition, 1 deletion
src/plugin/model.ts
with
22 additions
and
16 deletions
src/plugin/depiction.ts
+
21
−
11
View file @
ee7fc49d
...
...
@@ -140,11 +140,9 @@ class Depiction {
/**
* Adds circles around atoms corresponding to the value of
* their weights.The size, color and number of circles around
* atom indicates the strength of weight. Currently maximum of
* three circles are drawn
* their weights.The size and color of circles around
* atom indicates the strength of weight.
* @param {any} weights objects with atom names and value of weight
* @param {string} colorScheme Name of color to be used for circles
* @memberof Depiction
*/
...
...
@@ -159,6 +157,7 @@ class Depiction {
});
const
data
=
this
.
atoms
;
const
scales
=
this
.
getScale
();
this
.
weight
.
selectAll
(
"
*
"
).
remove
();
/**
...
...
@@ -195,7 +194,7 @@ class Depiction {
.
data
(
data
)
.
enter
()
.
append
(
'
circle
'
)
.
attr
(
"
class
"
,
x
=>
`
${
x
.
name
}
_Circles
weightCircles
`
)
.
attr
(
"
class
"
,
x
=>
`
${
x
.
name
}
_Circles`
)
.
attr
(
"
cx
"
,
x
=>
x
.
position
.
x
)
.
attr
(
"
cy
"
,
x
=>
x
.
position
.
y
)
/**
...
...
@@ -210,7 +209,7 @@ class Depiction {
*/
.
attr
(
"
fill-opacity
"
,
"
1
"
)
/**
* This is a fill-opacity function if we want to draw
n
"weight"
* This is a fill-opacity function if we want to draw "weight"
* on top of "structure"
*/
// .attr("fill-opacity", (x:Atom) => {
...
...
@@ -256,18 +255,19 @@ class Depiction {
*/
private
getScale
()
{
/**
* scales are generated for only non-zero values.
* scales
for radius
are generated for only non-zero values.
* keeping zero as the minimum value of domain will generate
* very small radius which cannot be highlighted, alternatively
* if the minimum value of range is increased, this will lead to
* very high value of maximum of the range, that is not suitable
* if the minimum value of range is increased, then maximum value
* of the range also need to be increased which will result in very
* large circles for high values
*/
const
weights
=
this
.
atoms
.
map
(
x
=>
x
.
value
).
filter
(
x
=>
x
>
0
)
const
weightMax
=
d3
.
max
(
weights
);
const
weightMin
=
d3
.
min
(
weights
);
const
radiusScale
=
d3
.
scaleSqrt
([
weightMin
,
weightMax
],
[
10
,
30
]);
const
colorScale
=
d3
.
scale
Sqrt
(
[
weightMin
,
0.01
,
weightMax
],
const
colorScale
=
d3
.
scale
Linear
(
[
0
,
0.01
,
weightMax
],
[
"
#f0fcf0
"
,
"
#a0bb9e
"
,
"
#505d50
"
]
);
return
{
...
...
@@ -391,6 +391,11 @@ class Depiction {
return
newMap
;
}
/**
* Highlights an atom by transitioning the
* radius of circles around atoms and increasing
* the stroke width changing the colour
*/
private
highlightAtom
(
element
)
{
this
.
removeHighlights
();
const
scales
=
this
.
getScale
()
...
...
@@ -430,6 +435,10 @@ class Depiction {
animateStroke
();
}
/**
* Removes the highlights of the atom on
* mouse leaving
*/
private
removeHighlights
(){
const
scales
=
this
.
getScale
();
const
selectedCircle
=
d3
.
selectAll
(
"
.selectedCircle
"
);
...
...
@@ -487,6 +496,7 @@ class Depiction {
bubbles
:
true
,
detail
:
{
tooltip
:
atom
.
toTooltip
(
"
%
"
),
atomName
:
atom
.
name
,
external
:
propagation
}
});
...
...
This diff is collapsed.
Click to expand it.
src/plugin/manager.ts
+
0
−
4
View file @
ee7fc49d
...
...
@@ -125,10 +125,6 @@ class Visualization {
if
(
this
.
depiction
===
undefined
)
return
;
if
(
this
.
ligandIntxData
===
undefined
)
return
;
const
atomName
=
e
.
detail
.
name
;
// CustomEvent
/**
* This has been changed so we can highlight every Atom
*/
// const atom = this.depiction.atoms.filter(x => x.value >0 && x.name === atomName);
const
atom
=
this
.
depiction
.
atoms
.
filter
(
x
=>
x
.
name
===
atomName
);
const
selection
=
d3
.
select
(
`.
${
atomName
}
_Circles`
);
...
...
This diff is collapsed.
Click to expand it.
src/plugin/model.ts
+
1
−
1
View file @
ee7fc49d
...
...
@@ -557,7 +557,7 @@ namespace Model {
const
atomPropensity
=
atomCount
.
map
((
x
)
=>
({
"
atom
"
:
x
.
atom
,
"
value
"
:
(
x
.
count
/
totalIntx
)
.
toFixed
(
2
)
"
value
"
:
(
x
.
count
/
totalIntx
)
*
100
})
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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