Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gene alleles page fixes #2149

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule, NoPreloading } from '@angular/router';

import { GeneDetailsComponent } from './gene-details/gene-details.component';
import { GeneAlleleListComponent } from './gene-allele-list/gene-allele-list.component';
import { GeneProteinFeaturesComponent } from './gene-protein-features/gene-protein-features.component';
import { GenotypeDetailsComponent } from './genotype-details/genotype-details.component';
import { AlleleDetailsComponent } from './allele-details/allele-details.component';
Expand All @@ -25,13 +24,14 @@ import { IdentifierMapperResultsComponent } from './identifier-mapper-results/id
import { getAppConfig } from './config';
import { RefGenesViewComponent } from './ref-genes-view/ref-genes-view.component';
import { CurationStatsComponent } from './curation-stats/curation-stats.component';
import { GeneAllelesPageComponent } from './gene-alleles-page/gene-alleles-page.component';

const routes: Routes = [
{ path: 'gene/:uniquename', component: GeneDetailsComponent,
data: {
}
},
{ path: 'gene_alleles/:uniquename', component: GeneAlleleListComponent,
{ path: 'gene_alleles/:uniquename', component: GeneAllelesPageComponent,
data: {
}
},
Expand Down
2 changes: 2 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ import { RefGenesViewComponent } from './ref-genes-view/ref-genes-view.component
import { CurationStatsComponent } from './curation-stats/curation-stats.component';
import { AnnotationTableWidgetsComponent } from './annotation-table-widgets/annotation-table-widgets.component';
import { StatsSummaryComponent } from './stats-summary/stats-summary.component';
import { GeneAllelesPageComponent } from './gene-alleles-page/gene-alleles-page.component';

@Pipe({ name: 'safeUrl' })
export class SafeUrlPipe implements PipeTransform {
Expand Down Expand Up @@ -280,6 +281,7 @@ export class SafeUrlPipe implements PipeTransform {
CurationStatsComponent,
AnnotationTableWidgetsComponent,
StatsSummaryComponent,
GeneAllelesPageComponent,
],
imports: [
BrowserModule,
Expand Down
4 changes: 4 additions & 0 deletions src/app/gene-allele-list/gene-allele-list.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ td {
padding-left: 0.5em;
border-left: 2px solid black;
}

.view-genotype {
white-space: nowrap;
}
88 changes: 25 additions & 63 deletions src/app/gene-allele-list/gene-allele-list.component.html
Original file line number Diff line number Diff line change
@@ -1,85 +1,47 @@
<div *ngIf="geneDetails" class="gene-alleles-page">

<div class="details-page-name-and-id">
<div class="gene-alleles-name-id">
<span class="details-page-name-and-id-prefix">Alleles of:</span>
<a routerLink="/gene/{{geneDetails.uniquename}}">
<span *ngIf="geneDetails.name">{{geneDetails.name}} ({{geneDetails.uniquename}})</span>
<span *ngIf="!geneDetails.name">{{geneDetails.uniquename}}</span>
</a>
</div>
</div>

<div class="gene-alleles-controls">
Show genotypes:
<a (click)="showAllGenotypes()">All</a>
<a (click)="hideAllGenotypes()">None</a>
</div>

<table class="gene-alleles-table">
<thead>
<tr>
<th>
<a *ngIf="sortByColumnName != 'name'" (click)="sortBy('name')" title="Click to sort by name" >
<a *ngIf="sortByColumnName != 'name' && alleles.length > 1" (click)="sortBy('name')" title="Click to sort by name" >
Name <img title="Click to sort by name" src="assets/sort_both.svg">
</a>
<span *ngIf="sortByColumnName == 'name'" title="Sorted by name">
Name <img title="Sorted by name" src="assets/sort_up.svg">
<span *ngIf="sortByColumnName == 'name' || alleles.length == 1" title="Sorted by name">
Name <img *ngIf="alleles.length != 1" title="Sorted by name" src="assets/sort_up.svg">
</span>
</th>
<th>
<a *ngIf="sortByColumnName != 'description'" (click)="sortBy('description')"title="Click to sort by description">
<a *ngIf="sortByColumnName != 'description' && alleles.length > 1" (click)="sortBy('description')"title="Click to sort by description">
Description <img title="Click to sort by description" src="assets/sort_both.svg">
</a>
<span *ngIf="sortByColumnName == 'description'" title="Sorted by description">
Description <img title="Sorted by description" src="assets/sort_up.svg">
<span *ngIf="sortByColumnName == 'description' || alleles.length == 1" title="Sorted by description">
Description <img *ngIf="alleles.length != 1" title="Sorted by description" src="assets/sort_up.svg">
</span>
</th>

<th>
<a *ngIf="sortByColumnName != 'type'" (click)="sortBy('type')" title="Click to sort by type">
<a *ngIf="sortByColumnName != 'type' && alleles.length > 1" (click)="sortBy('type')" title="Click to sort by type">
Type <img title="Click to sort by type" src="assets/sort_both.svg">
</a>
<span *ngIf="sortByColumnName == 'type'" title="Sorted by type">
Type <img title="Sorted by type" src="assets/sort_up.svg">
<span *ngIf="sortByColumnName == 'type' || alleles.length == 1" title="Sorted by type">
Type <img *ngIf="alleles.length != 1" title="Sorted by type" src="assets/sort_up.svg">
</span>
</th>
<th *ngIf="anyVisibleGenotypes()">Expression</th>
<th *ngIf="anyVisibleGenotypes()">Genotype</th>
</tr>
</thead>
<ng-container *ngFor="let allele of alleleTable">
<ng-container *ngFor="let expressedAllele of allele.expressedAlleles; let expressedAlleleIndex = index">
<tr *ngFor="let genotype of expressedAllele.genotypes; let genotypeIndex = index">
<ng-container *ngIf="expressedAlleleIndex == 0 && genotypeIndex == 0">
<td *ngIf="expressedAlleleIndex == 0 && genotypeIndex == 0" [attr.rowspan]="alleleRowspan(allele)">
<a *ngIf="!deployConfigService.productionMode()" routerLink="/allele/{{allele.alleleUniquename}}">{{allele.alleleName}}</a>
<span *ngIf="deployConfigService.productionMode()">{{allele.alleleName}}</span>
</td>
<td *ngIf="expressedAlleleIndex == 0 && genotypeIndex == 0" [attr.rowspan]="alleleRowspan(allele)">
{{allele.alleleDescription}}
</td>
<td *ngIf="expressedAlleleIndex == 0 && genotypeIndex == 0" [attr.rowspan]="alleleRowspan(allele)">
{{allele.alleleType}}
</td>
<td *ngIf="!genotypesVisible(allele) && anyVisibleGenotypes()">

</td>
<td *ngIf="!genotypesVisible(allele)">
<a (click)="showGenotypes(allele)">Show genotypes..</a>
</td>
</ng-container>

<td *ngIf="genotypesVisible(allele) && genotypeIndex == 0" [attr.rowspan]="expressedAllele.genotypes.length"
class="expression-cell">
<div class="expression">{{expressedAllele.expression}}</div>
</td>
<td class="genotype" *ngIf="genotypesVisible(allele)">
<app-genotype-link [genotype]="genotype"></app-genotype-link>
</td>
</tr>
</ng-container>
</ng-container>
<tr *ngFor="let allele of displayAlleles">
<td>
<a [popover]="'View details of ' + allele.name" triggers="mouseenter:mouseleave" container="body"
routerLink="/allele/{{allele.uniquename}}"><span [innerHtml]="allele.displayName"></span></a>
</td>
<td>
<span [innerHtml]="allele.description"></span>
</td>
<td>
{{allele.alleleType}}
</td>
<td>
<a [popover]="'View details of ' + allele.name" triggers="mouseenter:mouseleave" container="body"
class="view-genotype" routerLink="/allele/{{allele.uniquename}}">View genotypes..</a>
</td>
</tr>
</table>

</div>
Loading
Loading