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

added modular linkout line to info panel

parent bd0ecc54
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,6 @@
</p>
<p
*ngIf="wrapper.data.uniprot"
[ngClass]="{ 'text-normal': drugstoneConfig.smallStyle }"
......@@ -74,11 +73,11 @@
[ngClass]="{ 'text-normal': drugstoneConfig.smallStyle }"
>
<b
><span
>Median expression in
{{ "'" + networkHandler.activeNetwork.selectedTissue.name + "'" }}
(TPM):</span
></b
><span
>Median expression in
{{ "'" + networkHandler.activeNetwork.selectedTissue.name + "'" }}
(TPM):</span
></b
>
<span class="is-capitalized"> {{ getExpressionScore() | number }}</span>
<span
......@@ -104,10 +103,10 @@
<b><span>ICD10:</span></b>
<span class="is-capitalized">
{{
wrapper.data.icd10.length === 0 ||
(wrapper.data.icd10.length === 1 && wrapper.data.icd10[0].length === 0)
? "-"
: wrapper.data.icd10
wrapper.data.icd10.length === 0 ||
(wrapper.data.icd10.length === 1 && wrapper.data.icd10[0].length === 0)
? "-"
: wrapper.data.icd10
}}</span
>
</p>
......@@ -137,6 +136,13 @@
<span class="is-capitalized"> MONDO:{{ wrapper.data.disorderId }}</span>
</a>
</p>
<p *ngIf="showLinks()"
[ngClass]="{ 'text-normal': drugstoneConfig.smallStyle }">
<b><span>Links:</span></b>
<span *ngFor="let target of linkoutMap | keyvalue " >
<a *ngIf="showLinkout(target.key)" [href]="getLinkoutURL(target.key)" target="_blank"> {{target.value}}</a>
</span>
</p>
<p
*ngIf="
drugstoneConfig.currentConfig().nodeGroups[
......@@ -153,16 +159,17 @@
<b><span>Group:</span></b>
<span class="is-capitalized">
{{
drugstoneConfig.currentConfig().nodeGroups[
networkHandler.activeNetwork.selectedWrapper.data[
networkHandler.activeNetwork.selectedWrapper.data.group ===
"selectedNode"
? "_group"
: "group"
drugstoneConfig.currentConfig().nodeGroups[
networkHandler.activeNetwork.selectedWrapper.data[
networkHandler.activeNetwork.selectedWrapper.data.group ===
"selectedNode"
? "_group"
: "group"
]
].groupName
}}</span
>
</p>
<app-toggle
......
......@@ -3,6 +3,7 @@ import {DrugstoneConfigService} from 'src/app/services/drugstone-config/drugston
import {Wrapper} from '../../interfaces';
import {AnalysisService} from '../../services/analysis/analysis.service';
import {NetworkHandlerService} from '../../services/network-handler/network-handler.service';
import {validateComponent} from 'codelyzer/walkerFactory/walkerFn';
@Component({
......@@ -14,6 +15,8 @@ export class InfoTileComponent implements OnInit {
@Input() public wrapper: Wrapper;
@Input() public expressions: any;
public linkoutMap = {iid: 'IID'};
constructor(public drugstoneConfig: DrugstoneConfigService, public analysis: AnalysisService, public networkHandler: NetworkHandlerService) {
}
......@@ -22,7 +25,7 @@ export class InfoTileComponent implements OnInit {
}
public getExpressionScore() {
return this.expressions[this.wrapper.id]
return this.expressions[this.wrapper.id];
}
public beautify(url: string): string {
......@@ -46,4 +49,36 @@ export class InfoTileComponent implements OnInit {
}
return out;
}
showLinks() {
const idSpace = this.drugstoneConfig.currentConfig().identifier;
const iidActive = (['symbol', 'uniprot', 'entrez'].includes(idSpace) && this.wrapper.data[idSpace] != null) || this.wrapper.data.uniprot != null;
return iidActive;
}
showLinkout(target) {
const idSpace = this.drugstoneConfig.currentConfig().identifier;
switch (target) {
case 'iid':
return (['symbol', 'uniprot', 'entrez'].includes(idSpace) && this.wrapper.data[idSpace] != null) || this.wrapper.data.uniprot != null;
}
return false;
}
getIIDQuery() {
const idSpace = this.drugstoneConfig.currentConfig().identifier;
if (['symbol', 'uniprot', 'entrez'].includes(idSpace) && this.wrapper.data[idSpace] != null) {
return this.wrapper.data[idSpace][0];
}
return this.wrapper.data.uniprot[0];
}
getLinkoutURL(target) {
// const idSpace = this.drugstoneConfig.currentConfig().identifier;
switch (target) {
case 'iid':
return 'http://iid.ophid.utoronto.ca/SearchPPIs/protein/' + this.getIIDQuery();
}
return '';
}
}
......@@ -118,12 +118,12 @@ menu<br>
<!-- network='{"nodes":[{"id":"CFTr","group":"important","label":"CFTR"},{"id":"TGFB1","group":"gene","label":"TGFB1"},{"id":"TNFRSF1A","group":"gene","label":"TNFRSF1A"},{"id":"FCGR2A","group":"gene","label":"FCGR2A"},{"id":"ENG","group":"gene","label":"ENG"},{"id":"DCTN4","group":"gene","label":"DCTN4"},{"id":"CLCA4","group":"gene","label":"CLCA4"},{"id":"STX1A","group":"gene","label":"STX1A"},{"id":"SCNN1G","group":"gene","label":"SCNN1G"},{"id":"SCNN1A","group":"gene","label":"SCNN1A"},{"id":"SCNN1B","group":"gene","label":"SCNN1B"}],"edges":[{"from":"DCTN4","to":"CFTR", "weight": "5"},{"from":"STX1A","to":"SCNN1B","group":"default"},{"from":"SCNN1A","to":"SCNN1G","group":"default"},{"from":"SCNN1B","to":"SCNN1G","group":"default"}]}'>-->
<!-- ></drugst-one>-->
<!-- <drugst-one id="netexp1"-->
<!-- pluginId="2"-->
<!-- groups='{"nodeGroups":{}}'-->
<!-- config='{"identifier":"entrez","title":"Breast cancer example network","nodeShadow":true,"edgeShadow":false,"autofillEdges":true,"interactionProteinProtein":"STRING","selfReferences":false}'-->
<!-- network='{"nodes":[{"id":"7040","label":"7040"}]}'>-->
<!-- </drugst-one>-->
<!-- <drugst-one id="netexp1"-->
<!-- pluginId="2"-->
<!-- groups='{"nodeGroups":{}}'-->
<!-- config='{"identifier":"entrez","title":"Breast cancer example network","nodeShadow":true,"edgeShadow":false,"autofillEdges":true,"interactionProteinProtein":"STRING","selfReferences":false}'-->
<!-- network='{"nodes":[{"id":"7040","label":"7040"}]}'>-->
<!-- </drugst-one>-->
<!--ENSEMBL test-->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment