Skip to content

Commit

Permalink
Add OpenCRAVAT predictor annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
susannasiebert committed Feb 4, 2025
1 parent 0c25c17 commit cce032d
Show file tree
Hide file tree
Showing 16 changed files with 356 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
<nz-descriptions
nzLayout="horizontal"
nzSize="small"
[nzColumn]="{ xxl: 2, xl: 2, lg: 1, md: 1, sm: 1, xs: 1 }"
[nzColumn]="{ xxl: 3, xl: 2, lg: 1, md: 1, sm: 1, xs: 1 }"
nzBordered="true">
<!-- feature -->
<nz-descriptions-item nzTitle="Gene">
Expand Down Expand Up @@ -233,35 +233,39 @@
>
</ng-template>
</nz-descriptions-item>

<nz-descriptions-item
*ngIf="variant.openCravatUrl"
nzTitle="OpenCRAVAT">
<cvc-link-tag
[href]="variant.openCravatUrl"
tooltip="View on OpenCRAVAT">
Variant Report
</cvc-link-tag>
</nz-descriptions-item>
</nz-descriptions>
</nz-col>

<!-- myvariant info -->
<ng-container *ngIf="variant.myVariantInfo; else noVariantInfo">
<nz-col [nzSpan]="24">
<nz-col [nzSpan]="24">
<ng-container *ngIf="variant.myVariantInfo; else noVariantInfo">
<cvc-my-variant-info
[variantInfo]="variant.myVariantInfo"></cvc-my-variant-info>
</nz-col>
</ng-container>
<ng-template #noVariantInfo>
<nz-col [nzSpan]="24">
</ng-container>
<ng-template #noVariantInfo>
<nz-card nzTitle="MyVariantInfo">
<cvc-empty-revisable
notification="Not available, provide Representative Variant Coordinates">
</cvc-empty-revisable>
</nz-card>
</nz-col>
</ng-template>
</ng-template>
</nz-col>

<!-- OpenCRAVAT Annotations-->
<nz-col [nzSpan]="24">
@if (variant.openCravatAnnotations && variant.openCravatUrl) {
<cvc-open-cravat-annotations
[openCravatAnnotations]="variant.openCravatAnnotations"
[openCravatUrl]="variant.openCravatUrl + ''">
</cvc-open-cravat-annotations>
} @else {
<nz-card nzTitle="OpenCRAVAT Annotations">
<cvc-empty-revisable
notification="Not available, provide Representative Variant Coordinates">
</cvc-empty-revisable>
</nz-card>
}
</nz-col>
</nz-row>
</nz-col>
<!-- END RIGHT COL -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { VariantSummaryFieldsFragment } from '@app/generated/civic.apollo'
import { CvcUserTagModule } from '@app/components/users/user-tag/user-tag.module'
import { CvcFeatureTagModule } from '@app/components/features/feature-tag/feature-tag.module'
import { CvcPipesModule } from '@app/core/pipes/pipes.module'
import { CvcOpenCravatAnnotationsModule } from '../open-cravat-annotations/open-cravat-annotations.module'

@Component({
standalone: true,
Expand All @@ -39,6 +40,7 @@ import { CvcPipesModule } from '@app/core/pipes/pipes.module'
CvcFeatureTagModule,
CvcMolecularProfilesTableModule,
CvcMyVariantInfoModule,
CvcOpenCravatAnnotationsModule,
CvcPipesModule,
],
})
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<ng-container *ngIf="openCravatAnnotations && openCravatUrl">
<nz-card
nzTitle="OpenCRAVAT Annotations"
[nzExtra]="openCravatUrlTemplate">
<ng-template #openCravatUrlTemplate>
<cvc-link-tag
[href]="openCravatUrl"
tooltip="View on OpenCRAVAT">
Variant Report
</cvc-link-tag>
</ng-template>
<nz-card-tab>
<nz-tabset
nzSize="small"
[nzAnimated]="true">
<nz-tab
(nzClick)="tabIndex.next(0)"
nzTitle="Overview">
</nz-tab>
<nz-tab
(nzClick)="tabIndex.next(1)"
nzTitle="Benignity Details">
</nz-tab>
<nz-tab
(nzClick)="tabIndex.next(2)"
nzTitle="Pathogenicity Details"></nz-tab>
</nz-tabset>
</nz-card-tab>
<ng-container [ngSwitch]="tabIndex | async">
<!-- Overview tab -->
<ng-container *ngSwitchCase="0">
<div nz-row [nzGutter]="8">
<div nz-col nzXs="24" nzSm="24" nzMd="24" nzLg="12" nzXl="12">
<nz-card nzTitle="ACMG/AMP Benign (BP4)" nzSize="small">
@if ((openCravatAnnotations.benignity_counts|keyvalue).length === 0) {
<div nz-typography nzType="secondary">
No Annotations
</div>
}
@for (keypar of openCravatAnnotations.benignity_counts|keyvalue; track keypar.key) {
<div
nz-tooltip
nzTooltipPlacement="topLeft"
[nzTooltipTitle]="openCravatAnnotations.benignity_counts_details[keypar.key+''].join(', ')">
{{ keypar.key }} ({{ keypar.value }})
</div>
}
</nz-card>
</div>
<div nz-col nzXs="24" nzSm="24" nzMd="24" nzLg="12" nzXl="12">
<nz-card nzTitle="ACMG/AMP Pathogenic (PP3)" nzSize="small">
@if ((openCravatAnnotations.pathogenicity_counts|keyvalue).length === 0) {
<div>
None
</div>
}
@for (keypar of openCravatAnnotations.pathogenicity_counts|keyvalue; track keypar.key) {
<div
nz-tooltip
nzTooltipPlacement="topLeft"
[nzTooltipTitle]="openCravatAnnotations.pathogenicity_counts_details[keypar.key+''].join(', ')">
{{ keypar.key }} ({{ keypar.value }})
</div>
}
</nz-card>
</div>
</div>
</ng-container>
<!-- Benignity tab -->
<ng-container *ngSwitchCase="1">
<nz-table
[nzData]="['.']"
[nzFrontPagination]="false"
[nzShowPagination]="false"
nzSize="small">
<thead>
<tr>
<th>Predictor</th>
<th>Annotation</th>
</tr>
</thead>
<tbody>
@for (keypar of openCravatAnnotations.benignity|keyvalue; track keypar.key) {
<tr>
<td>{{ keypar.key }}</td>
<td>
{{ keypar.value | ifEmpty : '--' }}
</td>
</tr>
}
</tbody>
</nz-table>
</ng-container>
<!-- Pathogenicity tab -->
<ng-container *ngSwitchCase="2">
<nz-table
[nzData]="['.']"
[nzFrontPagination]="false"
[nzShowPagination]="false"
nzSize="small">
<thead>
<tr>
<th>Predictor</th>
<th>Annotation</th>
</tr>
</thead>
<tbody>
@for (keypar of openCravatAnnotations.pathogenicity|keyvalue; track keypar.key) {
<tr>
<td>{{ keypar.key }}</td>
<td>
{{ keypar.value | ifEmpty : '--' }}
</td>
</tr>
}
</tbody>
</nz-table>
</ng-container>
</ng-container>
</nz-card>
</ng-container>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:host {
display: block;
}

nz-card {
width: 100%;
}

.key-col {
text-align: right;
font-weight: bold;
}
.button-col {
text-align: right;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Component, Input, OnDestroy } from '@angular/core'
import { Maybe } from '@app/generated/civic.apollo'
import { BehaviorSubject } from 'rxjs'

