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

querz nodes

parent 1fd96407
No related branches found
No related tags found
No related merge requests found
<div class="content"> <div class="content">
<ng-select [items]="queryItems" bindLabel="id" bindValue="data" [virtualScroll]="true" class="custom" <ng-select [items]="queryItems" bindLabel="label" bindValue="data" [virtualScroll]="true" class="custom"
placeholder="Search..." [hideSelected]="true" [searchFn]="querySearch" (change)="select($event)" pTooltip="Find proteins in the network." tooltipPosition="top"> placeholder="Search..." [hideSelected]="true" [searchFn]="querySearch" (change)="select($event)" pTooltip="Find nodes in the network." tooltipPosition="top">
<ng-template ng-option-tmp let-item="item"> <ng-template ng-option-tmp let-item="item">
<b *ngIf="item.data.netexId && item.data.netexId.startsWith('p')"> {{item.data.name}}</b> <p>{{item.data.label}}</p>
<span><small *ngIf="item.data.netexId && item.data.netexId.startsWith('p')">Protein</small> | </span>
<span *ngIf="item.data.netexId && item.data.netexId.startsWith('p')"><small>AC: <b>{{item.data.uniprotAc}}</b></small> </span>
</ng-template> </ng-template>
</ng-select> </ng-select>
</div> </div>
...@@ -15,7 +15,13 @@ export class QueryTileComponent { ...@@ -15,7 +15,13 @@ export class QueryTileComponent {
querySearch(term: string, item: Wrapper) { querySearch(term: string, item: Wrapper) {
term = term.toLowerCase(); term = term.toLowerCase();
const data = item.data as Node; const data = item.data as Node;
return data.symbol.toLowerCase().indexOf(term) > -1 || data.uniprotAc.toLowerCase().indexOf(term) > -1; if (data.netexId === undefined) {
return data.label.toLowerCase().indexOf(term) > -1 || data.id.toLowerCase().indexOf(term) > -1
} else {
data.ensg = data.ensg.map(x => x.toLowerCase())
return data.symbol.toLowerCase().indexOf(term) > -1 || data.uniprotAc.toLowerCase().indexOf(term) > -1 ||
data.label.toLowerCase().indexOf(term) > -1 || data.ensg.includes(term) || data.id.toLowerCase().indexOf(term) > -1 ;
}
} }
select(item) { select(item) {
......
...@@ -157,12 +157,12 @@ export class AnalysisService { ...@@ -157,12 +157,12 @@ export class AnalysisService {
public invertSelection(nodes) { public invertSelection(nodes) {
const newSelection = []; const newSelection = [];
nodes.forEach((node) => { nodes.forEach((node: Node) => {
if (!this.inSelection(node)) { const wrapper = getWrapperFromNode(node);
newSelection.push(node); if (!this.inSelection(wrapper)) {
newSelection.push(wrapper);
} }
}); });
console.log(nodes)
this.selectedItems.clear(); this.selectedItems.clear();
for (const wrapper of newSelection) { for (const wrapper of newSelection) {
this.selectedItems.set(wrapper.nodeId, wrapper); this.selectedItems.set(wrapper.nodeId, wrapper);
......
...@@ -187,7 +187,6 @@ a:hover { ...@@ -187,7 +187,6 @@ a:hover {
} }
.p-tooltip-text, .p-tooltip-arrow { .p-tooltip-text, .p-tooltip-arrow {
background: var(--drgstn-tooltip) !important; background: var(--drgstn-tooltip) !important;
border-radius: 2px !important; border-radius: 2px !important;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment