Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Cosy-Bio
Drugst.One
plugin
Commits
64f0930c
Commit
64f0930c
authored
3 years ago
by
Michael Hartung
Browse files
Options
Downloads
Patches
Plain Diff
fix analysis network default style
parent
018bd53c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/components/analysis-panel/analysis-panel.component.ts
+10
-14
10 additions, 14 deletions
...app/components/analysis-panel/analysis-panel.component.ts
src/app/interfaces.ts
+6
-5
6 additions, 5 deletions
src/app/interfaces.ts
with
16 additions
and
19 deletions
src/app/components/analysis-panel/analysis-panel.component.ts
+
10
−
14
View file @
64f0930c
...
...
@@ -18,9 +18,9 @@ import {
getNodeIdsFromPDI
,
getNodeIdsFromPPI
,
getProteinNodeId
,
getWrapperFromCustom
,
getWrapperFromDrug
,
getWrapperFromNode
,
getWrapperFromProtein
,
Node
,
Task
,
Tissue
,
...
...
@@ -214,7 +214,6 @@ export class AnalysisPanelComponent implements OnInit, OnChanges {
if
(
nodeIds
.
length
>
0
)
{
const
nodeId
=
nodeIds
[
0
];
const
node
=
this
.
nodeData
.
nodes
.
get
(
nodeId
);
console
.
log
(
node
)
if
(
node
.
nodeType
===
'
drug
'
||
node
.
netexId
===
undefined
||
!
node
.
netexId
.
startsWith
(
'
p
'
))
{
return
;
}
...
...
@@ -391,7 +390,6 @@ export class AnalysisPanelComponent implements OnInit, OnChanges {
* For the third case, fall back to a default case which can also be set by user.
*/
public
inferNodeGroup
(
wrapper
:
Wrapper
):
string
{
console
.
log
(
wrapper
);
if
(
wrapper
.
data
.
group
!==
undefined
)
{
return
wrapper
.
data
.
group
;
}
else
if
(
wrapper
.
data
.
netexId
!==
undefined
&&
wrapper
.
data
.
netexId
.
startsWith
(
'
d
'
))
{
...
...
@@ -432,9 +430,6 @@ export class AnalysisPanelComponent implements OnInit, OnChanges {
// add drugGroup and foundNodesGroup for added nodes
// these groups can be overwritten by the user
console
.
log
(
"
result
"
)
console
.
log
(
result
)
const
nodes
=
[];
const
edges
=
[];
...
...
@@ -451,22 +446,23 @@ export class AnalysisPanelComponent implements OnInit, OnChanges {
const
wrappers
:
{
[
key
:
string
]:
Wrapper
}
=
{};
for
(
const
node
of
network
.
nodes
)
{
if
(
nodeTypes
[
node
]
===
'
protein
'
)
{
// convert id to netex Id if exists
const
nodeDetails
=
details
[
node
];
if
(
nodeDetails
.
netexId
&&
nodeDetails
.
netexId
.
startsWith
(
'
p
'
))
{
// node is protein from database, has been mapped on init to backend protein from backend
// or was found during analysis
this
.
proteins
.
push
(
d
etails
[
node
]
);
wrappers
[
node
]
=
getWrapperFrom
Node
(
details
[
n
ode
]
);
}
else
if
(
node
Types
[
node
]
===
'
drug
'
)
{
this
.
proteins
.
push
(
nodeD
etails
);
wrappers
[
node
]
=
getWrapperFrom
Protein
(
nodeDetails
as
N
ode
);
}
else
if
(
node
Details
.
netexId
&&
nodeDetails
.
netexId
.
startsWith
(
'
d
'
)
)
{
// node is drug, was found during analysis
wrappers
[
node
]
=
getWrapperFromDrug
(
d
etails
[
node
]
);
wrappers
[
node
]
=
getWrapperFromDrug
(
nodeD
etails
as
Drug
);
}
else
{
// node is custom input from user, could not be mapped to backend protein
wrappers
[
node
]
=
getWrapperFrom
Custom
(
details
[
n
ode
]
);
wrappers
[
node
]
=
getWrapperFrom
Node
(
nodeDetails
as
N
ode
);
}
// IMPORTANT we set seeds to "selected" and not to seeds. The user should be inspired to run
// further analysis and the button function can be used to highlight seeds
// option to use details[node] as gradient, but sccores are very small
console
.
log
(
details
[
node
])
// option to use scores[node] as gradient, but sccores are very small
nodes
.
push
(
NetworkSettings
.
getNodeStyle
(
wrappers
[
node
].
data
as
Node
,
config
,
false
,
isSeed
[
node
],
1
))
}
for
(
const
edge
of
network
.
edges
)
{
...
...
This diff is collapsed.
Click to expand it.
src/app/interfaces.ts
+
6
−
5
View file @
64f0930c
...
...
@@ -140,14 +140,15 @@ export function getId(gene: Node) {
return
`
${
gene
.
id
}
`
;
}
export
function
getWrapperFrom
Custom
(
gene
:
Node
):
Wrapper
{
export
function
getWrapperFrom
Protein
(
gene
:
Node
):
Wrapper
{
/**
* Constructs wrapper interface for gene
*/
// if gene.label is undefined, set it to id
// if node does not have property group, it was found by the analysis
gene
.
group
=
gene
.
group
?
gene
.
group
:
'
foundNode
'
;
gene
.
label
=
gene
.
label
?
gene
.
label
:
gene
.
id
return
{
id
:
getN
ode
Id
(
gene
),
id
:
getN
etwork
Id
(
gene
),
data
:
gene
,
};
}
...
...
@@ -156,8 +157,8 @@ export function getWrapperFromNode(gene: Node): Wrapper {
/**
* Constructs wrapper interface for gene
*/
// if node does not have property group, it was
found by the analysis
gene
.
group
=
gene
.
group
?
gene
.
group
:
'
foundNode
'
;
// if node does not have property group, it was
custom node from user
gene
.
group
=
gene
.
group
?
gene
.
group
:
'
default
'
;
gene
.
label
=
gene
.
label
?
gene
.
label
:
gene
.
id
return
{
id
:
getNetworkId
(
gene
),
...
...
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