This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Approach 1. Assign phased from one position until next. | |
| import pandas as pd | |
| import numpy as np | |
| def assign_phase_untilNext(df): | |
| df = df.sort_values(["CHROM", "POS"]).reset_index(drop=True) | |
| # Keep only phased SNPs as anchors | |
| phased_mask = df["GT"].isin(["0|1", "1|0"]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### load datasets | |
| target_path = "gs://open-targets-data-releases/24.03/output/etl/parquet/targets/" | |
| target = spark.read.parquet(target_path) | |
| go = spark.read.parquet("gs://open-targets-data-releases/24.03/output/etl/parquet/go") | |
| diseases_all = spark.read.parquet( | |
| "gs://open-targets-data-releases/24.03/output/etl/parquet/diseases/" | |
| ) | |
| #### Target Facets |