diff --git a/src/app/components/query-tile/query-tile.component.html b/src/app/components/query-tile/query-tile.component.html index 8a56ce0d5ed247add5cf4d16b3dd56c578fa825e..df4695b18b3c8236011623a4095c4a7970bf72c3 100644 --- a/src/app/components/query-tile/query-tile.component.html +++ b/src/app/components/query-tile/query-tile.component.html @@ -1,10 +1,8 @@ <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> diff --git a/src/app/components/query-tile/query-tile.component.ts b/src/app/components/query-tile/query-tile.component.ts index 322fc3c97e844da1b3771bd1b9ac95d395a8785c..4a413c1e6c72eec60c3026c321d42ae2c83adac0 100644 --- a/src/app/components/query-tile/query-tile.component.ts +++ b/src/app/components/query-tile/query-tile.component.ts @@ -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) { diff --git a/src/app/pages/explorer-page/explorer-page.component.html b/src/app/pages/explorer-page/explorer-page.component.html index ad564a752c5e52390417082138028c245983c2d9..6529540ef8183fb02f5e832a3d21d4e437a2e457 100644 --- a/src/app/pages/explorer-page/explorer-page.component.html +++ b/src/app/pages/explorer-page/explorer-page.component.html @@ -440,34 +440,33 @@ <i class="fas fa-angle-left" aria-hidden="true"></i> </span> - </a> - </header> - <div *ngIf="collapseSelection" class="seed-selection" [ngClass]="{'text-normal':smallStyle}"> - <div class="card-content overflow"> - <table class="table selection-table" *ngIf="analysis.getCount() > 0"> - <thead> - <tr> - <td>Label</td> - <td>Actions</td> - </tr> - </thead> - <tbody> - <tr *ngFor="let p of analysis.getSelection()"> - <td><p class="is-capitalized">{{p.data.label}}</p></td> - <td> - <button (click)="analysis.removeItems([p])" - class="button is-small is-danger is-outlined has-tooltip" - tooltipPosition="top" pTooltip="Remove from selection."> - <i class="fa fa-trash"></i> - </button> - </td> - </tr> - </tbody> - </table> - <i *ngIf="analysis.getCount() === 0"> - Double-click on a protein to select it for the analysis. - </i> - </div> + </a> + </header> + <div *ngIf="collapseSelection" class="seed-selection" [ngClass]="{'text-normal':smallStyle}"> + <!-- <div class="card-content overflow"> + <table class="table selection-table" *ngIf="analysis.getCount() > 0"> + <thead> + <tr> + <td>Label</td> + <td>Actions</td> + </tr> + </thead> + <tbody> + <tr *ngFor="let p of analysis.getSelection()"> + <td><p class="is-capitalized">{{p.data.label}}</p></td> + <td> + <button (click)="analysis.removeItems([p])" class="button is-small is-danger is-outlined has-tooltip" + tooltipPosition="top" pTooltip="Remove from selection."> + <i class="fa fa-trash"></i> + </button> + </td> + </tr> + </tbody> + </table> + <i *ngIf="analysis.getCount() === 0"> + Double-click on a protein to select it for the analysis. + </i> + </div> <footer class="card-footer" *ngIf="selectedAnalysisToken"> <a (click)="analysis.addSeeds(currentViewNodes)" @@ -511,10 +510,10 @@ <span> Tissue proteins </span> - </a> - </footer> + </a> + </footer> --> - <footer class="card-footer"> + <!-- <footer class="card-footer"> <a (click)="analysis.invertSelection(currentViewNodes)" class="card-footer-item text-primary" tooltipPosition="top" pTooltip="Invert the current selection."> <span class="icon"> @@ -533,7 +532,7 @@ Reset </span> </a> - </footer> + </footer> --> </div> </div> diff --git a/src/app/services/analysis/analysis.service.ts b/src/app/services/analysis/analysis.service.ts index 97b4accc495912b24eb2b3087aaa1c0732afcffc..bcfaf5e8856e465e1a916fa2c556bd6c445b4e86 100644 --- a/src/app/services/analysis/analysis.service.ts +++ b/src/app/services/analysis/analysis.service.ts @@ -157,9 +157,10 @@ 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); } }); this.selectedItems.clear(); diff --git a/src/theme-styles.scss b/src/theme-styles.scss index 909d08978e6de9f5d222c48e50d94c766ce9d9c1..afda6f0cfa70d66cc70efb5dfaf5396b72f72fd3 100644 --- a/src/theme-styles.scss +++ b/src/theme-styles.scss @@ -191,7 +191,6 @@ a:hover { } - .p-tooltip-text, .p-tooltip-arrow { background: var(--drgstn-tooltip) !important; border-radius: 2px !important;