Skip to content

Commit

Permalink
fix individual disease view, temp gene fix
Browse files Browse the repository at this point in the history
  • Loading branch information
v-rocheleau committed Oct 11, 2023
1 parent 82305e8 commit 06e4b70
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/components/explorer/IndividualDiseases.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ const IndividualDiseases = ({ individual }) => {
{
title: "Onset Age(s)",
key: "t_onset_ages",
render: (_, disease) =>
// Print onset age
(disease.hasOwnProperty("onset") && Object.keys(disease.onset).length)
// Single onset age
? (disease.onset.hasOwnProperty("age") && Object.keys(disease.onset.age).length)
? <div>{disease.onset.age}</div>
// Onset age start and end
: (disease.onset.hasOwnProperty("start") && Object.keys(disease.onset.start).length)
? <div>{disease.onset.start.age} - {disease.onset.end.age}</div>
// Onset age label only
: disease.onset.label
? <OntologyTerm resourcesTuple={resourcesTuple} term={disease.onset} />
: EM_DASH
: EM_DASH,
render: (_, disease) => {
if (disease.hasOwnProperty("onset") && Object.keys(disease.onset).length) {
const onset = disease.onset;
if (onset.hasOwnProperty("age") && Object.keys(onset.age).length) {
return <div>{onset.age.iso8601duration}</div>;
} else if (onset.hasOwnProperty("ageRange") && Object.keys(onset.age_range).length) {
return <div>{onset.ageRange.start.iso8601duration} - {onset.ageRange.end.iso8601duration}</div>;
} else if (onset.hasOwnProperty("ontologyClass") && Object.keys(onset.ontology_class).length) {
return <OntologyTerm resourcesTuple={resourcesTuple} term={onset.ontologyClass} />;
}
// TODO: new stuff that comes with TIME_ELEMENT representation
}
return EM_DASH;
},
},
{
title: "Extra Properties",
Expand Down
3 changes: 3 additions & 0 deletions src/components/explorer/IndividualGenes.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ const IndividualGenes = ({individual, tracksUrl}) => {
Object.fromEntries(
(individual || {}).phenopackets
.flatMap(p => p.genes)
.filter(Boolean)
// TODO: temp filter fix, genes are now in GenomicInterpretation
// new location: pheno.interpretation.diagnosis.genomic_interpretations.gene_descriptor.symbol
.map(g => [g.symbol, g]),
),
),
Expand Down

0 comments on commit 06e4b70

Please sign in to comment.