Skip to content
Snippets Groups Projects
Commit 137af606 authored by Michael Hartung's avatar Michael Hartung
Browse files

Merge branch 'master' of gitlab.lrz.de:netex/frontend

parents 6dedacac 7240a491
No related branches found
No related tags found
No related merge requests found
{ {
"name": "netex", "name": "netex",
"version": "0.8.9-rc1", "version": "0.9.0-rc5",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
......
{ {
"name": "netex", "name": "netex",
"version": "0.8.9-rc1", "version": "0.9.0-rc6",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"start:local": "ng serve --configuration=local", "start:local": "ng serve --configuration=local",
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
"bulma-tooltip": "^3.0.2", "bulma-tooltip": "^3.0.2",
"document-register-element": "^1.7.2", "document-register-element": "^1.7.2",
"dom-to-image": "^2.6.0", "dom-to-image": "^2.6.0",
"json5": "^2.2.0",
"lodash.merge": "^4.6.2", "lodash.merge": "^4.6.2",
"primeicons": "^4.1.0", "primeicons": "^4.1.0",
"primeng": "^12.0.1", "primeng": "^12.0.1",
......
...@@ -120,9 +120,9 @@ export class LaunchAnalysisComponent implements OnInit, OnChanges { ...@@ -120,9 +120,9 @@ export class LaunchAnalysisComponent implements OnInit, OnChanges {
parameters.target = this.target === 'drug' ? 'drug' : 'drug-target'; parameters.target = this.target === 'drug' ? 'drug' : 'drug-target';
// pass network data to reconstruct network in analysis result to connect non-proteins to results // pass network data to reconstruct network in analysis result to connect non-proteins to results
// drop interactions in nodes beforehand to no cause cyclic error, information is contained in edges // drop interactions in nodes beforehand to no cause cyclic error, information is contained in edges
// this.inputNetwork.nodes.forEach(node => { this.inputNetwork.nodes.forEach(node => {
// delete node.interactions delete node.interactions
// }); });
if (this.algorithm === 'trustrank') { if (this.algorithm === 'trustrank') {
parameters.damping_factor = this.trustrankDampingFactor; parameters.damping_factor = this.trustrankDampingFactor;
......
...@@ -26,9 +26,10 @@ import domtoimage from 'dom-to-image'; ...@@ -26,9 +26,10 @@ import domtoimage from 'dom-to-image';
import {NetworkSettings} from '../../network-settings'; import {NetworkSettings} from '../../network-settings';
import {defaultConfig, EdgeGroup, IConfig, InteractionDatabase, NodeGroup} from '../../config'; import {defaultConfig, EdgeGroup, IConfig, InteractionDatabase, NodeGroup} from '../../config';
import {NetexControllerService} from 'src/app/services/netex-controller/netex-controller.service'; import {NetexControllerService} from 'src/app/services/netex-controller/netex-controller.service';
import {downLoadFile, removeDuplicateObjectsFromList} from '../../utils' import {removeDuplicateObjectsFromList} from '../../utils';
import * as merge from 'lodash/fp/merge'; import * as merge from 'lodash/fp/merge';
import {AnalysisPanelComponent} from 'src/app/components/analysis-panel/analysis-panel.component'; import {AnalysisPanelComponent} from 'src/app/components/analysis-panel/analysis-panel.component';
import * as JSON5 from 'json5';
declare var vis: any; declare var vis: any;
...@@ -54,7 +55,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { ...@@ -54,7 +55,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
@Input() @Input()
public set config(config: string | undefined) { public set config(config: string | undefined) {
if (typeof config === 'undefined') { if (config == null) {
return; return;
} }
if (this.id == null) if (this.id == null)
...@@ -62,7 +63,8 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { ...@@ -62,7 +63,8 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
this.config = config; this.config = config;
}, 200); }, 200);
// add settings to config // add settings to config
const configObj = JSON.parse(config);
const configObj = typeof config === 'string' ? config.length === 0 ? {}: JSON5.parse(config) : config;
this.myConfig = merge(this.myConfig, configObj); this.myConfig = merge(this.myConfig, configObj);
// update Drugst.One according to the settings // update Drugst.One according to the settings
...@@ -93,11 +95,10 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { ...@@ -93,11 +95,10 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
@Input() @Input()
public set network(network: string | undefined) { public set network(network: string | undefined) {
if (typeof network === 'undefined') { if (network == null) {
return; return;
} }
this.networkJSON = JSON.stringify(typeof network === 'string' ? JSON5.parse(network) : network);
this.networkJSON = network;
this.createNetwork(); this.createNetwork();
} }
...@@ -274,12 +275,12 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { ...@@ -274,12 +275,12 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
private async getNetwork() { private async getNetwork() {
const network = JSON.parse(this.networkJSON); const network = JSON.parse(this.networkJSON);
if (this.myConfig.identifier === 'ensg') { if (this.myConfig.identifier === 'ensg') {
// @ts-ignore // @ts-ignore
network.nodes.forEach(node => { network.nodes.forEach(node => {
node.id = this.removeEnsemblVersion(node.id); node.id = this.removeEnsemblVersion(node.id);
}); });
if (network.edges != null)
// @ts-ignore // @ts-ignore
network.edges.forEach(edge => { network.edges.forEach(edge => {
edge.from = this.removeEnsemblVersion(edge.from); edge.from = this.removeEnsemblVersion(edge.from);
...@@ -300,7 +301,6 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { ...@@ -300,7 +301,6 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
// at this point, we have nodes synched with the backend // at this point, we have nodes synched with the backend
// use netexIds where posssible, but use original id as node name if no label given // use netexIds where posssible, but use original id as node name if no label given
const nodeIdMap = {}; const nodeIdMap = {};
network.nodes.forEach((node) => { network.nodes.forEach((node) => {
// set node label to original id before node id will be set to netex id // set node label to original id before node id will be set to netex id
node.label = node.label ? node.label : node.id; node.label = node.label ? node.label : node.id;
...@@ -311,6 +311,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit { ...@@ -311,6 +311,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
// adjust edge labels accordingly and filter // adjust edge labels accordingly and filter
const edges = new Array(); const edges = new Array();
if (network.edges != null)
network.edges.forEach(edge => { network.edges.forEach(edge => {
edge.from = nodeIdMap[edge.from]; edge.from = nodeIdMap[edge.from];
edge.to = nodeIdMap[edge.to]; edge.to = nodeIdMap[edge.to];
......
export const environment = { export const environment = {
production: true, production: true,
backend: 'http://cosy-test.zbh.uni-hamburg.de/drugstone_api/', backend: 'https://drugst.one/drugstone_api/',
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment