Skip to content
Snippets Groups Projects
Commit db84c6ea authored by AndiMajore's avatar AndiMajore
Browse files

added dataset as part of payload

parent 9c05a9f7
Branches
Tags
No related merge requests found
...@@ -100,6 +100,7 @@ export class NetworkComponent implements OnInit { ...@@ -100,6 +100,7 @@ export class NetworkComponent implements OnInit {
this.currentViewNodes.forEach((protein) => { this.currentViewNodes.forEach((protein) => {
this.queryItems.push(getWrapperFromNode(protein)); this.queryItems.push(getWrapperFromNode(protein));
}); });
console.log(this.queryItems)
} }
public saveAddNodes(nodeList: Node[]) { public saveAddNodes(nodeList: Node[]) {
...@@ -111,7 +112,7 @@ export class NetworkComponent implements OnInit { ...@@ -111,7 +112,7 @@ export class NetworkComponent implements OnInit {
public updateAdjacentProteinDisorders(bool: boolean) { public updateAdjacentProteinDisorders(bool: boolean) {
this.adjacentDisordersProtein = bool; this.adjacentDisordersProtein = bool;
if (this.adjacentDisordersProtein) { if (this.adjacentDisordersProtein) {
this.netex.adjacentDisorders(this.nodeData.nodes, 'proteins').subscribe(response => { this.netex.adjacentDisorders(this.nodeData.nodes, 'proteins', this.drugstoneConfig.config.associatedProteinDisorder).subscribe(response => {
for (const interaction of response.edges) { for (const interaction of response.edges) {
const edge = { from: interaction.protein, to: interaction.disorder }; const edge = { from: interaction.protein, to: interaction.disorder };
this.adjacentProteinDisorderEdgesList.push(mapCustomEdge(edge, this.drugstoneConfig.config)); this.adjacentProteinDisorderEdgesList.push(mapCustomEdge(edge, this.drugstoneConfig.config));
...@@ -139,7 +140,7 @@ export class NetworkComponent implements OnInit { ...@@ -139,7 +140,7 @@ export class NetworkComponent implements OnInit {
public updateAdjacentDrugDisorders(bool: boolean) { public updateAdjacentDrugDisorders(bool: boolean) {
this.adjacentDisordersDrug = bool; this.adjacentDisordersDrug = bool;
if (this.adjacentDisordersDrug) { if (this.adjacentDisordersDrug) {
this.netex.adjacentDisorders(this.nodeData.nodes, 'drugs').subscribe(response => { this.netex.adjacentDisorders(this.nodeData.nodes, 'drugs', this.drugstoneConfig.config.indicationDrugDisorder).subscribe(response => {
for (const interaction of response.edges) { for (const interaction of response.edges) {
const edge = { from: interaction.drug, to: interaction.disorder }; const edge = { from: interaction.drug, to: interaction.disorder };
this.adjacentDrugDisorderEdgesList.push(mapCustomEdge(edge, this.drugstoneConfig.config)); this.adjacentDrugDisorderEdgesList.push(mapCustomEdge(edge, this.drugstoneConfig.config));
......
...@@ -96,9 +96,9 @@ export class NetexControllerService { ...@@ -96,9 +96,9 @@ export class NetexControllerService {
return this.http.get(`${environment.backend}tissue_expression/`, {params}); return this.http.get(`${environment.backend}tissue_expression/`, {params});
} }
public adjacentDisorders(nodes: Node[], nodeType: string): Observable<any> { public adjacentDisorders(nodes: Node[], nodeType: string, dataset: string): Observable<any> {
const params = {}; const params = {dataset:dataset};
if (nodeType === 'proteins') { if (nodeType === 'proteins') {
// @ts-ignore // @ts-ignore
params.proteins = nodes.map((node: Node) => node.drugstoneId && node.drugstoneId.startsWith('p') ? node.drugstoneId.slice(1) : undefined).filter(id => id != null); params.proteins = nodes.map((node: Node) => node.drugstoneId && node.drugstoneId.startsWith('p') ? node.drugstoneId.slice(1) : undefined).filter(id => id != null);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment