Skip to content

Commit

Permalink
Merge pull request #983 from Sage-Bionetworks/staging
Browse files Browse the repository at this point in the history
2.4.0 to production
  • Loading branch information
JessterB authored Mar 14, 2022
2 parents f04b346 + be1699c commit 463942d
Show file tree
Hide file tree
Showing 66 changed files with 679 additions and 558 deletions.
1 change: 0 additions & 1 deletion .ebextensions/eb-options.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
option_settings:
aws:elasticbeanstalk:container:nodejs:
ProxyServer: "nginx"
NodeCommand: "node --max_old_space_size=2000 ./dist/server.js"

aws:elasticbeanstalk:command:
Timeout: 2700
Expand Down
329 changes: 183 additions & 146 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "agora",
"version": "2.3.0",
"version": "2.4.0",
"data-file": "syn13363290",
"data-version": "34",
"data-version": "35",
"description": "An application to aggregate genomic evidence supporting candidate gene and module targets nominated by members of the AMP-AD consortium.",
"keywords": [
"angular8",
Expand Down Expand Up @@ -206,7 +206,7 @@
"inline-manifest-webpack-plugin": "^4.0.2",
"istanbul-instrumenter-loader": "^3.0.1",
"jasmine-core": "^3.5.0",
"karma": "^6.3.2",
"karma": "^6.3.16",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^1.1.2",
"karma-coverage-istanbul-reporter": "^2.1.1",
Expand Down Expand Up @@ -269,8 +269,8 @@
"url": "https://github.com/Sage-Bionetworks/Agora/issues"
},
"engines": {
"node": ">= 10.13.0",
"npm": ">= 5"
"node": "12.22.3",
"npm": "6.14.13"
},
"browserslist": [
"iOS >= 7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ export class BoxPlotViewComponent implements OnInit, OnDestroy, AfterViewInit {
logVals.push(self.dataService.getSignificantFigures(g.logfc));
significanceTexts.push((g.adj_p_val <= 0.05) ?
' ' : 'not ');
phrases.push(g.hgnc_symbol + ' is ' + significanceTexts[significanceTexts.length - 1] +
phrases.push((g.hgnc_symbol || g.ensembl_gene_id) +
' is ' + significanceTexts[significanceTexts.length - 1] +
'significantly differentially expressed in ' +
g.tissue +
' with a log fold change value of ' + g.logfc + ' and an adjusted p-value of ' +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ export class PBoxPlotViewComponent implements OnInit, OnDestroy, AfterViewInit {
logVals.push(p.log2_fc);
significanceTexts.push((p.cor_pval <= 0.05) ?
' ' : 'not ');
phrases.push(p.hgnc_symbol + ' is ' + significanceTexts[significanceTexts.length - 1] +
phrases.push((p.hgnc_symbol || p.ensembl_gene_id) +
' is ' + significanceTexts[significanceTexts.length - 1] +
'significantly differentially expressed in ' +
p.tissue +
' with a log fold change value of ' + p.log2_fc + ' and an adjusted p-value of ' +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import * as d3 from 'd3';
export class CandlestickChartViewComponent implements OnInit, OnDestroy, AfterViewInit {

@ViewChild('chart', {static: false}) candleStickChart: ElementRef;
@Input() hgicId: string = '';
@Input() geneId: string = '';

dataEmpty: boolean = true;
rawData: any;
Expand Down Expand Up @@ -195,7 +195,7 @@ export class CandlestickChartViewComponent implements OnInit, OnDestroy, AfterVi
.style('fill', color)
.on('mouseover', d => {
const isOrNot = d.value.pval_adj <= 0.05 ? 'is' : 'is not';
const msg = `${this.hgicId} ${isOrNot} significantly correlated with ${d.key}, with an odds ratio of ${d.value.mean} and an adjusted p-value of ${d.value.pval_adj}.`;
const msg = `${this.geneId} ${isOrNot} significantly correlated with ${d.key}, with an odds ratio of ${d.value.mean} and an adjusted p-value of ${d.value.pval_adj}.`;
this.showTooltip(this.tooltip, msg);
})
.on('mouseout', d => this.hideTooltip(this.tooltip));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('Component: ForceChartView', () => {
ensembl_gene_id: 'ENSG00000169436',
group: 2,
hgnc_symbol: 'COL22A1',
id: 'ENSG00000128564',
id: 'ENSG00000169436',
index: 1,
vx: 0.6383193392459895,
vy: -4.464810585759529,
Expand All @@ -93,8 +93,8 @@ describe('Component: ForceChartView', () => {
links: [
{
brainregions: ['DLPFC'],
hgnc_symbolA: 'VGF',
hgnc_symbolB: 'COL22A1',
geneIdA: 'VGF',
geneIdB: 'COL22A1',
source: mockNode1,
target: mockNode2,
value: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export class ForceChartViewComponent implements OnInit, AfterViewInit, OnChanges
.selectAll('text')
.data(this.networkData.nodes, (d) => d.id)
.enter().append('text')
.text((node: any) => node.hgnc_symbol)
.text((node: any) => (node.hgnc_symbol || node.ensembl_gene_id))
.attr('font-size', 12)
.attr('dx', 13)
.attr('dy', 4);
Expand All @@ -271,7 +271,7 @@ export class ForceChartViewComponent implements OnInit, AfterViewInit, OnChanges
// A font size of 12 has 16 pixels per letter, so we pick
// half the word and make a negative dx. The anchor is in
// the middle so we half the result again
return (((-node.hgnc_symbol.length * 16) / 2) / 2);
return (((-(node.hgnc_symbol.length || node.ensembl_gene_id.length) * 16) / 2) / 2);
})
.attr('dy', (node: any) => {
return 35;
Expand Down Expand Up @@ -367,7 +367,7 @@ export class ForceChartViewComponent implements OnInit, AfterViewInit, OnChanges
.data(this.networkData.nodes, (d) => d.id);
this.textElements.exit().remove();
this.textElements = this.textElements.enter().append('text')
.text((node: any) => node.hgnc_symbol)
.text((node: any) => (node.hgnc_symbol || node.ensembl_gene_id))
.attr('font-size', 12)
.attr('dx', 23)
.attr('dy', 4)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { Router } from '@angular/router';
import {
RouterStub,
GeneServiceStub,
DataServiceStub,
ChartServiceStub,
DataServiceStub,
mockModels,
mockTissues
} from '../../../testing';
Expand All @@ -28,7 +28,6 @@ describe('Component: RowChartView', () => {
let router: RouterStub;
let geneService: GeneServiceStub;
let chartService: ChartServiceStub;
let dataService: DataServiceStub;
let location: SpyLocation;

beforeEach(async(() => {
Expand All @@ -54,7 +53,6 @@ describe('Component: RowChartView', () => {
// Get the injected instances
router = fixture.debugElement.injector.get(Router);
geneService = fixture.debugElement.injector.get(GeneService);
dataService = fixture.debugElement.injector.get(DataService);
chartService = fixture.debugElement.injector.get(ChartService);
location = fixture.debugElement.injector.get(SpyLocation);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,11 @@ export class RowChartViewComponent implements OnInit, OnDestroy, AfterViewInit,
const allTicks = chart.selectAll('g.axis g.tick');
allTicks.each(function(t, i) {
let value = parseFloat(d3.select(this).select('text').text());
// Handle UTF-8 characters, if text is not a number, then replace all non-numeric values with the empty string
value = isNaN(value) ? parseFloat('-' + d3.select(this).select('text').text().replace(/[^,.0-9]/g, '')) : value;
// Handle UTF-8 characters, if text is not a number,
// then replace all non-numeric values with the empty string
value = isNaN(value) ?
parseFloat('-' + d3.select(this).select('text').text().replace(/[^,.0-9]/g, '')) :
value;

if (i > 0 && i < allTicks.size() - 1) {
if (value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('Component: SelectMenuView', () => {
geneService = fixture.debugElement.injector.get(GeneService);
chartService = fixture.debugElement.injector.get(ChartService);
activatedRoute = fixture.debugElement.injector.get(ActivatedRoute);
activatedRoute.setParamMap({ id: mockInfo1.hgnc_symbol });
activatedRoute.setParamMap({ id: mockInfo1.ensembl_gene_id });
location = fixture.debugElement.injector.get(SpyLocation);

component = fixture.componentInstance; // Component test instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,11 @@ export class SelectMenuViewComponent implements OnInit, OnDestroy {
const cPromise = new Promise(async (resolve, reject) => {
if (self.type === 'RNA') {
self.chartService.queryFilter.smGroup = c.innerHTML;
const gene = self.geneService.getCurrentGene().hgnc_symbol;
self.isActive = false;

await self.apiService.refreshChartsData(
self.chartService.queryFilter.smGroup, gene
self.chartService.queryFilter.smGroup,
self.geneService.getCurrentGene().ensembl_gene_id
)
.subscribe((results) => {
self.chartService.filteredData = results;
Expand All @@ -459,11 +459,13 @@ export class SelectMenuViewComponent implements OnInit, OnDestroy {
});
} else if (self.type === 'Proteomics') {
self.chartService.pQueryFilter.spGroup = c.innerHTML;
const gene = self.geneService.getCurrentGene().hgnc_symbol;
self.isActive = false;

await self.apiService.refreshChartsData(
self.chartService.pQueryFilter.spGroup, gene, self.type)
self.chartService.pQueryFilter.spGroup,
self.geneService.getCurrentGene().ensembl_gene_id,
self.type
)
.subscribe((results) => {
self.chartService.filteredData = results;
self.isActive = true;
Expand Down
2 changes: 0 additions & 2 deletions src/app/core/core-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import { HelpComponent } from './help';
import { NoContentComponent } from './no-content';
import { SynapseAccountComponent } from './synapse-account';
import { ContribTeamsPageComponent } from './contrib-teams';
import { TermsComponent } from './terms';
import { NewsComponent } from './news';

export const routes: Routes = [
{ path: '', loadChildren: '../genes/genes.module#GenesModule'},
{ path: 'about', component: AboutComponent },
{ path: 'news', component: NewsComponent },
{ path: 'help', component: HelpComponent },
{ path: 'terms', component: TermsComponent },
{ path: 'teams-contributing', component: ContribTeamsPageComponent },
{ path: 'synapse-account', component: SynapseAccountComponent },
{ path: 'no-content', component: NoContentComponent },
Expand Down
3 changes: 0 additions & 3 deletions src/app/core/core.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
import { AboutComponent } from './about';
import { NewsComponent } from './news';
import { HelpComponent } from './help';
import { TermsComponent } from './terms';
import { SynapseAccountComponent } from './synapse-account';
import { NavbarComponent } from './navbar';
import { MenubarComponent } from './menubar';
Expand All @@ -43,7 +42,6 @@ import '../../styles/headings.scss';
AboutComponent,
NewsComponent,
HelpComponent,
TermsComponent,
ContribTeamsPageComponent,
SynapseAccountComponent
],
Expand All @@ -55,7 +53,6 @@ import '../../styles/headings.scss';
NoContentComponent,
AboutComponent,
HelpComponent,
TermsComponent,
ContribTeamsPageComponent,
SynapseAccountComponent
],
Expand Down
10 changes: 5 additions & 5 deletions src/app/core/services/api.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ describe('Service: Api: TestBed', () => {
it('should get the genes data from the server', () => {
const dummyGenes = mockGenesResponse;

apiService.getGenes('VGF').subscribe((response) => {
apiService.getGenes('ENSG00000128564').subscribe((response) => {
expect(response).toEqual(mockGenesResponse);
});

const req = httpMock.expectOne('/api/genes?id=VGF');
const req = httpMock.expectOne('/api/genes?id=ENSG00000128564');
expect(req.request.method).toBe('GET');
req.flush(dummyGenes);
});
Expand Down Expand Up @@ -102,7 +102,7 @@ describe('Service: Api: TestBed', () => {

it('should get the gene data from the server', () => {
const res = { mockInfo1, mockGene1 };
apiService.getGene('VGF', 'DLPFC', 'AD+Diagnosis+%28males+and+females%29')
apiService.getGene('ENSG00000128564', 'DLPFC', 'AD+Diagnosis+%28males+and+females%29')
.subscribe((response) => {
expect(response).toEqual(res);
});
Expand Down Expand Up @@ -178,13 +178,13 @@ describe('Service: Api: TestBed', () => {
it('should trigger a refresh for the charts on the server', () => {
const res: string[] = mockModels;

apiService.refreshChartsData('AD Diagnosis (males and females)', 'VGF').subscribe(
apiService.refreshChartsData('AD Diagnosis (males and females)', 'ENSG00000128564').subscribe(
(response) => {
expect(response).toEqual(res);
});

const req = httpMock.expectOne(
'/api/refresh?filter=' + JSON.stringify('AD Diagnosis (males and females)') + '&id=VGF'
'/api/refresh?filter=' + JSON.stringify('AD Diagnosis (males and females)') + '&id=ENSG00000128564'
);
expect(req.request.method).toBe('GET');
req.flush(res);
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/services/data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class DataService {
) {}

loadData(gene: Gene): Observable<any[]> {
const genesResponse = this.apiService.getGenes(gene.hgnc_symbol);
const genesResponse = this.apiService.getGenes(gene.ensembl_gene_id);
const nodesResponse = this.apiService.getLinksList(gene);

return forkJoin([
Expand Down
4 changes: 2 additions & 2 deletions src/app/core/services/force.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ export class ForceService {
source: obj.geneA_ensembl_gene_id,
target: obj.geneB_ensembl_gene_id,
brainregions: [obj.brainRegion],
hgnc_symbolA: obj.geneA_external_gene_name,
hgnc_symbolB: obj.geneB_external_gene_name
geneIdA: obj.geneA_external_gene_name || obj.geneA_ensembl_gene_id,
geneIdB: obj.geneB_external_gene_name || obj.geneB_ensembl_gene_id
};
dicL[obj.geneA_ensembl_gene_id + obj.geneB_ensembl_gene_id] = link;
genes.links = [...genes.links,
Expand Down
7 changes: 6 additions & 1 deletion src/app/core/services/gene.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import {
} from '@angular/core/testing';

import {
ApiServiceStub, mockGene1, mockGeneResponse1, mockGeneResponseNoGeneItem, mockGeneResponseNoExpValidation, mockGeneResponseNoScores
ApiServiceStub,
mockGene1,
mockGeneResponse1,
mockGeneResponseNoGeneItem,
mockGeneResponseNoExpValidation,
mockGeneResponseNoScores
} from '../../testing';

import { ApiService, GeneService } from './';
Expand Down
4 changes: 2 additions & 2 deletions src/app/core/services/gene.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class GeneService {

updatePreviousGene() {
// Only update the previous gene if we already have a current one
if (this.getCurrentGene() && this.getCurrentGene().hgnc_symbol) {
if (this.getCurrentGene() && this.getCurrentGene().ensembl_gene_id) {
this.setPreviousGene(this.getCurrentGene());
}
}
Expand Down Expand Up @@ -275,7 +275,7 @@ export class GeneService {

hasGeneChanged(): boolean {
return (this.getPreviousGene() && this.getCurrentGene()) ?
this.getPreviousGene().hgnc_symbol !== this.getCurrentGene().hgnc_symbol :
this.getPreviousGene().ensembl_gene_id !== this.getCurrentGene().ensembl_gene_id :
false;
}

Expand Down
1 change: 0 additions & 1 deletion src/app/core/terms/index.ts

This file was deleted.

13 changes: 0 additions & 13 deletions src/app/core/terms/terms.component.html

This file was deleted.

21 changes: 0 additions & 21 deletions src/app/core/terms/terms.component.scss

This file was deleted.

Loading

0 comments on commit 463942d

Please sign in to comment.