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

added ndex linkout

parent 9e500923
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ export type InteractionDrugProteinDB = 'NeDRex' | 'DrugBank' | 'DrugCentral' | '
export type InteractionProteinProteinDB = 'NeDRex' | 'BioGRID' | 'IID' | 'IntAct' | 'STRING' | 'APID';
export type IndicationDrugDisorderDB = 'NeDRex' | 'CTD' | 'DrugCentral' | 'DrugBank';
export type AssociatedProteinDisorderDB = 'NeDRex' | 'DisGeNET' | 'OMIM';
export type AdvAnalysisContentTypes = 'drug-target-search' | 'drug-search' | 'enrichment-gprofiler' | 'enrichment-digest';
export type AdvAnalysisContentTypes = 'drug-target-search' | 'drug-search' | 'enrichment-gprofiler' | 'enrichment-digest' | 'search-ndex';
// TODO: should this be external or integrated in the backend?
......@@ -150,7 +150,7 @@ export const defaultConfig: IConfig = {
showItemSelector: true,
showSimpleAnalysis: true,
showAdvAnalysis: true,
showAdvAnalysisContent: ['drug-search', 'drug-target-search', 'enrichment-gprofiler', 'enrichment-digest'],
showAdvAnalysisContent: ['drug-search', 'drug-target-search', 'enrichment-gprofiler', 'enrichment-digest', 'search-ndex'],
showSelection: true,
showTasks: true,
showNetworkMenu: 'right',
......
......@@ -267,6 +267,53 @@
</a>
</div>
</div>
<div class="field" *ngIf="!drugstoneConfig.config.showAdvAnalysisContent || drugstoneConfig.config.showAdvAnalysisContent.includes('search-ndex')">
<div class="control">
<a
*ngIf="analysis.getCount() > 0"
(click)="openNDEx()"
target="_blank"
[ngClass]="{ 'text-small': drugstoneConfig.smallStyle }"
class="button is-primary is-fullwidth is-rounded has-tooltip"
pTooltip="Use NDEx Integrated Query to find similar, curated pathways (external)."
[tooltipStyleClass]="
'drgstn drgstn-tooltip drgstn-tooltip-top'
"
tooltipPosition="top"
>
<app-fa-solid-icon
classString="first-item-in-button"
icon="external-link-alt"
></app-fa-solid-icon>
<span
[ngClass]="{ 'text-small': drugstoneConfig.smallStyle }"
>
NDex Integrated Query
</span>
</a>
<a
*ngIf="analysis.getCount() === 0"
disabled
[ngClass]="{ 'text-small': drugstoneConfig.smallStyle }"
class="button is-primary is-fullwidth is-rounded has-tooltip"
pTooltip="Use NDEx Integrated Query to find similar, curated pathways (external)."
[tooltipStyleClass]="
'drgstn drgstn-tooltip drgstn-tooltip-top'
"
tooltipPosition="top"
>
<app-fa-solid-icon
icon="external-link-alt"
classString="first-item-in-button"
></app-fa-solid-icon>
<span
[ngClass]="{ 'text-small': drugstoneConfig.smallStyle }"
>
NDEx Integrated Query
</span>
</a>
</div>
</div>
</div>
</div>
</div>
......
......@@ -593,14 +593,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
* @param key
* @param values
*/
public setConfigEdgeGroup(key: string, edgeGroups: {
[key
:
string
]:
EdgeGroup;
}
) {
public setConfigEdgeGroup(key: string, edgeGroups: { [key: string]: EdgeGroup; }) {
// make sure that default-groups are set
const defaultNodeGroups = JSON.parse(JSON.stringify(defaultConfig.edgeGroups));
edgeGroups = merge(defaultNodeGroups, edgeGroups);
......@@ -621,9 +614,7 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
this.drugstoneConfig.currentConfig()[key] = edgeGroups;
}
gProfilerLink()
:
string {
gProfilerLink(): string {
// nodes in selection have drugstoneId
const queryString = this.analysis.getSelection()
.filter(wrapper => wrapper.data.drugstoneType === 'protein')
......@@ -667,6 +658,13 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
this.openExternal(url);
}
async openNDEx() {
const proteins = this.analysis.getSelection()
.filter(wrapper => wrapper.data.drugstoneType === 'protein')
.flatMap(wrapper => wrapper.data.symbol).filter(n => n != null);
this.openExternal('https://ndexbio.org/iquery/?genes=' + proteins.join('%20'));
}
//TODO change to access through network service
@ViewChild('analysisPanel')
analysisPanel;
......
......@@ -231,11 +231,17 @@ export class AnalysisService {
return this.selectedItems.has(wrapper.id);
}
getSelection(): Wrapper[] {
const out = Array.from(this.selectedItems.values());
return out != null ? out : [];
}
// getSelectionAsWrapper(): Wrapper[] {
// const out = Array.from(this.selectedItems.values());
// return out != null ? out.map(n => getWrapperFromNode(n)) : [];
// }
getCount(): number {
return this.selectedItems.size;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment