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
fc636c06
Commit
fc636c06
authored
4 years ago
by
Lukas Pravda
Browse files
Options
Downloads
Patches
Plain Diff
add covalent links from bound molecules if they are missing
parent
e2725c1f
No related branches found
No related tags found
No related merge requests found
Pipeline
#89338
passed with stages
Stage:
Stage:
in 1 minute and 14 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugin/manager.ts
+2
-3
2 additions, 3 deletions
src/plugin/manager.ts
src/plugin/model.ts
+50
-47
50 additions, 47 deletions
src/plugin/model.ts
with
52 additions
and
50 deletions
src/plugin/manager.ts
+
2
−
3
View file @
fc636c06
class
Visualization
{
// component related
private
parent
:
HTMLElement
;
...
...
@@ -538,7 +537,6 @@ class Visualization {
tooltip
:
link
.
toTooltip
()
}
});
this
.
parent
.
dispatchEvent
(
e
);
}
...
...
@@ -633,6 +631,7 @@ class Visualization {
if
(
!
n
.
residue
.
isLigand
)
return
;
this
.
nodeDim
(
n
,
i
,
g
);
this
.
fireExternalNodeMouseLeaveEvent
(
n
,
i
,
g
);
this
.
showLigandLabel
(
n
);
...
...
@@ -679,7 +678,7 @@ class Visualization {
.
filter
((
x
:
Model
.
InteractionNode
)
=>
!
x
.
residue
.
isLigand
)
.
forEach
((
x
:
Model
.
InteractionNode
)
=>
{
let
lnks
=
this
.
presentBindingSite
.
links
.
filter
((
y
:
Model
.
LigandResidueLink
)
=>
y
.
contains
Interaction
Node
(
x
))
.
filter
((
y
:
Model
.
LigandResidueLink
)
=>
y
.
containsNode
(
x
))
.
map
((
y
:
Model
.
LigandResidueLink
)
=>
[].
concat
.
apply
([],
y
.
interaction
.
map
(
z
=>
z
.
sourceAtoms
)));
let
concated
=
[].
concat
.
apply
([],
lnks
);
...
...
This diff is collapsed.
Click to expand it.
src/plugin/model.ts
+
50
−
47
View file @
fc636c06
...
...
@@ -15,14 +15,14 @@ namespace Model {
GroupGroup
}
/**
* What environment should be used
*
* @export
* @enum {number}
*/
export
enum
Environment
{
export
enum
Environment
{
Production
,
Development
,
Internal
...
...
@@ -157,23 +157,46 @@ namespace Model {
}
}
export
interface
Link
{
source
:
InteractionNode
;
target
:
InteractionNode
;
export
abstract
class
Link
{
public
source
:
InteractionNode
;
public
target
:
InteractionNode
;
constructor
(
source
:
InteractionNode
,
target
:
InteractionNode
)
{
this
.
source
=
source
;
this
.
target
=
target
;
}
public
containsBothNodes
(
a
:
InteractionNode
,
b
:
InteractionNode
):
boolean
{
let
condA
=
this
.
source
.
equals
(
a
)
&&
this
.
target
.
equals
(
b
);
let
condB
=
this
.
source
.
equals
(
b
)
&&
this
.
target
.
equals
(
a
);
return
condA
||
condB
;
}
getLinkClass
():
string
;
hasClash
():
boolean
;
toTooltip
():
string
;
public
containsNode
(
node
:
InteractionNode
)
{
return
this
.
source
.
equals
(
node
)
||
this
.
target
.
equals
(
node
);
}
public
containsResidue
(
n
:
Residue
):
boolean
{
return
(
this
.
target
.
residue
.
equals
(
n
)
||
this
.
source
.
residue
.
equals
(
n
));
}
abstract
getLinkClass
():
string
;
abstract
hasClash
():
boolean
;
abstract
toTooltip
():
string
;
}
export
class
ResidueResidueLink
implem
en
t
s
Link
{
export
class
ResidueResidueLink
ext
en
d
s
Link
{
target
:
InteractionNode
;
source
:
InteractionNode
interactions
:
Map
<
InteractionType
,
Array
<
string
>>
;
constructor
(
source
:
InteractionNode
,
target
:
InteractionNode
,
interactions
:
any
)
{
this
.
source
=
source
;
this
.
target
=
target
;
super
(
source
,
target
);
this
.
interactions
=
new
Map
<
InteractionType
,
Array
<
string
>>
();
Object
.
keys
(
interactions
).
forEach
(
x
=>
{
...
...
@@ -182,14 +205,6 @@ namespace Model {
});
}
/**
* Checks if the link contains a given node.
*/
public
containsNode
(
n
:
InteractionNode
):
boolean
{
return
this
.
target
.
equals
(
n
)
||
this
.
source
.
equals
(
n
);
}
public
hasClash
():
boolean
{
this
.
interactions
.
forEach
(
x
=>
{
if
(
x
.
includes
(
'
clash
'
))
{
...
...
@@ -199,17 +214,6 @@ namespace Model {
return
false
;
}
/**
* Shorthand to check if the link contains particular underlying
* residue.
*/
public
containsResidue
(
n
:
Residue
):
boolean
{
return
(
this
.
target
.
residue
.
equals
(
n
)
||
this
.
source
.
residue
.
equals
(
n
));
}
public
isBoundMoleculeLink
():
boolean
{
return
this
.
source
.
residue
.
isLigand
&&
this
.
target
.
residue
.
isLigand
&&
this
.
interactions
.
get
(
InteractionType
.
AtomAtom
).
includes
(
'
covalent
'
);
}
...
...
@@ -245,30 +249,20 @@ namespace Model {
}
export
class
LigandResidueLink
implements
Link
{
source
:
InteractionNode
;
target
:
InteractionNode
;
export
class
LigandResidueLink
extends
Link
{
interaction
:
Array
<
Interaction
>
;
constructor
(
begin
:
InteractionNode
,
end
:
InteractionNode
,
beginAtoms
:
string
[],
endAtoms
:
string
[],
interactionType
:
string
,
interactionDetails
:
string
[],
distance
:
number
)
{
this
.
source
=
begin
;
this
.
target
=
end
;
super
(
begin
,
end
);
this
.
interaction
=
new
Array
<
Interaction
>
();
this
.
interaction
.
push
(
new
Interaction
(
beginAtoms
,
endAtoms
,
InteractionTypeUtil
.
parse
(
interactionType
.
replace
(
'
-
'
,
'
_
'
)),
interactionDetails
,
distance
)
);
}
public
containsBothNodes
(
a
:
InteractionNode
,
b
:
InteractionNode
):
boolean
{
let
condA
=
this
.
source
.
equals
(
a
)
&&
this
.
target
.
equals
(
b
);
let
condB
=
this
.
source
.
equals
(
b
)
&&
this
.
target
.
equals
(
a
);
return
condA
||
condB
;
}
public
addInteraction
(
beginAtoms
:
string
[],
endAtoms
:
string
[],
interactionType
:
string
,
interactionDetails
:
string
[],
distance
:
number
):
void
{
this
.
interaction
.
push
(
new
Interaction
(
beginAtoms
,
endAtoms
,
InteractionTypeUtil
.
parse
(
interactionType
.
replace
(
'
-
'
,
'
_
'
)),
interactionDetails
,
distance
)
...
...
@@ -293,10 +287,6 @@ namespace Model {
return
'
other
'
;
}
public
containsInteractionNode
(
node
:
InteractionNode
)
{
return
this
.
source
.
equals
(
node
)
||
this
.
target
.
equals
(
node
);
}
public
hasClash
():
boolean
{
this
.
interaction
.
forEach
(
x
=>
{
x
.
interactionsClases
.
forEach
(
y
=>
{
...
...
@@ -371,6 +361,19 @@ namespace Model {
this
.
links
.
push
(
link
);
});
let
searchableNodes
=
Array
.
from
(
this
.
tmpNodesSet
);
data
.
composition
.
connections
.
forEach
(
pair
=>
{
let
bgn
=
searchableNodes
.
find
(
x
=>
x
.
residue
.
id
===
pair
[
0
]);
let
end
=
searchableNodes
.
find
(
x
=>
x
.
residue
.
id
===
pair
[
1
]);
let
result
=
this
.
links
.
find
(
x
=>
x
.
containsBothNodes
(
bgn
,
end
));
if
(
result
===
undefined
)
{
let
link
=
new
ResidueResidueLink
(
bgn
,
end
,
{
'
atom_atom
'
:
[
'
covalent
'
]
});
this
.
links
.
push
(
link
);
}
});
this
.
interactionNodes
=
Array
.
from
(
this
.
tmpNodesSet
.
values
());
return
this
;
...
...
@@ -424,7 +427,7 @@ namespace Model {
return
;
// we do not want to show 'self interactions'
}
let
tmpLink
=
tmpLinks
.
find
(
x
=>
(
<
LigandResidueLink
>
x
)
.
containsBothNodes
(
bgnNode
,
endNode
))
as
LigandResidueLink
;
let
tmpLink
=
tmpLinks
.
find
(
x
=>
x
.
containsBothNodes
(
bgnNode
,
endNode
));
if
(
tmpLink
!==
undefined
)
{
tmpLink
.
addInteraction
(
x
.
ligand_atoms
,
x
.
end
.
atom_names
,
x
.
interaction_type
,
x
.
interaction_details
,
x
.
distance
);
...
...
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