Skip to content

Commit

Permalink
Use all endpoints, explicit startup of hail runtime (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
MattWellie authored Jul 1, 2024
1 parent 7b7bb44 commit 753bdc0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:3.10-bullseye

# take as a command line argument, or
ARG RELEASE=${RELEASE:-1.2.0}
ARG RELEASE=${RELEASE:-1.3.0}

RUN apt update && apt install -y \
apt-transport-https \
Expand Down
3 changes: 3 additions & 0 deletions clinvarbitration/clinvar_by_codon.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ def main(input_vcf: str, output_root: str):
# now set a schema to read that into a table... if you want hail
schema = hl.dtype('struct{newkey:str,clinvar_alleles:str}')

# start the local hail runtime
hl.context.init_local(default_reference='GRCh38')

# import the table, and transmute to top-level attributes
ht = hl.import_table(json_out_path, no_header=True, types={'f0': schema})
ht = ht.transmute(**ht.f0)
Expand Down
3 changes: 1 addition & 2 deletions clinvarbitration/resummarise_clinvar.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,7 @@ def parse_into_table(json_path: str, out_path: str) -> hl.Table:
"""

# start a hail runtime
hl.init(default_reference='GRCh38')
# hl.context.init_local(default_reference='GRCh38')
hl.context.init_local(default_reference='GRCh38')

# define the schema for each written line
schema = hl.dtype(
Expand Down
4 changes: 2 additions & 2 deletions example_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ docker run -v "$(pwd)/data":/data clinvarbitration:example \
## This is where you should run VEP on data/clinvar_summary.vcf.bgz, with protein consequence annotation per transcript
## Let's imagine you did that, and the result is in data/pathogenic_annotated.vcf.bgz
## I've enclosed a 10-variant example of this, as annotated by https://www.ensembl.org/Homo_sapiens/Tools/VEP
#docker run --platform linux/amd64 -v "$(pwd)/data":/data clinvarbitration:example \
# /bin/bash -c "python3 /clinvarbitration/clinvar_by_codon.py -i /data/pathogenic_annotated.vcf.bgz -o /data/pm5"
docker run --platform linux/amd64 -v "$(pwd)/data":/data clinvarbitration:example \
pm5_table -i /data/pathogenic_annotated.vcf.bgz -o /data/pm5

# upon completion, this will generate files in the data directory:
# - data/pm5.json - a JSON file containing the PM5 results, one JSON object per line
Expand Down

0 comments on commit 753bdc0

Please sign in to comment.