Skip to content

Commit

Permalink
Only show GN logo when in HGVSg page (oncokb#989)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhx828 authored Jun 20, 2023
1 parent 1bcb668 commit cb06fd4
Show file tree
Hide file tree
Showing 12 changed files with 370 additions and 29 deletions.
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,6 @@ To launch your application's tests, run:
./mvnw verify
```

### Client tests

Unit tests are run by [Jest][] and written with [Jasmine][]. They're located in [src/test/javascript/](src/test/javascript/) and can be run with:

```
yarn test
```

For more information, refer to the [Running tests page][].

### Screenshot tests

Screenshot tests are run by [Jest][], [Puppeteer][]. They're located in [screenshot-test/](screenshot-test/). Because different dev environments have different systems, which may cause the resulting image doesn’t quite match the expected one from the [`__baseline_snapshots__`](screenshot-test/__baseline_snapshots__/) directory saved in source control, we dockerized the test process and can be run with:
Expand All @@ -171,6 +161,8 @@ Screenshot tests are run by [Jest][], [Puppeteer][]. They're located in [screens
yarn run screenshot-test-in-docker
```

You can also run screenshot-test locally using `yarn run screenshot-test`

#### Update screenshot tests

After running the command above, you will see `__diff_output__` and `__latest_snapshots__` folders created under `screenshot-test`. These new images indicate potential changes. If these changes are expected, please follow the below steps to update the images under `__baseline_snapshots__`.
Expand Down
48 changes: 45 additions & 3 deletions screenshot-test/AnnotationPages.screenshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ const brafV600eRelevantAlterations = fs.readFileSync(`${DATA_DIR}api-private-uti
// Mainly test the therapeutic/fda data for solid disease
const brafV600eHgvsgVariantAnnotation = fs.readFileSync(`${DATA_DIR}api-private-utils-variantAnnotation-BRAF-V600E-HGVSG.json`).toString();

// APC G279Ffs*10 HGVSg page - API response data
// Mainly test the revue icon is shown properly
const apcGeneQuery = fs.readFileSync(`${DATA_DIR}api-v1-genes-APC.json`).toString();
const apcBiologicalVariants = fs.readFileSync(`${DATA_DIR}api-private-search-variants-bio-APC.json`).toString();
const apcFSHgvsgVariantAnnotation = fs.readFileSync(`${DATA_DIR}api-private-utils-variantAnnotation-APC-HGVSG.json`).toString();


// BRAF V600E Hairy Cell Leukemia page - API response data
// Mainly test the therapeutic/diagnostic data for heme disease
Expand Down Expand Up @@ -240,9 +246,6 @@ function getMockResponse(url){
};
break;




// TP53 Deletion
case `${SERVER_URL}api/private/utils/numbers/gene/TP53`:
res = {
Expand Down Expand Up @@ -373,6 +376,36 @@ function getMockResponse(url){
};
break;

// APC G279Ffs*10
case `${SERVER_URL}api/v1/genes/lookup?query=APC`:
res = {
status: 200,
contentType: 'application/json',
body: apcGeneQuery
};
break;
case `${SERVER_URL}api/v1/variants/lookup?hugoSymbol=APC&variant=G279Ffs*10`:
res = {
status: 200,
contentType: 'application/json',
body: '[]'
};
break;
case `${SERVER_URL}api/private/search/variants/biological?hugoSymbol=APC`:
res = {
status: 200,
contentType: 'application/json',
body: apcBiologicalVariants
};
break;
case `${SERVER_URL}api/private/utils/variantAnnotation?referenceGenome=GRCh37&hgvsg=5%3Ag.112151184A%3EG`:
res = {
status: 200,
contentType: 'application/json',
body: apcFSHgvsgVariantAnnotation
};
break;



default:
Expand Down Expand Up @@ -446,6 +479,15 @@ describe('Tests with login', () => {
expect(image).toMatchImageSnapshot({ customSnapshotIdentifier: 'HGVSg Page with Login' });
})

it('HGVSg Page - reVUE', async() => {
// this is a variant that reannotated by reVUE. APC G279Ffs*10
await page.goto(`${CLIENT_URL}hgvsg/5:g.112151184A>G?refGenome=GRCh37`);
await page.setViewport(VIEW_PORT_1080);
await page.waitFor(WAITING_TIME);
let image = await page.screenshot(getScreenshotConfig('HGVSg Page on VUE variant with Login'));
expect(image).toMatchImageSnapshot({ customSnapshotIdentifier: 'HGVSg Page on VUE variant with Login' });
})

afterAll(async () => {
await browser.close();
})
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
222 changes: 222 additions & 0 deletions screenshot-test/data/api-private-search-variants-bio-APC.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
[
{
"mutationEffectDescription": "The APC R640G mutation is located in the Armadillo repeat region of the APC protein. This mutation has been found as a germline mutation in familial adenomatous polyposis (FAP), a cancer predisposition syndrome. In vitro studies have demonstrated that this mutation is likely inactivating as measured by defective splicing of the APC protein compared to wildtype (PMID: 19111562).",
"variant": {
"gene": {
"entrezGeneId": 324,
"hugoSymbol": "APC",
"oncogene": false,
"grch37Isoform": "ENST00000257430",
"grch37RefSeq": "NM_000038.5",
"grch38Isoform": "ENST00000257430",
"grch38RefSeq": "NM_000038.5",
"geneAliases": [
"PPP1R46",
"DP2.5"
],
"genesets": [],
"tsg": true
},
"consequence": {
"term": "missense_variant",
"isGenerallyTruncating": false,
"description": "A sequence variant, that changes one or more bases, resulting in a different amino acid sequence but where the length is preserved"
},
"alteration": "R640G",
"name": "R640G",
"refResidues": "R",
"proteinStart": 640,
"proteinEnd": 640,
"variantResidues": "G",
"referenceGenomes": [
"GRCh37",
"GRCh38"
]
},
"mutationEffect": "Loss-of-function",
"mutationEffectPmids": [
"19111562"
],
"mutationEffectAbstracts": [],
"oncogenic": "Oncogenic",
"oncogenicPmids": [],
"oncogenicAbstracts": []
},
{
"mutationEffectDescription": "APC deletions have been detected in patients with familial adenomatous polyposis (PMID: 15643602, 25317407). These alterations predominantly encompass the entire APC locus leading to haploinsuffuciciency (PMID: 11867715). Based on the function of APC as a tumor suppressor, loss of APC through deletion mutations is likely to result in aberrant WNT-pathway activation and is associated with hyperplasia and eventual tumor progression (PMID: 8259511).",
"variant": {
"gene": {
"entrezGeneId": 324,
"hugoSymbol": "APC",
"oncogene": false,
"grch37Isoform": "ENST00000257430",
"grch37RefSeq": "NM_000038.5",
"grch38Isoform": "ENST00000257430",
"grch38RefSeq": "NM_000038.5",
"geneAliases": [
"PPP1R46",
"DP2.5"
],
"genesets": [],
"tsg": true
},
"consequence": {
"term": "NA",
"isGenerallyTruncating": false,
"description": "NA"
},
"alteration": "Deletion",
"name": "Deletion",
"refResidues": null,
"proteinStart": -1,
"proteinEnd": 100000,
"variantResidues": null,
"referenceGenomes": [
"GRCh37",
"GRCh38"
]
},
"mutationEffect": "Likely Loss-of-function",
"mutationEffectPmids": [
"8259511",
"15643602",
"25317407",
"11867715"
],
"mutationEffectAbstracts": [],
"oncogenic": "Likely Oncogenic",
"oncogenicPmids": [],
"oncogenicAbstracts": []
},
{
"mutationEffectDescription": "Truncating APC mutations result in loss of full-length APC protein leading to impaired or abnormal APC function. APC deregulation is associated with accumulation of β-catenin, an oncogenic transcription factor, which in turn leads to aberrant target gene expression and tumorigenesis (PMID: 11062151). APC truncating mutations are typically early events occurring on a single allele (germline or somatic); however, the tumor often acquires a second hit on the second allele, reducing the overall amount of functional APC in the cell (PMID: 11257105). Furthermore, expression of truncating mutations of APC has been shown to result in chromosomal instability in a dominant manner, postulated to play an important role in the accumulation of additional oncogenic alterations (PMID: 15561772).",
"variant": {
"gene": {
"entrezGeneId": 324,
"hugoSymbol": "APC",
"oncogene": false,
"grch37Isoform": "ENST00000257430",
"grch37RefSeq": "NM_000038.5",
"grch38Isoform": "ENST00000257430",
"grch38RefSeq": "NM_000038.5",
"geneAliases": [
"PPP1R46",
"DP2.5"
],
"genesets": [],
"tsg": true
},
"consequence": {
"term": "feature_truncation",
"isGenerallyTruncating": true,
"description": "A sequence variant that causes the reduction of a genomic feature, with regard to the reference sequence"
},
"alteration": "Truncating Mutations",
"name": "Truncating Mutations",
"refResidues": null,
"proteinStart": -1,
"proteinEnd": 100000,
"variantResidues": null,
"referenceGenomes": [
"GRCh37",
"GRCh38"
]
},
"mutationEffect": "Likely Loss-of-function",
"mutationEffectPmids": [
"11062151",
"15561772",
"11257105"
],
"mutationEffectAbstracts": [],
"oncogenic": "Likely Oncogenic",
"oncogenicPmids": [],
"oncogenicAbstracts": []
},
{
"mutationEffectDescription": "The APC I1307K mutation is located near a β-catenin binding domain in the APC protein. This mutation has been found as a germline mutation in familial adenomatous polyposis (FAP), a cancer predisposition syndrome, and sporadic colorectal cancer. While this mutation has not been functionally characterized, structural modeling shows that this mutation is likely inactivating because the I1307K mutation is predicted to impact β-catenin binding (PMID: 9724771).",
"variant": {
"gene": {
"entrezGeneId": 324,
"hugoSymbol": "APC",
"oncogene": false,
"grch37Isoform": "ENST00000257430",
"grch37RefSeq": "NM_000038.5",
"grch38Isoform": "ENST00000257430",
"grch38RefSeq": "NM_000038.5",
"geneAliases": [
"PPP1R46",
"DP2.5"
],
"genesets": [],
"tsg": true
},
"consequence": {
"term": "missense_variant",
"isGenerallyTruncating": false,
"description": "A sequence variant, that changes one or more bases, resulting in a different amino acid sequence but where the length is preserved"
},
"alteration": "I1307K",
"name": "I1307K",
"refResidues": "I",
"proteinStart": 1307,
"proteinEnd": 1307,
"variantResidues": "K",
"referenceGenomes": [
"GRCh37",
"GRCh38"
]
},
"mutationEffect": "Inconclusive",
"mutationEffectPmids": [
"9724771"
],
"mutationEffectAbstracts": [],
"oncogenic": "Inconclusive",
"oncogenicPmids": [],
"oncogenicAbstracts": []
},
{
"mutationEffectDescription": "The APC N1026S mutation is located near a β-catenin binding domain in the APC protein. This mutation has been found as a germline mutation in familial adenomatous polyposis (FAP), a cancer predisposition syndrome, and sporadic colorectal cancer. In vitro studies have demonstrated that this mutation is likely inactivating as measured by decreased β-catenin binding compared to wildtype (PMID: 18166348).",
"variant": {
"gene": {
"entrezGeneId": 324,
"hugoSymbol": "APC",
"oncogene": false,
"grch37Isoform": "ENST00000257430",
"grch37RefSeq": "NM_000038.5",
"grch38Isoform": "ENST00000257430",
"grch38RefSeq": "NM_000038.5",
"geneAliases": [
"PPP1R46",
"DP2.5"
],
"genesets": [],
"tsg": true
},
"consequence": {
"term": "missense_variant",
"isGenerallyTruncating": false,
"description": "A sequence variant, that changes one or more bases, resulting in a different amino acid sequence but where the length is preserved"
},
"alteration": "N1026S",
"name": "N1026S",
"refResidues": "N",
"proteinStart": 1026,
"proteinEnd": 1026,
"variantResidues": "S",
"referenceGenomes": [
"GRCh37",
"GRCh38"
]
},
"mutationEffect": "Loss-of-function",
"mutationEffectPmids": [
"18166348"
],
"mutationEffectAbstracts": [],
"oncogenic": "Likely Oncogenic",
"oncogenicPmids": [],
"oncogenicAbstracts": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"query": {
"id": null,
"referenceGenome": "GRCh37",
"hugoSymbol": "APC",
"entrezGeneId": 324,
"alteration": "G279Ffs*10",
"alterationType": null,
"svType": null,
"tumorType": null,
"consequence": "splice_region_variant",
"proteinStart": 279,
"proteinEnd": 10,
"hgvs": "5:g.112151184A>G"
},
"geneExist": true,
"variantExist": false,
"alleleExist": false,
"oncogenic": "Likely Oncogenic",
"mutationEffect": {
"knownEffect": "Likely Loss-of-function",
"description": "Truncating APC mutations result in loss of full-length APC protein leading to impaired or abnormal APC function. APC deregulation is associated with accumulation of β-catenin, an oncogenic transcription factor, which in turn leads to aberrant target gene expression and tumorigenesis (PMID: 11062151). APC truncating mutations are typically early events occurring on a single allele (germline or somatic); however, the tumor often acquires a second hit on the second allele, reducing the overall amount of functional APC in the cell (PMID: 11257105). Furthermore, expression of truncating mutations of APC has been shown to result in chromosomal instability in a dominant manner, postulated to play an important role in the accumulation of additional oncogenic alterations (PMID: 15561772).",
"citations": {
"pmids": [
"11062151",
"15561772",
"11257105"
],
"abstracts": []
}
},
"highestSensitiveLevel": null,
"highestResistanceLevel": null,
"highestDiagnosticImplicationLevel": null,
"highestPrognosticImplicationLevel": null,
"highestFdaLevel": null,
"otherSignificantSensitiveLevels": [],
"otherSignificantResistanceLevels": [],
"hotspot": false,
"geneSummary": "APC, a tumor suppressor involved in WNT signaling, is recurrently altered in colorectal cancer.",
"variantSummary": "The APC G279Ffs*10 mutation is likely oncogenic.",
"tumorTypeSummary": "",
"prognosticSummary": "",
"diagnosticSummary": "",
"diagnosticImplications": [],
"prognosticImplications": [],
"treatments": [],
"dataVersion": "v4.5",
"lastUpdate": "10/23/2017",
"background": "APC is a negative regulator of the pro-oncogenic WNT/ β-catenin signaling pathway (PMID: 8259518, 8259519). The main tumor suppressive role of APC is to modulate intracellular levels of β-catenin (PMID: 11978510). APC is an essential member of the destruction complex, which targets cytosolic β-catenin for ubiquitination and degradation (PMID: 10984057). When the activity of APC is lost, there is an aberrant increase in WNT-pathway activation, often leading to hyperplasia and eventually tumor progression (PMID: 8259511). A threshold of APC expression is required to suppress tumor formation, and this level is finely balanced (PMID: 11743581). Germline mutations in the APC gene cause familial adenomatous polyposis (FAP) (PMID: 1651174, 1651562), a disease in which 95% of people progress to develop colorectal cancer (PMID: 1528264). In addition, heritable mutations in APC are responsible for the development of a number of related diseases, including Turcot Syndrome, Gardner Syndrome and Flat Adenoma Syndrome (FAS) (PMID: 8593545). APC mutations, much like those seen in FAS, have been observed in 50-80% of sporadic colorectal cancers (PMID: 17143297). Somatic mutations in APC function as tumor-initiating events and are also observed in a number of other human cancers including breast, stomach, and prostate (PMID: 27302369, 29316426). The majority of APC mutations are loss-of-function and occur in a region important for β-catenin binding (PMID: 10784639, 1338904). Inhibitors of the WNT pathway are currently in clinical development (PMID: 24981364).",
"tumorTypes": [],
"vus": false
}
17 changes: 17 additions & 0 deletions screenshot-test/data/api-v1-genes-APC.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{
"entrezGeneId": 324,
"hugoSymbol": "APC",
"oncogene": false,
"grch37Isoform": "ENST00000257430",
"grch37RefSeq": "NM_000038.5",
"grch38Isoform": "ENST00000257430",
"grch38RefSeq": "NM_000038.5",
"geneAliases": [
"PPP1R46",
"DP2.5"
],
"genesets": [],
"tsg": true
}
]
Loading

0 comments on commit cb06fd4

Please sign in to comment.