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(gold_standard): add traitFromSourceMappedId to schema #924

Merged
merged 6 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
6 changes: 6 additions & 0 deletions src/gentropy/assets/schemas/l2g_gold_standard.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
"nullable": false,
"metadata": {}
},
{
"name": "traitFromSourceMappedId",
"type": "string",
"nullable": true,
"metadata": {}
},
{
"name": "goldStandardSet",
"type": "string",
Expand Down
2 changes: 1 addition & 1 deletion src/gentropy/dataset/l2g_feature_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(
with_gold_standard (bool): Whether to include the gold standard set in the feature matrix.
"""
self.with_gold_standard = with_gold_standard
self.fixed_cols = ["studyLocusId", "geneId"]
self.fixed_cols = ["studyLocusId", "geneId", "traitFromSourceMappedId"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feature matrix doesn't have a schema.
But I need to define that this column is expected as one of the fixed columns to pivot on.

if self.with_gold_standard:
self.fixed_cols.append("goldStandardSet")

Expand Down
2 changes: 1 addition & 1 deletion tests/gentropy/dataset/test_l2g_feature_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def _setup(self: TestFromFeaturesList, spark: SparkSession) -> None:
"""Setup fixture."""
self.sample_gold_standard = L2GGoldStandard(
_df=spark.createDataFrame(
[(1, "var1", "gwas1", "g1", "positive", ["a_source"])],
[(1, "var1", "gwas1", "g1", "efo1", "positive", ["a_source"])],
L2GGoldStandard.get_schema(),
),
_schema=L2GGoldStandard.get_schema(),
Expand Down
Loading