@Component({
selector: 'cvc-open-cravat-annotations',
templateUrl: './open-cravat-annotations.component.html',
styleUrls: ['./open-cravat-annotations.component.less'],
})
export class CvcOpenCravatAnnotationsComponent implements OnDestroy {
@Input() openCravatAnnotations: any
@Input() openCravatUrl: Maybe<string>

tabIndex = new BehaviorSubject<number>(0)

constructor() {
}

tabChange(index: number): void {
this.tabIndex.next(index)
}

ngOnDestroy(): void {
this.tabIndex.unsubscribe()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { NgModule } from '@angular/core'
import { CommonModule } from '@angular/common'
import { CvcOpenCravatAnnotationsComponent } from './open-cravat-annotations.component'
import { NzTabsModule } from 'ng-zorro-antd/tabs'
import { NzCardModule } from 'ng-zorro-antd/card'
import { NzGridModule } from 'ng-zorro-antd/grid'
import { NzTableModule } from 'ng-zorro-antd/table'
import { CvcPipesModule } from '@app/core/pipes/pipes.module'
import { CvcLinkTagModule } from '@app/components/shared/link-tag/link-tag.module'
import { NzToolTipModule } from 'ng-zorro-antd/tooltip'
import { CvcEmptyValueModule } from '@app/forms/components/empty-value/empty-value.module'
import { NzTypographyModule } from 'ng-zorro-antd/typography'

@NgModule({
declarations: [CvcOpenCravatAnnotationsComponent],
imports: [
CommonModule,
NzTabsModule,
NzTableModule,
NzCardModule,
NzToolTipModule,
NzGridModule,
NzTypographyModule,
CvcLinkTagModule,
CvcPipesModule,
],
exports: [CvcOpenCravatAnnotationsComponent],
})
export class CvcOpenCravatAnnotationsModule {}
3 changes: 2 additions & 1 deletion client/src/app/generated/civic.apollo-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ export type GeneEdgeFieldPolicy = {
cursor?: FieldPolicy<any> | FieldReadFunction<any>,
node?: FieldPolicy<any> | FieldReadFunction<any>
};
export type GeneVariantKeySpecifier = ('alleleRegistryId' | 'clinvarIds' | 'comments' | 'coordinates' | 'creationActivity' | 'deprecated' | 'deprecationActivity' | 'deprecationReason' | 'events' | 'feature' | 'flagged' | 'flags' | 'hgvsDescriptions' | 'id' | 'lastAcceptedRevisionEvent' | 'lastCommentEvent' | 'lastSubmittedRevisionEvent' | 'link' | 'maneSelectTranscript' | 'molecularProfiles' | 'myVariantInfo' | 'name' | 'openCravatUrl' | 'openRevisionCount' | 'primaryCoordinates' | 'revisions' | 'singleVariantMolecularProfile' | 'singleVariantMolecularProfileId' | 'variantAliases' | 'variantTypes' | GeneVariantKeySpecifier)[];
export type GeneVariantKeySpecifier = ('alleleRegistryId' | 'clinvarIds' | 'comments' | 'coordinates' | 'creationActivity' | 'deprecated' | 'deprecationActivity' | 'deprecationReason' | 'events' | 'feature' | 'flagged' | 'flags' | 'hgvsDescriptions' | 'id' | 'lastAcceptedRevisionEvent' | 'lastCommentEvent' | 'lastSubmittedRevisionEvent' | 'link' | 'maneSelectTranscript' | 'molecularProfiles' | 'myVariantInfo' | 'name' | 'openCravatAnnotations' | 'openCravatUrl' | 'openRevisionCount' | 'primaryCoordinates' | 'revisions' | 'singleVariantMolecularProfile' | 'singleVariantMolecularProfileId' | 'variantAliases' | 'variantTypes' | GeneVariantKeySpecifier)[];
export type GeneVariantFieldPolicy = {
alleleRegistryId?: FieldPolicy<any> | FieldReadFunction<any>,
clinvarIds?: FieldPolicy<any> | FieldReadFunction<any>,
Expand All @@ -1326,6 +1326,7 @@ export type GeneVariantFieldPolicy = {
molecularProfiles?: FieldPolicy<any> | FieldReadFunction<any>,
myVariantInfo?: FieldPolicy<any> | FieldReadFunction<any>,
name?: FieldPolicy<any> | FieldReadFunction<any>,
openCravatAnnotations?: FieldPolicy<any> | FieldReadFunction<any>,
openCravatUrl?: FieldPolicy<any> | FieldReadFunction<any>,
openRevisionCount?: FieldPolicy<any> | FieldReadFunction<any>,
primaryCoordinates?: FieldPolicy<any> | FieldReadFunction<any>,
Expand Down
Loading

0 comments on commit cce032d

Please sign in to comment.