diff --git a/apps/agora/api/src/components/genes.ts b/apps/agora/api/src/components/genes.ts index f79f135cec..c2cf8cdf5d 100644 --- a/apps/agora/api/src/components/genes.ts +++ b/apps/agora/api/src/components/genes.ts @@ -164,7 +164,7 @@ export async function genesRoute(req: Request, res: Response, next: NextFunction try { const result = await getGenes(req.query.ids); setHeaders(res); - res.json({ items: result }); + res.json(result); } catch (err) { next(err); } diff --git a/apps/agora/api/src/models/genes.ts b/apps/agora/api/src/models/genes.ts index d706e66618..c86a51871b 100644 --- a/apps/agora/api/src/models/genes.ts +++ b/apps/agora/api/src/models/genes.ts @@ -53,7 +53,7 @@ const DruggabilitySchema = new Schema({ sm_druggability_bucket: { type: Number, required: true }, safety_bucket: { type: Number, required: true }, abability_bucket: { type: Number, required: true }, - pharos_class: { type: String, required: true }, + pharos_class: { type: [String], required: true }, classification: { type: String, required: true }, safety_bucket_definition: { type: String, required: true }, abability_bucket_definition: { type: String, required: true }, @@ -67,6 +67,7 @@ const GeneSchema = new Schema( 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 }, @@ -75,7 +76,7 @@ const GeneSchema = new Schema( protein_brain_change_studied: { type: Boolean, required: true }, target_nominations: { type: [TargetNominationSchema], required: true }, median_expression: { type: [MedianExpressionSchema], required: true }, - druggability: { type: [DruggabilitySchema], required: true }, + druggability: { type: DruggabilitySchema, required: true }, total_nominations: { type: Number, required: true }, ensembl_info: { type: EnsemblInfoSchema, required: true }, }, diff --git a/apps/agora/app/src/app/app.component.html b/apps/agora/app/src/app/app.component.html index ede758841c..3331936a4c 100644 --- a/apps/agora/app/src/app/app.component.html +++ b/apps/agora/app/src/app/app.component.html @@ -6,4 +6,3 @@ - diff --git a/apps/agora/app/src/app/app.component.ts b/apps/agora/app/src/app/app.component.ts index 9b9a664c9b..c043acb0f4 100644 --- a/apps/agora/app/src/app/app.component.ts +++ b/apps/agora/app/src/app/app.component.ts @@ -1,17 +1,13 @@ import { Component, inject, OnInit } from '@angular/core'; import { Meta, Title } from '@angular/platform-browser'; import { ActivatedRoute, NavigationEnd, Router, RouterModule } from '@angular/router'; -import { - FooterComponent, - HeaderComponent, - LoadingOverlayComponent, -} from '@sagebionetworks/agora/ui'; +import { FooterComponent, HeaderComponent } from '@sagebionetworks/agora/ui'; import { filter } from 'rxjs'; import { ToastModule } from 'primeng/toast'; import { MessageService } from 'primeng/api'; @Component({ - imports: [RouterModule, HeaderComponent, FooterComponent, LoadingOverlayComponent, ToastModule], + imports: [RouterModule, HeaderComponent, FooterComponent, ToastModule], providers: [MessageService], selector: 'app-root', templateUrl: './app.component.html', diff --git a/apps/agora/app/src/app/app.routes.ts b/apps/agora/app/src/app/app.routes.ts index 5edb4d2f16..bbc568a890 100644 --- a/apps/agora/app/src/app/app.routes.ts +++ b/apps/agora/app/src/app/app.routes.ts @@ -60,20 +60,25 @@ export const routes: Route[] = [ description: 'Nominate a gene as a new candidate for AD treatment or prevention.', }, }, + { + path: 'genes/:id/similar', + loadChildren: () => + import('@sagebionetworks/agora/genes').then((routes) => routes.similarRoute), + }, { path: 'genes/:id/:tab/:subtab', loadChildren: () => - import('@sagebionetworks/agora/gene-details').then((routes) => routes.routes), + import('@sagebionetworks/agora/genes').then((routes) => routes.detailsRoute), }, { path: 'genes/:id/:tab', loadChildren: () => - import('@sagebionetworks/agora/gene-details').then((routes) => routes.routes), + import('@sagebionetworks/agora/genes').then((routes) => routes.detailsRoute), }, { path: 'genes/:id', loadChildren: () => - import('@sagebionetworks/agora/gene-details').then((routes) => routes.routes), + import('@sagebionetworks/agora/genes').then((routes) => routes.detailsRoute), data: { title: 'Agora | Gene Details', description: "View information and evidence about genes in Alzheimer's disease.", diff --git a/apps/agora/app/src/config/config.json b/apps/agora/app/src/config/config.json index 93529eaf14..966efbcbb6 100644 --- a/apps/agora/app/src/config/config.json +++ b/apps/agora/app/src/config/config.json @@ -3,5 +3,6 @@ "appVersion": "4.0.0", "csrApiUrl": "http://localhost:3333/v1", "ssrApiUrl": "http://agora-api:3333/v1", - "rollbarToken": "e788198867474855a996485580b08d03" + "rollbarToken": "e788198867474855a996485580b08d03", + "tagName": "agora/v0.0.2" } diff --git a/apps/agora/app/src/config/config.json.template b/apps/agora/app/src/config/config.json.template index df9875448f..c853400a4f 100644 --- a/apps/agora/app/src/config/config.json.template +++ b/apps/agora/app/src/config/config.json.template @@ -3,5 +3,6 @@ "appVersion": "${APP_VERSION}", "csrApiUrl": "${CSR_API_URL}", "ssrApiUrl": "${SSR_API_URL}", - "rollbarToken": "${ROLLBAR_TOKEN}" + "rollbarToken": "${ROLLBAR_TOKEN}", + "tagName": "${TAG_NAME}" } \ No newline at end of file diff --git a/apps/agora/data/.env.example b/apps/agora/data/.env.example index 816c6eb0ac..a9ecb1712f 100644 --- a/apps/agora/data/.env.example +++ b/apps/agora/data/.env.example @@ -7,6 +7,6 @@ DB_HOST="agora-mongo" # must match mongo service name # specifies data release manifest and team images folder DATA_FILE="syn13363290" -DATA_VERSION="68" +DATA_VERSION="71" TEAM_IMAGES_ID="syn12861877" SYNAPSE_AUTH_TOKEN="agora-service-user-pat-here" \ No newline at end of file diff --git a/libs/agora/api-client-angular/src/lib/.openapi-generator/FILES b/libs/agora/api-client-angular/src/lib/.openapi-generator/FILES index 12e2b866df..b1eb0500b1 100644 --- a/libs/agora/api-client-angular/src/lib/.openapi-generator/FILES +++ b/libs/agora/api-client-angular/src/lib/.openapi-generator/FILES @@ -25,6 +25,7 @@ model/gCTGeneNominations.ts model/gCTGeneTissue.ts model/gCTGenesList.ts model/gene.ts +model/geneNetworkLinks.ts model/genesList.ts model/medianExpression.ts model/models.ts diff --git a/libs/agora/api-client-angular/src/lib/model/druggability.ts b/libs/agora/api-client-angular/src/lib/model/druggability.ts index 20d0e4a3a5..3b17537dbb 100644 --- a/libs/agora/api-client-angular/src/lib/model/druggability.ts +++ b/libs/agora/api-client-angular/src/lib/model/druggability.ts @@ -17,7 +17,7 @@ export interface Druggability { sm_druggability_bucket: number; safety_bucket: number; abability_bucket: number; - pharos_class: string; + pharos_class: Array; classification: string; safety_bucket_definition: string; abability_bucket_definition: string; diff --git a/libs/agora/api-client-angular/src/lib/model/gene.ts b/libs/agora/api-client-angular/src/lib/model/gene.ts index 377938232d..88a592af14 100644 --- a/libs/agora/api-client-angular/src/lib/model/gene.ts +++ b/libs/agora/api-client-angular/src/lib/model/gene.ts @@ -14,6 +14,7 @@ import { ExperimentalValidation } from './experimentalValidation'; import { EnsemblInfo } from './ensemblInfo'; import { RnaDifferentialExpression } from './rnaDifferentialExpression'; import { BioDomains } from './bioDomains'; +import { GeneNetworkLinks } from './geneNetworkLinks'; import { TargetNomination } from './targetNomination'; import { NeuropathologicCorrelation } from './neuropathologicCorrelation'; import { SimilarGenesNetwork } from './similarGenesNetwork'; @@ -31,6 +32,7 @@ export interface Gene { summary: string; hgnc_symbol: string; alias: Array; + uniprotkb_accessions?: Array; is_igap: boolean; is_eqtl: boolean; is_any_rna_changed_in_ad_brain: boolean; @@ -39,7 +41,7 @@ export interface Gene { protein_brain_change_studied: boolean; target_nominations: Array | null; median_expression: Array; - druggability: Array; + druggability: Druggability; total_nominations: number | null; is_adi?: boolean; is_tep?: boolean; @@ -52,12 +54,12 @@ export interface Gene { overall_scores?: OverallScores; neuropathologic_correlations?: Array | null; experimental_validation?: Array | null; - links?: { [key: string]: object } | null; + links?: { [key: string]: GeneNetworkLinks } | null; similar_genes_network?: SimilarGenesNetwork; ab_modality_display_value?: string | null; safety_rating_display_value?: string | null; sm_druggability_display_value?: string | null; - pharos_class_display_value?: string | null; + pharos_class_display_value?: Array | null; is_any_rna_changed_in_ad_brain_display_value?: string | null; is_any_protein_changed_in_ad_brain_display_value?: string | null; nominated_target_display_value?: boolean | null; diff --git a/libs/agora/api-client-angular/src/lib/model/geneNetworkLinks.ts b/libs/agora/api-client-angular/src/lib/model/geneNetworkLinks.ts new file mode 100644 index 0000000000..5e15003b83 --- /dev/null +++ b/libs/agora/api-client-angular/src/lib/model/geneNetworkLinks.ts @@ -0,0 +1,37 @@ +/** + * Agora REST API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Gene Network Links + */ +export interface GeneNetworkLinks { + /** + * Ensembl gene ID for gene A + */ + geneA_ensembl_gene_id: string; + /** + * Ensembl gene ID for gene B + */ + geneB_ensembl_gene_id: string; + /** + * External gene name for gene A + */ + geneA_external_gene_name: string; + /** + * External gene name for gene B + */ + geneB_external_gene_name: string; + /** + * Associated brain region + */ + brainRegion: string; +} diff --git a/libs/agora/api-client-angular/src/lib/model/models.ts b/libs/agora/api-client-angular/src/lib/model/models.ts index 3491bc9305..6a4a50220e 100644 --- a/libs/agora/api-client-angular/src/lib/model/models.ts +++ b/libs/agora/api-client-angular/src/lib/model/models.ts @@ -12,6 +12,7 @@ export * from './gCTGeneNominations'; export * from './gCTGeneTissue'; export * from './gCTGenesList'; export * from './gene'; +export * from './geneNetworkLinks'; export * from './genesList'; export * from './medianExpression'; export * from './neuropathologicCorrelation'; diff --git a/libs/agora/api-description/build/openapi.yaml b/libs/agora/api-description/build/openapi.yaml index 600450d266..0a4db77e34 100644 --- a/libs/agora/api-description/build/openapi.yaml +++ b/libs/agora/api-description/build/openapi.yaml @@ -421,8 +421,9 @@ components: type: integer example: 3 pharos_class: - type: string - example: Tclin + type: array + items: + type: string classification: type: string example: Enzyme @@ -622,6 +623,31 @@ components: - reference_doi - date_report - abability_bucket_definition + GeneNetworkLinks: + type: object + description: Gene Network Links + properties: + geneA_ensembl_gene_id: + type: string + description: Ensembl gene ID for gene A + geneB_ensembl_gene_id: + type: string + description: Ensembl gene ID for gene B + geneA_external_gene_name: + type: string + description: External gene name for gene A + geneB_external_gene_name: + type: string + description: External gene name for gene B + brainRegion: + type: string + description: Associated brain region + required: + - geneA_ensembl_gene_id + - geneB_ensembl_gene_id + - geneA_external_gene_name + - geneB_external_gene_name + - brainRegion SimilarGenesNetworkNode: type: object description: SimilarGenesNetworkNode @@ -730,6 +756,10 @@ components: type: array items: type: string + uniprotkb_accessions: + type: array + items: + type: string is_igap: type: boolean is_eqtl: @@ -752,9 +782,7 @@ components: items: $ref: '#/components/schemas/MedianExpression' druggability: - type: array - items: - $ref: '#/components/schemas/Druggability' + $ref: '#/components/schemas/Druggability' total_nominations: type: integer nullable: true @@ -805,7 +833,7 @@ components: links: type: object additionalProperties: - type: object + $ref: '#/components/schemas/GeneNetworkLinks' nullable: true similar_genes_network: $ref: '#/components/schemas/SimilarGenesNetwork' @@ -820,7 +848,9 @@ components: type: string nullable: true pharos_class_display_value: - type: string + type: array + items: + type: string nullable: true is_any_rna_changed_in_ad_brain_display_value: type: string diff --git a/libs/agora/api-description/src/components/schemas/Druggability.yaml b/libs/agora/api-description/src/components/schemas/Druggability.yaml index c4f0db0e06..96568e21e6 100644 --- a/libs/agora/api-description/src/components/schemas/Druggability.yaml +++ b/libs/agora/api-description/src/components/schemas/Druggability.yaml @@ -11,8 +11,9 @@ properties: type: integer example: 3 pharos_class: - type: string - example: 'Tclin' + type: array + items: + type: string classification: type: string example: 'Enzyme' diff --git a/libs/agora/api-description/src/components/schemas/Gene.yaml b/libs/agora/api-description/src/components/schemas/Gene.yaml index 7a7cff7ab9..e3cfbee2e4 100644 --- a/libs/agora/api-description/src/components/schemas/Gene.yaml +++ b/libs/agora/api-description/src/components/schemas/Gene.yaml @@ -15,6 +15,10 @@ properties: type: array items: type: string + uniprotkb_accessions: + type: array + items: + type: string is_igap: type: boolean is_eqtl: @@ -37,9 +41,7 @@ properties: items: $ref: MedianExpression.yaml druggability: - type: array - items: - $ref: Druggability.yaml + $ref: Druggability.yaml total_nominations: type: integer nullable: true @@ -90,7 +92,7 @@ properties: links: type: object additionalProperties: - type: object + $ref: GeneNetworkLinks.yaml nullable: true similar_genes_network: $ref: SimilarGenesNetwork.yaml @@ -105,7 +107,9 @@ properties: type: string nullable: true pharos_class_display_value: - type: string + type: array + items: + type: string nullable: true is_any_rna_changed_in_ad_brain_display_value: type: string diff --git a/libs/agora/api-description/src/components/schemas/GeneNetworkLinks.yaml b/libs/agora/api-description/src/components/schemas/GeneNetworkLinks.yaml new file mode 100644 index 0000000000..2f8db22943 --- /dev/null +++ b/libs/agora/api-description/src/components/schemas/GeneNetworkLinks.yaml @@ -0,0 +1,24 @@ +type: object +description: Gene Network Links +properties: + geneA_ensembl_gene_id: + type: string + description: 'Ensembl gene ID for gene A' + geneB_ensembl_gene_id: + type: string + description: 'Ensembl gene ID for gene B' + geneA_external_gene_name: + type: string + description: 'External gene name for gene A' + geneB_external_gene_name: + type: string + description: 'External gene name for gene B' + brainRegion: + type: string + description: 'Associated brain region' +required: + - geneA_ensembl_gene_id + - geneB_ensembl_gene_id + - geneA_external_gene_name + - geneB_external_gene_name + - brainRegion diff --git a/libs/agora/charts/src/lib/score-barchart/score-barchart.component.ts b/libs/agora/charts/src/lib/score-barchart/score-barchart.component.ts index c2aa0c29e3..4b7ce5c23c 100644 --- a/libs/agora/charts/src/lib/score-barchart/score-barchart.component.ts +++ b/libs/agora/charts/src/lib/score-barchart/score-barchart.component.ts @@ -67,7 +67,6 @@ export class ScoreBarChartComponent implements OnChanges, AfterViewInit, OnDestr @HostListener('window:resize', ['$event.target']) onResize() { - console.log('sbc-onresize'); if (this.shouldResize && this.initialized) { const divSize = this.scoreBarChartContainer.nativeElement.getBoundingClientRect().width; clearTimeout(this.resizeTimer); @@ -78,8 +77,6 @@ export class ScoreBarChartComponent implements OnChanges, AfterViewInit, OnDestr } ngOnChanges(changes: SimpleChanges): void { - console.log('sbc-changes', changes); - if ( (changes['data'] && !changes['data'].firstChange) || (changes['score'] && !changes['score'].firstChange) || @@ -97,8 +94,6 @@ export class ScoreBarChartComponent implements OnChanges, AfterViewInit, OnDestr } ngAfterViewInit(): void { - console.log('ngAfterViewInit'); - if (this.score === null) this.hideChart(); else this.createChart(); } diff --git a/libs/agora/config/src/lib/app.config.ts b/libs/agora/config/src/lib/app.config.ts index 4dd498a475..d6c60e5ea1 100644 --- a/libs/agora/config/src/lib/app.config.ts +++ b/libs/agora/config/src/lib/app.config.ts @@ -6,6 +6,7 @@ export interface AppConfig { ssrApiUrl: string; apiDocsUrl: string; rollbarToken: string; + tagName: string; } export const EMPTY_APP_CONFIG = {} as AppConfig; diff --git a/libs/agora/gene-comparison-tool/src/lib/gene-comparison-tool.component.html b/libs/agora/gene-comparison-tool/src/lib/gene-comparison-tool.component.html index 6a3ddd629a..888dabfc31 100644 --- a/libs/agora/gene-comparison-tool/src/lib/gene-comparison-tool.component.html +++ b/libs/agora/gene-comparison-tool/src/lib/gene-comparison-tool.component.html @@ -1,3 +1,8 @@ +@if (isLoading) { +
+ +
+}
@@ -53,7 +58,7 @@

Gene Comparison Tool

-
+
DISPLAYED GENES
@@ -479,6 +484,8 @@

Gene Comparison Tool

breakpoint="0" (sortFunction)="sortCallback($event)" [customSort]="true" + [loading]="isLoading" + loadingIcon="" >
No results found...
@@ -615,7 +622,7 @@

Gene Comparison Tool

- + + + + + +
diff --git a/libs/agora/gene-comparison-tool/src/lib/gene-comparison-tool.component.scss b/libs/agora/gene-comparison-tool/src/lib/gene-comparison-tool.component.scss index aec2741bc0..cf6c867f6f 100644 --- a/libs/agora/gene-comparison-tool/src/lib/gene-comparison-tool.component.scss +++ b/libs/agora/gene-comparison-tool/src/lib/gene-comparison-tool.component.scss @@ -3,6 +3,25 @@ @import 'libs/agora/styles/src/lib/variables'; @import 'libs/agora/styles/src/lib/mixins'; +#loading { + position: absolute; + inset: calc(var(--header-height)) 0 0; + background: rgb(255 255 255 / 100%); + z-index: 100; + display: flex; + justify-content: center; + align-items: center; + height: calc(100vh - var(--footer-height) - var(--header-height)); +} + +.loading-icon-size { + display: flex; + justify-content: center; + align-items: center; + height: calc(100vh - var(--footer-height) - var(--header-height) - 20px); + font-size: 50px !important; +} + .gct-tooltip-filter { max-width: 350px; diff --git a/libs/agora/gene-comparison-tool/src/lib/gene-comparison-tool.component.ts b/libs/agora/gene-comparison-tool/src/lib/gene-comparison-tool.component.ts index ed923adbed..704920acac 100644 --- a/libs/agora/gene-comparison-tool/src/lib/gene-comparison-tool.component.ts +++ b/libs/agora/gene-comparison-tool/src/lib/gene-comparison-tool.component.ts @@ -1,5 +1,13 @@ import { CommonModule } from '@angular/common'; -import { AfterViewInit, Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core'; +import { + AfterViewInit, + Component, + inject, + OnDestroy, + OnInit, + ViewChild, + ViewEncapsulation, +} from '@angular/core'; import { ActivatedRoute, Router, RouterModule } from '@angular/router'; import { DistributionService, @@ -25,19 +33,6 @@ import { combineLatest, Subscription } from 'rxjs'; import * as variables from './gene-comparison-tool.variables'; import * as helpers from './gene-comparison-tool.helpers'; -// import { -// GeneComparisonToolScorePanelComponent as ScorePanelComponent, -// GeneComparisonToolDetailsPanelComponent as DetailsPanelComponent, -// GeneComparisonToolFilterPanelComponent as FilterPanelComponent, -// GeneComparisonToolPinnedGenesModalComponent as PinnedGenesModalComponent, -// GeneComparisonToolFilterListComponent, -// GeneComparisonToolFilterPanelComponent, -// GeneComparisonToolDetailsPanelComponent, -// GeneComparisonToolScorePanelComponent, -// GeneComparisonToolHowToPanelComponent, -// GeneComparisonToolLegendPanelComponent, -// GeneComparisonToolPinnedGenesModalComponent, -// } from './components'; import { GeneComparisonToolScorePanelComponent as ScorePanelComponent } from './components/gene-comparison-tool-score-panel/gene-comparison-tool-score-panel.component'; import { GeneComparisonToolDetailsPanelComponent as DetailsPanelComponent } from './components/gene-comparison-tool-details-panel/gene-comparison-tool-details-panel.component'; import { GeneComparisonToolFilterPanelComponent as FilterPanelComponent } from './components/gene-comparison-tool-filter-panel/gene-comparison-tool-filter-panel.component'; @@ -56,7 +51,7 @@ import { GeneComparisonToolHowToPanelComponent } from './components/gene-compari import { GeneComparisonToolLegendPanelComponent } from './components/gene-comparison-tool-legend-panel/gene-comparison-tool-legend-panel.component'; import { GeneComparisonToolFilterListComponent } from './components/gene-comparison-tool-filter-list/gene-comparison-tool-filter-list.component'; import { OverlayPanelLinkComponent } from '@sagebionetworks/agora/genes'; -import { SvgIconComponent } from '@sagebionetworks/agora/shared'; +import { LoadingIconComponent, SvgIconComponent } from '@sagebionetworks/agora/shared'; @Component({ selector: 'agora-gene-comparison-tool', @@ -78,10 +73,12 @@ import { SvgIconComponent } from '@sagebionetworks/agora/shared'; GeneComparisonToolDetailsPanelComponent, GeneComparisonToolFilterPanelComponent, GeneComparisonToolPinnedGenesModalComponent, + LoadingIconComponent, ], providers: [GenesService, DistributionService, HelperService, MessageService, FilterService], templateUrl: './gene-comparison-tool.component.html', styleUrls: ['./gene-comparison-tool.component.scss'], + encapsulation: ViewEncapsulation.None, }) export class GeneComparisonToolComponent implements OnInit, AfterViewInit, OnDestroy { router = inject(Router); @@ -92,6 +89,8 @@ export class GeneComparisonToolComponent implements OnInit, AfterViewInit, OnDes messageService = inject(MessageService); filterService = inject(FilterService); + isLoading = true; + /* Genes ----------------------------------------------------------------- */ genes: GCTGene[] = []; @@ -203,7 +202,7 @@ export class GeneComparisonToolComponent implements OnInit, AfterViewInit, OnDes ngAfterViewInit() { setTimeout(() => { this.updateColumnWidth(); - }, 1); + }, 50); } ngOnDestroy() { @@ -253,7 +252,9 @@ export class GeneComparisonToolComponent implements OnInit, AfterViewInit, OnDes } loadGenes() { - this.helperService.setLoading(true); + // this.helperService.setLoading(true); + this.isLoading = true; + // this.genesTable.showLoader = true; this.genes = []; const genesApi$ = this.geneService.getComparisonGenes(this.category, this.subCategory); @@ -267,7 +268,7 @@ export class GeneComparisonToolComponent implements OnInit, AfterViewInit, OnDes this.scoresDistribution = distributionResult.overall_scores; - this.helperService.setLoading(false); + this.isLoading = false; } }); } diff --git a/libs/agora/genes/src/index.ts b/libs/agora/genes/src/index.ts index d3639ced7e..a0ae9fe241 100644 --- a/libs/agora/genes/src/index.ts +++ b/libs/agora/genes/src/index.ts @@ -12,6 +12,7 @@ export * from './lib/components/gene-nominations/gene-nominations.component'; export * from './lib/components/gene-protein-selector/gene-protein-selector.component'; export * from './lib/components/gene-resources/gene-resources.component'; export * from './lib/components/gene-search/gene-search.component'; +export * from './lib/components/gene-similar/gene-similar.routes'; export * from './lib/components/gene-soe/gene-soe.component'; export * from './lib/components/gene-soe-charts/gene-soe-charts.component'; export * from './lib/components/gene-soe-list/gene-soe-list.component'; diff --git a/libs/agora/genes/src/lib/components/download-dom-image/download-dom-image.component.html b/libs/agora/genes/src/lib/components/download-dom-image/download-dom-image.component.html index 7753dab5a9..da793bf809 100644 --- a/libs/agora/genes/src/lib/components/download-dom-image/download-dom-image.component.html +++ b/libs/agora/genes/src/lib/components/download-dom-image/download-dom-image.component.html @@ -1,5 +1,5 @@ - +
{{ error }}
diff --git a/libs/agora/genes/src/lib/components/download-dom-image/download-dom-image.component.scss b/libs/agora/genes/src/lib/components/download-dom-image/download-dom-image.component.scss index a32f45d182..2863d66ebc 100644 --- a/libs/agora/genes/src/lib/components/download-dom-image/download-dom-image.component.scss +++ b/libs/agora/genes/src/lib/components/download-dom-image/download-dom-image.component.scss @@ -29,6 +29,7 @@ .p-button { width: 100%; + height: 100%; i { position: absolute; diff --git a/libs/agora/genes/src/lib/components/download-dom-image/download-dom-image.component.ts b/libs/agora/genes/src/lib/components/download-dom-image/download-dom-image.component.ts index 748719f764..78d8b8d6af 100644 --- a/libs/agora/genes/src/lib/components/download-dom-image/download-dom-image.component.ts +++ b/libs/agora/genes/src/lib/components/download-dom-image/download-dom-image.component.ts @@ -7,6 +7,9 @@ import { saveAs } from 'file-saver'; import { RadioButtonModule } from 'primeng/radiobutton'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; +import { ButtonModule } from 'primeng/button'; +import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; +import { faDownload, faSpinner } from '@fortawesome/free-solid-svg-icons'; interface Type { value: string; @@ -15,7 +18,14 @@ interface Type { @Component({ selector: 'agora-download-dom-image', - imports: [CommonModule, FormsModule, OverlayPanelModule, RadioButtonModule], + imports: [ + CommonModule, + FormsModule, + OverlayPanelModule, + RadioButtonModule, + ButtonModule, + FontAwesomeModule, + ], templateUrl: './download-dom-image.component.html', styleUrls: ['./download-dom-image.component.scss'], encapsulation: ViewEncapsulation.None, @@ -25,6 +35,9 @@ export class DownloadDomImageComponent { @Input() heading = 'Download this plot as:'; @Input() filename = 'agora'; + downloadIcon = faDownload; + spinnerIcon = faSpinner; + selectedType = '.png'; types: Type[] = [ { @@ -52,8 +65,14 @@ export class DownloadDomImageComponent { this.error = ''; this.isLoading = true; + // width and height need to be specified + // known issue: https://github.com/1904labs/dom-to-image-more/issues/198 domtoimage - .toBlob(this.target, { bgcolor: '#fff' }) + .toBlob(this.target, { + bgcolor: '#fff', + width: this.target.offsetWidth, + height: this.target.offsetHeight, + }) .then((blob: any) => { saveAs(blob, this.filename + this.selectedType); this.isLoading = false; diff --git a/libs/agora/genes/src/lib/components/gene-details/gene-details.routes.ts b/libs/agora/genes/src/lib/components/gene-details/gene-details.routes.ts index 3f44758a55..4d8024c6d4 100644 --- a/libs/agora/genes/src/lib/components/gene-details/gene-details.routes.ts +++ b/libs/agora/genes/src/lib/components/gene-details/gene-details.routes.ts @@ -1,4 +1,4 @@ import { Routes } from '@angular/router'; import { GeneDetailsComponent } from './gene-details.component'; -export const routes: Routes = [{ path: '', component: GeneDetailsComponent }]; +export const detailsRoute: Routes = [{ path: '', component: GeneDetailsComponent }]; diff --git a/libs/agora/genes/src/lib/components/gene-druggability/gene-druggability.component.ts b/libs/agora/genes/src/lib/components/gene-druggability/gene-druggability.component.ts index 4c16ef0574..48d74f9657 100644 --- a/libs/agora/genes/src/lib/components/gene-druggability/gene-druggability.component.ts +++ b/libs/agora/genes/src/lib/components/gene-druggability/gene-druggability.component.ts @@ -44,20 +44,18 @@ export class GeneDruggabilityComponent { // Update the initial buckets if (this.gene) { if (!this.gene.druggability) { - this.gene.druggability = [ - { - sm_druggability_bucket: this.getDefaultBucketNumber(), - safety_bucket: this.getDefaultBucketNumber(), - abability_bucket: this.getDefaultBucketNumber(), - pharos_class: '', - classification: this.getDefaultText(), - safety_bucket_definition: this.getDefaultText(), - abability_bucket_definition: this.getDefaultText(), - }, - ]; + this.gene.druggability = { + sm_druggability_bucket: this.getDefaultBucketNumber(), + safety_bucket: this.getDefaultBucketNumber(), + abability_bucket: this.getDefaultBucketNumber(), + pharos_class: [], + classification: this.getDefaultText(), + safety_bucket_definition: this.getDefaultText(), + abability_bucket_definition: this.getDefaultText(), + }; } - this.druggability = this.gene.druggability[0]; + this.druggability = this.gene.druggability; this.currentBucketSM = this.druggability.sm_druggability_bucket; this.currentBucketAB = this.druggability.abability_bucket; this.currentBucketSF = this.druggability.safety_bucket; diff --git a/libs/agora/genes/src/lib/components/gene-hero/gene-hero.component.html b/libs/agora/genes/src/lib/components/gene-hero/gene-hero.component.html index d4641a34fa..a8733547af 100644 --- a/libs/agora/genes/src/lib/components/gene-hero/gene-hero.component.html +++ b/libs/agora/genes/src/lib/components/gene-hero/gene-hero.component.html @@ -19,7 +19,7 @@

{{ getSummary() }}

- @if (gene.bio_domains || getAlias() || getEnsemblUrl() !== '') { + @if (gene.bio_domains || getAliases() || getEnsemblUrl() !== '') {
@if (gene.bio_domains) {
@@ -29,22 +29,29 @@

Biological Domains

} + @if (gene.druggability && gene.druggability.pharos_class) { +
+

Pharos Class

+

{{ gene.druggability.pharos_class.join(', ') }}

+
+ }

Also known as

- @if (getEnsemblUrl() !== '') { -

- {{ gene.ensembl_gene_id }} + @if (getEnsemblUrl(); as ensemblUrl) { +

+ {{ gene.ensembl_gene_id }} @if (gene.ensembl_info.ensembl_release) { (Ensembl Release {{ gene.ensembl_info.ensembl_release }}) }

} @if (getEnsemblUrl() === '') { - {{ gene.ensembl_gene_id }} +

+ {{ gene.ensembl_gene_id }} +

} - @if (gene.ensembl_info.ensembl_possible_replacements.length > 0) { -

+

Possible replacement valueAlso known as

{{ gene.ensembl_info.ensembl_possible_replacements.join(', ') }}

} - @if (alias !== '') { -

{{ alias }}

+ @if (gene.uniprotkb_accessions) { +

+ UNIPROTKB + + {{ accession }}, + +

+

+ {{ getAliases() }} +

}
} diff --git a/libs/agora/genes/src/lib/components/gene-hero/gene-hero.component.scss b/libs/agora/genes/src/lib/components/gene-hero/gene-hero.component.scss index 6f9f580dc9..7cec8a91c8 100644 --- a/libs/agora/genes/src/lib/components/gene-hero/gene-hero.component.scss +++ b/libs/agora/genes/src/lib/components/gene-hero/gene-hero.component.scss @@ -38,7 +38,17 @@ hr { } .gene-hero-biodomains { - margin-bottom: 30px; + margin-bottom: 15px; + + p { + margin-left: 10px; + } +} + +.gene-hero-pharos { + p { + margin-left: 10px; + } } .gene-hero-summary { @@ -50,11 +60,16 @@ hr { } .gene-hero-aliases-heading, -.gene-hero-biodomains-heading { +.gene-hero-biodomains-heading, +.gene-hero-pharos-heading { text-transform: uppercase; margin-bottom: 15px; } +.aliases { + margin: 0 0 0 10px; +} + .possible-replacements { margin-bottom: 15px; } diff --git a/libs/agora/genes/src/lib/components/gene-hero/gene-hero.component.ts b/libs/agora/genes/src/lib/components/gene-hero/gene-hero.component.ts index 445eff8d32..d1586fac24 100644 --- a/libs/agora/genes/src/lib/components/gene-hero/gene-hero.component.ts +++ b/libs/agora/genes/src/lib/components/gene-hero/gene-hero.component.ts @@ -1,5 +1,5 @@ import { CommonModule } from '@angular/common'; -import { Component, Input, OnInit } from '@angular/core'; +import { Component, Input } from '@angular/core'; import { Gene } from '@sagebionetworks/agora/api-client-angular'; import { ascending } from 'd3'; @@ -9,15 +9,9 @@ import { ascending } from 'd3'; templateUrl: './gene-hero.component.html', styleUrls: ['./gene-hero.component.scss'], }) -export class GeneHeroComponent implements OnInit { +export class GeneHeroComponent { @Input() gene: Gene | undefined; - alias = ''; - - ngOnInit() { - this.alias = this.getAlias(); - } - showNominationsOrTEP() { if (!this.gene) return false; return this.gene.total_nominations || this.gene.is_adi || this.gene.is_tep; @@ -90,13 +84,20 @@ export class GeneHeroComponent implements OnInit { } } - 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 ''; const biodomains = this.gene.bio_domains.gene_biodomains diff --git a/libs/agora/genes/src/lib/components/gene-resources/gene-resources.component.html b/libs/agora/genes/src/lib/components/gene-resources/gene-resources.component.html index 803d38d641..ca2bd56a9f 100644 --- a/libs/agora/genes/src/lib/components/gene-resources/gene-resources.component.html +++ b/libs/agora/genes/src/lib/components/gene-resources/gene-resources.component.html @@ -9,11 +9,11 @@

Target Enabling Resources

{{ gene.hgnc_symbol || gene.ensembl_gene_id }} that are currently available, under development, or planned.

-
-
+
+
Target Enabling Resources
-