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">
<ng-select [items]="queryItems" bindLabel="id" bindValue="data" [virtualScroll]="true" class="custom"
placeholder="Search..." [hideSelected]="true" [searchFn]="querySearch" (change)="select($event)" pTooltip="Find proteins in the network." tooltipPosition="top">
<ng-select [items]="queryItems" bindLabel="label" bindValue="data" [virtualScroll]="true" class="custom"
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">
<b *ngIf="item.data.netexId && item.data.netexId.startsWith('p')"> {{item.data.name}}</b>
<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>
<p>{{item.data.label}}</p>
</ng-template>
</ng-select>
</div>
......@@ -15,7 +15,13 @@ export class QueryTileComponent {
querySearch(term: string, item: Wrapper) {
term = term.toLowerCase();
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) {
......
......@@ -157,12 +157,12 @@ export class AnalysisService {
public invertSelection(nodes) {
const newSelection = [];
nodes.forEach((node) => {
if (!this.inSelection(node)) {
newSelection.push(node);
nodes.forEach((node: Node) => {
const wrapper = getWrapperFromNode(node);
if (!this.inSelection(wrapper)) {
newSelection.push(wrapper);
}
});
console.log(nodes)
this.selectedItems.clear();
for (const wrapper of newSelection) {
this.selectedItems.set(wrapper.nodeId, wrapper);
......
......@@ -187,7 +187,6 @@ a:hover {
}
.p-tooltip-text, .p-tooltip-arrow {
background: var(--drgstn-tooltip) !important;
border-radius: 2px !important;
......
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