Skip to content

Commit

Permalink
React/Server: Add Gene Name to results table (#383)
Browse files Browse the repository at this point in the history
* Add Gene Name to results table

* Formatting
  • Loading branch information
frewmack authored Mar 18, 2024
1 parent 6a66d68 commit 5ceb6e9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion react/src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export type FlattenedQueryResponse = Omit<IndividualResponseFields, 'info' | 'di
'callsets' | 'info'
> &
CallsetInfoFields &
VariantResponseInfoFields & { source: string; diseases: string };
VariantResponseInfoFields & { source: string; diseases: string; geneName: string };
export interface ResultTableColumns extends FlattenedQueryResponse {
maleCount: number;
emptyCaseDetails: string;
Expand Down Expand Up @@ -142,6 +142,12 @@ const Table: React.FC<TableProps> = ({ variantData }) => {
disableFilters: true,
disableSortBy: true,
},
{
accessor: 'geneName',
id: 'geneName',
Header: 'Gene Name',
width: getColumnWidth('Gene Name'),
},
{
accessor: 'start',
id: 'start',
Expand Down
1 change: 1 addition & 0 deletions react/src/utils/tableHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const addAdditionalFieldsAndFormatNulls = (
gnomadHom: results.gnomadHom || 0,
// gnomadHet: results.gnomadHet || 0,
maleCount: 0,
geneName: !!results.geneName ? results.geneName! : 'Not Specified',
});

export const calculateColumnWidth = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ export const transformCMHQueryResponse: ResultTransformer<G4RDVariantQueryResult
ref: r.variant.ref,
start: r.variant.start,
chromosome: r.variant.chromosome,
info: r.variant.info,
};

let familyId: string = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ export const transformG4RDQueryResponse: ResultTransformer<PTVariantArray> = tim
ref: r.variant.ref,
start: r.variant.start,
chromosome: r.variant.chromosome,
info: r.variant.info,
};

const familyId: string = familyIds[individualId];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ const transformStagerQueryResponse: ResultTransformer<StagerVariantQueryPayload[
ad: g.alt_depths,
burder: g.burden,
zygosity: g.zygosity,
geneName: r.gene,
},
})),
end: r.position,
Expand Down

0 comments on commit 5ceb6e9

Please sign in to comment.