Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: even more types for stores and apis #90

Merged
merged 4 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/api/annonars/__snapshots__/client.spec.ts.snap

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/api/annonars/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ export interface GeneInfoResult {
class GeneInfoResult$Type {
fromJson(apiResult: GeneInfoResult$Api): GeneInfoResult {
return {
genes: Object.values(apiResult.genes)
genes: Object.values(apiResult.genes).map((gene$Api) =>
// @ts-ignore
GeneInfoRecord.fromJson(gene$Api as JsonValue)
)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/api/viguno/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export const HpoGeneQuery = new HpoGeneQuery$Type()
export interface HpoGenesResult$Api {
version: Version$Api
query: HpoGeneQuery$Api
result: HpoTerm$Api[]
result: Gene$Api[]
}

/** Interface for response of gene lookup. */
Expand All @@ -301,7 +301,7 @@ class HpoGenesResult$Type {
return {
version: Version.fromJson(api.version),
query: HpoGeneQuery.fromJson(api.query),
result: api.result.map(HpoTerm.fromJson)
result: (api.result[0]?.hpo_terms || []).map(HpoTerm.fromJson)
}
}
}
Expand Down
20 changes: 11 additions & 9 deletions src/components/GeneExpressionCard/GeneExpressionCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,17 @@ const vegaData = computed<VegaData[]>(() => {
}
})
}
return expressionRecords.map((record: GtexTissueRecord) => ({
tissue: TISSUE_LABELS[record.tissue],
tissueDetailed: TISSUE_DETAILED_LABELS[record.tissueDetailed],
lower: record.tpms[0],
q1: record.tpms[1],
median: record.tpms[2],
q3: record.tpms[3],
upper: record.tpms[4]
}))
return expressionRecords.map((record: GtexTissueRecord) => {
return {
tissue: TISSUE_LABELS[record.tissue],
tissueDetailed: TISSUE_DETAILED_LABELS[record.tissueDetailed],
lower: record.tpms[0],
q1: record.tpms[1],
median: record.tpms[2],
q3: record.tpms[3],
upper: record.tpms[4]
}
})
})

/** The encoding for the Vega plot. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ const props = withDefaults(
<template v-else> No gnomAD constraints </template>
</v-sheet>
</v-col>
<v-col cols="3">
<slot></slot>
</v-col>
</v-row>
</template>
</v-card-text>
Expand Down
Loading
Loading