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

AG-959 gene hero surface ensembl version #1267

Merged
merged 4 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
9 changes: 5 additions & 4 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ name: Node.js CI

on:
sagely1 marked this conversation as resolved.
Show resolved Hide resolved
push:
branches: [ "develop" ]
branches: [ develop, main ]
pull_request:
branches: [ "develop" ]
branches: [ develop, main ]

jobs:
build:

timeout-minutes: 60

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
# Allow OIDC Integration (so we can assume the AWS role to deploy)
# permissions:
Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/playwright.yml

This file was deleted.

14 changes: 8 additions & 6 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { defineConfig, devices } from '@playwright/test';

export const baseURL = 'http://localhost:8080';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
Expand All @@ -24,7 +26,7 @@ export default defineConfig({
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: 'http://127.0.0.1:8080',
baseURL: baseURL,

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
Expand Down Expand Up @@ -69,9 +71,9 @@ export default defineConfig({
],

/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
webServer: {
command: 'npm run start',
url: baseURL,
reuseExistingServer: !process.env.CI,
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,32 @@ <h2 class="gene-hero-name">
<p class="gene-hero-provider">
{{ getSummary() }}
</p>
<ng-container *ngIf="gene.bio_domains || getAlias()">
<ng-container *ngIf="gene.bio_domains || getAlias() || getEnsemblUrl() !== ''">
<hr />
<div *ngIf="gene.bio_domains" class="gene-hero-biodomains">
<h4 class="gene-hero-biodomains-heading">Biological Domains</h4>
<p>
{{ getBiodomains() }}
</p>
</div>
<div *ngIf="getAlias()" class="gene-hero-aliases">
<div class="gene-hero-aliases">
<h4 class="gene-hero-aliases-heading">Also known as</h4>
<p *ngIf="gene.hgnc_symbol" class="mb-0">{{ gene.ensembl_gene_id }}</p>
<p>
<ng-container *ngIf="getEnsemblUrl() !== ''">
<p>
<a [href]="getEnsemblUrl()" target="_blank">{{ gene.ensembl_gene_id }}</a>
<span *ngIf="gene.ensembl_info[0].ensembl_release">
(Ensembl Release {{ gene.ensembl_info[0].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[0].ensembl_possible_replacements.length > 0">
<a [href]="getPossibleReplacementsURL()">Possible replacement value<span *ngIf="gene.ensembl_info[0].ensembl_possible_replacements.length > 1">s</span></a>:
{{ gene.ensembl_info[0].ensembl_possible_replacements.join(', ')}}
</p>
<p *ngIf="getAlias() !== ''">
{{ getAlias() }}
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,7 @@ hr {
text-transform: uppercase;
margin-bottom: 15px;
}

.possible-replacements {
margin-bottom: 15px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { RouterTestingModule } from '@angular/router/testing';
// Internal
// -------------------------------------------------------------------------- //
import { GeneHeroComponent } from './';
import { geneMock1, geneMock3 } from '../../../../testing';
import { geneMissingEnsemblInfo, geneMock1, geneMock3 } from '../../../../testing';

// -------------------------------------------------------------------------- //
// Tests
Expand Down Expand Up @@ -110,4 +110,20 @@ describe('Component: Gene Hero', () => {
const expected = 'Immune Response, Lipid Metabolism, Structural Stabilization, Synapse, Vasculature';
expect(component.getBiodomains()).toBe(expected);
});

it('should return the ensembl permalink', () => {
component.gene = geneMock1;
expect(component.getEnsemblUrl()).toBe('https://may2015.archive.ensembl.org/Homo_sapiens/Gene/Summary?db=core;g=ENSG00000264794');
});
sagely1 marked this conversation as resolved.
Show resolved Hide resolved

it('should return an empty string if the gene is missing ensembl info', () => {
// if gene does not have a url
component.gene = geneMissingEnsemblInfo;
expect(component.getEnsemblUrl()).toBe('');
});

it('should return a url with ensembl id', () => {
component.gene = geneMock1;
expect(component.getPossibleReplacementsURL()).toBe('https://useast.ensembl.org/Homo_sapiens/Gene/Idhistory?g=ENSG00000147065');
});
});
11 changes: 11 additions & 0 deletions src/app/features/genes/components/gene-hero/gene-hero.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,15 @@ export class GeneHeroComponent {
.sort(ascending);
return biodomains.join(', ');
}

getEnsemblUrl() {
if (!this.gene?.ensembl_info || this.gene.ensembl_info.length <= 0)
return '';
return this.gene?.ensembl_info[0].ensembl_permalink;
}

getPossibleReplacementsURL() {
let url = 'https://useast.ensembl.org/Homo_sapiens/Gene/Idhistory?g=';
return url += this.gene?.ensembl_gene_id;
}
}
5 changes: 5 additions & 0 deletions src/app/models/EnsemblInfo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface EnsemblInfo {
ensembl_release: number;
ensembl_possible_replacements: string[];
ensembl_permalink: string;
}
3 changes: 3 additions & 0 deletions src/app/models/genes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
SimilarGenesNetwork,
BioDomains
} from './';
import { EnsemblInfo } from './EnsemblInfo';

export interface TargetNomination {
source: string;
Expand Down Expand Up @@ -98,6 +99,8 @@ export interface Gene {
input_data_display_value?: string;

bio_domains?: BioDomains;

ensembl_info: EnsemblInfo[];
sagely1 marked this conversation as resolved.
Show resolved Hide resolved
}

export interface GenesResponse {
Expand Down
Loading
Loading