Skip to content

Commit

Permalink
chore: pre-commit auto fixes [...]
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Nov 18, 2024
1 parent 1b74b74 commit 6a9601f
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions notebooks/20241114_out_of_sample_validation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,15 @@
"import os\n",
"\n",
"import hail as hl\n",
"import numpy as np\n",
"import pyspark.sql.functions as f\n",
"from pyspark.sql import DataFrame\n",
"\n",
"from gentropy.common.session import Session\n",
"from gentropy.dataset.study_index import StudyIndex\n",
"from gentropy.dataset.summary_statistics import SummaryStatistics\n",
"from gentropy.dataset.study_locus import StudyLocus\n",
"from gentropy.susie_finemapper import SusieFineMapperStep\n",
"\n",
"hail_dir = os.path.dirname(hl.__file__)\n",
"session = Session(hail_home=hail_dir, start_hail=True, extended_spark_conf={\n",
" \"spark.driver.memory\": \"12g\",\"spark.kryoserializer.buffer.max\": \"500m\",\"spark.driver.maxResultSize\":\"2g\",\n",
" 'spark.hadoop.fs.gs.requester.pays.buckets': 'requester-pays-bucket1,requester-pays-bucket2',\n",
" 'spark.hadoop.fs.gs.requester.pays.project.id': 'open-targets-genetics-dev',\n",
" \"spark.hadoop.fs.gs.requester.pays.buckets\": \"requester-pays-bucket1,requester-pays-bucket2\",\n",
" \"spark.hadoop.fs.gs.requester.pays.project.id\": \"open-targets-genetics-dev\",\n",
" \"spark.hadoop.fs.gs.requester.pays.mode\":\"AUTO\"})"
]
},
Expand Down Expand Up @@ -173,7 +167,7 @@
" .cache())\n",
"\n",
" counts_df = df.groupBy(\"gsp_status\", \"score_to_use\").agg(f.count(\"*\").alias(\"count\"))\n",
" counts = { (row.gsp_status, row.score_to_use): row['count'] for row in counts_df.collect() }\n",
" counts = { (row.gsp_status, row.score_to_use): row[\"count\"] for row in counts_df.collect() }\n",
" count_1_1 = counts.get((1, 1), 0)\n",
" count_1_0 = counts.get((1, 0), 0)\n",
" count_0_1 = counts.get((0, 1), 0)\n",
Expand Down Expand Up @@ -273,7 +267,7 @@
" valid_set_to_remove.select(\"studyLocusId\", \"geneId\"),\n",
" on=[\"studyLocusId\", \"geneId\"],\n",
" how=\"left_anti\"\n",
" ) \n",
" )\n",
" validate_pred(\n",
" valid_set=filtered_valid_set,\n",
" prediction_set=filtered_l2g,\n",
Expand Down Expand Up @@ -318,7 +312,7 @@
" gsp_colum=\"goldStandardSet\",\n",
" positive=\"positive\",\n",
" score_thr=thr,\n",
" ) \n",
" )\n",
"\n",
" print(\"\")\n",
" print(\"\")\n",
Expand All @@ -333,7 +327,7 @@
" gsp_colum=\"Goldstandard_positive\",\n",
" positive=1,\n",
" score_thr=thr,\n",
" ) \n"
" )\n"
]
},
{
Expand Down

0 comments on commit 6a9601f

Please sign in to comment.