Skip to content

Commit

Permalink
feat(variant): SKFP-772 variant facet and column
Browse files Browse the repository at this point in the history
  • Loading branch information
GaelleA committed Sep 25, 2023
1 parent e6a1187 commit 127cbdf
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 11 deletions.
8 changes: 5 additions & 3 deletions src/components/uiKit/FilterList/CustomFilterSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { useEffect } from 'react';
import FilterSelector, {
FilterSelectorProps,
} from '@ferlab/ui/core/components/filters/FilterSelector';
import useQueryBuilderState from '@ferlab/ui/core/components/QueryBuilder/utils/useQueryBuilderState';
import { resolveSyntheticSqon } from '@ferlab/ui/core/data/sqon/utils';
import { IExtendedMappingResults } from '@ferlab/ui/core/graphql/types';
import { Spin } from 'antd';
import { useEffect } from 'react';
import useGetAggregations from 'hooks/graphql/useGetAggregations';
import { AGGREGATION_QUERY } from 'graphql/queries';

import useGetAggregations from 'hooks/graphql/useGetAggregations';

import { TCustomFilterMapper } from '.';
import { IExtendedMappingResults } from '@ferlab/ui/core/graphql/types';

type OwnProps = FilterSelectorProps & {
index: string;
Expand Down
13 changes: 7 additions & 6 deletions src/components/uiKit/FilterList/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { useState } from 'react';
import { Button, Layout, Space, Spin, Typography } from 'antd';
import CustomFilterContainer from './CustomFilterContainer';
import intl from 'react-intl-universal';
import { FilterGroup, FilterInfo } from './types';
import { ISqonGroupFilter, ISyntheticSqon } from '@ferlab/ui/core/data/sqon/types';
import { IExtendedMappingResults } from '@ferlab/ui/core/graphql/types';
import { Button, Layout, Space, Spin, Typography } from 'antd';
import cx from 'classnames';
import { isEmpty } from 'lodash';

import styles from 'components/uiKit/FilterList/Filters.module.scss';
import { isEmpty } from 'lodash';
import { IExtendedMappingResults } from '@ferlab/ui/core/graphql/types';

import CustomFilterContainer from './CustomFilterContainer';
import { FilterGroup, FilterInfo } from './types';

export type TCustomFilterMapper = (filters: ISqonGroupFilter) => ISyntheticSqon;

Expand All @@ -31,7 +32,7 @@ const isAllFacetOpen = (filterInfo: FilterInfo) => {
};

const concatAllFacets = (filterInfo: FilterInfo) => {
let allFacets: any[] = [];
const allFacets: any[] = [];
filterInfo.groups.forEach(({ facets }) => allFacets.push(...facets));
return allFacets;
};
Expand Down
51 changes: 51 additions & 0 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,11 @@ const en = {
},
title: 'Variants Exploration',
table: {
mostDeleteriousConsequence: {
title: 'Most Deleterious Consequence',
tooltip: 'Functional consequences of genetic variations annotated using VEP',
},
// TODO remove when new variant ETL will be used
consequences: {
title: 'Consequences',
tooltip: 'Functional consequences of genetic variations annotated using VEP',
Expand Down Expand Up @@ -1130,6 +1135,8 @@ const en = {
},
studies: {
study_code: 'Study Code',
zygosity: 'Zygosity',
transmission: 'Transmission',
},
is_proband: 'Proband',
study_id: 'Study Code',
Expand Down Expand Up @@ -1212,6 +1219,28 @@ const en = {
},
},
genes: {
consequences: {
consequence: 'Consequence',
vep_impact: 'VEP',
predictions: {
cadd_score: 'CADD (Raw)',
cadd_phred: 'CADD (Phred)',
dann_score: 'DANN',
fathmm_pred: 'FATHMM',
lrt_pred: 'LRT',
polyphen2_hvar_pred: 'PolyPhen-2 HVAR',
revel_score: 'REVEL',
sift_pred: 'SIFT',
},
},
biotype: 'Gene Type',
gnomad: {
pli: 'gnomAD pLI',
loeuf: 'gnomAD LOEUF',
},
spliceai: {
ds: 'SpliceAI',
},
hpo: {
hpo_term_label: 'HPO',
},
Expand All @@ -1231,6 +1260,28 @@ const en = {
clinvar: {
clin_sig: 'ClinVar',
},
external_frequencies: {
gnomad_genomes_2_1_1: {
af: 'gnomAD Genome 2.1.1',
},
gnomad_genomes_3: {
af: 'gnomAD Genome 3.1.2',
},
gnomad_exomes_2_1_1: {
af: 'gnomAD Exome 2.1.1',
},
topmed_bravo: {
af: 'TopMed',
},
thousand_genomes: {
af: '1000 Genomes',
},
},
internal_frequencies: {
total: {
af: 'KF Allele Frequency',
},
},
frequencies: {
internal: {
upper_bound_kf: { af: 'KF Allele Frequency' },
Expand Down
46 changes: 46 additions & 0 deletions src/utils/translation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ export const getFacetsDictionary = () => ({
},
studies: {
study_code: 'Study Code',
zygosity: 'Zygosity',
transmission: 'Transmission',
},
start: 'Position',
acl: 'ACL',
Expand Down Expand Up @@ -302,6 +304,28 @@ export const getFacetsDictionary = () => ({
},
},
genes: {
consequences: {
consequence: 'Consequence',
vep_impact: 'VEP',
predictions: {
cadd_score: 'CADD (Raw)',
cadd_phred: 'CADD (Phred)',
dann_score: 'DANN',
fathmm_pred: 'FATHMM',
lrt_pred: 'LRT',
polyphen2_hvar_pred: 'PolyPhen-2 HVAR',
revel_score: 'REVEL',
sift_pred: 'SIFT',
},
},
biotype: 'Gene Type',
gnomad: {
pli: 'gnomAD pLI',
loeuf: 'gnomAD LOEUF',
},
spliceai: {
ds: 'SpliceAI',
},
hpo: {
hpo_term_label: 'HPO',
},
Expand All @@ -318,6 +342,28 @@ export const getFacetsDictionary = () => ({
tumour_types_germline: 'COSMIC',
},
},
external_frequencies: {
gnomad_genomes_2_1_1: {
af: 'gnomAD Genome 2.1.1',
},
gnomad_genomes_3: {
af: 'gnomAD Genome 3.1.2',
},
gnomad_exomes_2_1_1: {
af: 'gnomAD Exome 2.1.1',
},
topmed_bravo: {
af: 'TopMed',
},
thousand_genomes: {
af: '1000 Genomes',
},
},
internal_frequencies: {
total: {
af: 'KF Allele Frequency',
},
},
frequencies: {
internal: {
upper_bound_kf: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ const defaultColumns: ProColumnType[] = [
},
{
key: 'consequences',
title: intl.get('screen.variants.table.consequences.title'),
title: intl.get('screen.variants.table.mostDeleteriousConsequence.title'),
dataIndex: 'genes',
tooltip: intl.get('screen.variants.table.consequences.tooltip'),
tooltip: intl.get('screen.variants.table.mostDeleteriousConsequence.tooltip'),
render: (genes: IArrangerResultsTree<IGeneEntity>) => {
const geneWithPickedConsequence = genes?.hits?.edges?.find((e) =>
(e.node.consequences || [])?.hits?.edges?.some((e) => e.node?.picked),
Expand Down

0 comments on commit 127cbdf

Please sign in to comment.