Skip to content

Commit

Permalink
adding uniprotkb_accessions links
Browse files Browse the repository at this point in the history
  • Loading branch information
sagely1 committed Nov 27, 2024
1 parent 651b087 commit d78f439
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,39 @@ <h2 class="gene-hero-name">
<p class="gene-hero-provider">
{{ getSummary() }}
</p>
<ng-container *ngIf="gene.bio_domains || getAlias() || getEnsemblUrl() !== ''">
<ng-container *ngIf="gene.bio_domains || getAliases() || getEnsemblUrl() !== ''">
<hr />
<div *ngIf="gene.bio_domains" class="gene-hero-biodomains">
<h4 class="gene-hero-biodomains-heading">Biological Domains</h4>
<p>
{{ getBiodomains() }}
&nbsp; {{ getBiodomains() }}
</p>
</div>
<div class="gene-hero-aliases">
<h4 class="gene-hero-aliases-heading">Also known as</h4>
<ng-container *ngIf="getEnsemblUrl() !== ''">
<p>
<a [href]="getEnsemblUrl()" target="_blank">{{ gene.ensembl_gene_id }}</a>
<p class="aliases">
&nbsp; <a [href]="getEnsemblUrl()" target="_blank">{{ gene.ensembl_gene_id }}</a>
<span *ngIf="gene.ensembl_info.ensembl_release">
(Ensembl Release {{ gene.ensembl_info.ensembl_release }})
</span>
</p>
</ng-container>
<ng-container *ngIf="getEnsemblUrl() === ''">
<span *ngIf="getEnsemblUrl() === ''">{{ gene.ensembl_gene_id }}</span>
</ng-container>
<p *ngIf="gene.ensembl_info.ensembl_possible_replacements.length > 0">
<a [href]="getPossibleReplacementsURL()">Possible replacement value<span *ngIf="gene.ensembl_info.ensembl_possible_replacements.length > 1">s</span></a>:
<p *ngIf="getEnsemblUrl() === ''">
&nbsp; <span *ngIf="getEnsemblUrl() === ''">{{ gene.ensembl_gene_id }}</span>
</p>
<p *ngIf="gene.ensembl_info.ensembl_possible_replacements.length > 0" class="aliases">
&nbsp; <a [href]="getPossibleReplacementsURL()">Possible replacement value<span *ngIf="gene.ensembl_info.ensembl_possible_replacements.length > 1">s</span></a>:
{{ gene.ensembl_info.ensembl_possible_replacements.join(', ')}}
</p>
<p *ngIf="getAlias() !== ''">
{{ getAlias() }}
<p *ngIf="gene.uniprotkb_accessions" class="aliases">
&nbsp; UNIPROTKB
<ng-container *ngFor="let accession of gene.uniprotkb_accessions; let isLast = last" class="aliases">
<a [href]="getUniProtKBLink(accession)" target="_blank">{{ accession }}</a><span *ngIf="!isLast">, </span>
</ng-container>
</p>
<p *ngIf="gene.alias.length > 0" class="aliases">
&nbsp; {{ getAliases() }}
</p>
</div>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ hr {
margin-bottom: 15px;
}

.aliases {
margin-bottom: 0;
}

.possible-replacements {
margin-bottom: 15px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,20 @@ export class GeneHeroComponent {
}
}

getAlias(): string {
getAliases(): string {
if (this.gene?.alias && this.gene.alias.length > 0) {
return this.gene.alias.join(', ');
}
return '';
}

getUniProtKBLink(uniProtId: string) {
if (uniProtId) {
return `https://www.uniprot.org/uniprotkb/${uniProtId}/entry`;
}
return '';
}

getBiodomains(): string {
if (!this.gene || !this.gene.bio_domains)
return '';
Expand Down
1 change: 1 addition & 0 deletions src/app/models/genes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export interface Gene {
summary: string;
hgnc_symbol: string;
alias: string[];
uniprotkb_accessions: string[];
is_igap: boolean;
is_eqtl: boolean;
is_any_rna_changed_in_ad_brain: boolean;
Expand Down
1 change: 1 addition & 0 deletions src/server/models/genes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const GeneSchema = new Schema<Gene>(
summary: { type: String, required: true },
hgnc_symbol: { type: String, required: true },
alias: [{ type: String, required: true }],
uniprotkb_accessions: [{ type: String, required: true }],
is_igap: { type: Boolean, required: true },
is_eqtl: { type: Boolean, required: true },
is_any_rna_changed_in_ad_brain: { type: Boolean, required: true },
Expand Down

0 comments on commit d78f439

Please sign in to comment.