Skip to content

Commit

Permalink
Add "Phenotype score" column on reference pages
Browse files Browse the repository at this point in the history
Only show the column if data is available.

Refs #2029
  • Loading branch information
kimrutherford committed Feb 5, 2024
1 parent 13e2d68 commit 47a5ba0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<th *ngIf="showColumn['genotype_background'] && !featureInFirstColumn">Background</th>
<th *ngIf="showColumn['transcripts']">Transcript ID</th>
<th *ngIf="showColumn['evidence']">Evidence</th>
<th *ngIf="showColumn['annotation_phenotype_score']">Phenotype score</th>
<th *ngIf="showColumn['conditions']">Conditions</th>
<th *ngIf="showColumn['qualifiers']">Qualifiers</th>
<th *ngIf="showColumn['term-xref']">Source</th>
Expand Down Expand Up @@ -182,6 +183,11 @@
</span>
</span>
</td>
<td *ngIf="showColumn['annotation_phenotype_score']">
<div *ngIf="annotation.annotation_phenotype_score">
{{annotation.annotation_phenotype_score}}
</div>
</td>
<td *ngIf="showColumn['conditions']">
<ul class="conditions">
<li *ngFor="let conditionAndDetail of annotation.condition_details">
Expand Down
24 changes: 24 additions & 0 deletions src/app/annotation-sub-table/annotation-sub-table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,18 @@ export class AnnotationSubTableComponent implements OnInit, OnChanges {
}
}

hasPhenotypeScores(): boolean {
for (const termAnnotation of this.annotationTable) {
for (const annotation of termAnnotation.annotations) {
if (annotation.annotation_phenotype_score) {
return true;
}
}
}

return false;
}

init() {
this.termNameColSpan = -1;

Expand All @@ -289,6 +301,18 @@ export class AnnotationSubTableComponent implements OnInit, OnChanges {
}
}

if (typeConfig.columns_to_show_by_page_type &&
typeConfig.columns_to_show_by_page_type[this.scope]) {
for (let columnName of typeConfig.columns_to_show_by_page_type[this.scope]) {
this.showColumn[columnName] = true;
}
}

if (this.showColumn['annotation_phenotype_score'] && !this.hasPhenotypeScores()) {
// hide the column if there aren't any
this.showColumn['annotation_phenotype_score'] = false;
}

if (this.hideColumns) {
for (let columnName of this.hideColumns) {
this.showColumn[columnName] = false;
Expand Down
1 change: 1 addition & 0 deletions src/app/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ export interface AnnotationType {
inherits_from?: string;
split_by_parents?: Array<SplitByParentsConfig>;
columns_to_show?: Array<string>;
columns_to_show_by_page_type?: { [column_name: string]: Array<string> };
details_only?: boolean;
// if true, don't automatically show a gene page section for this type
no_gene_details_section?: boolean;
Expand Down
1 change: 1 addition & 0 deletions src/app/pombase-api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ export interface Annotation {
transcripts: Array<TranscriptDetails>;
reference: ReferenceShort;
evidence?: string;
annotation_phenotype_score?: string;
conditions: Array<TermShort>;
condition_details: Array<[TermShort, String]>;
assigned_by: string|undefined;
Expand Down

0 comments on commit 47a5ba0

Please sign in to comment.