Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe committed Jan 19, 2024
1 parent ce44ee4 commit 3a33bb8
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 6 deletions.
5 changes: 5 additions & 0 deletions rules/output/annonars/genes.smk
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ rule output_annonars_genes: # -- build annonars genes RocksDB file
v_annonars=RE_VERSION,
shell:
r"""
if [[ "$(date +%Y%m%d)" != "{wildcards.date}" ]] && [[ "{FORCE_TODAY}" != "True" ]]; then
>&2 echo "{wildcards.date} is not today"
exit 1
fi
annonars gene import \
--path-out-rocksdb $(dirname {output.rocksdb_identity}) \
--path-in-acmg {input.acmg_sf} \
Expand Down
5 changes: 5 additions & 0 deletions rules/output/worker/hgnc.smk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ rule output_hgnc_xlink_binary:
spec_yaml=f"output/full/worker/genes-xlink-{{date}}+{PV.worker}/genes-xlink.spec.yaml",
shell:
r"""
if [[ "$(date +%Y%m%d)" != "{wildcards.date}" ]] && [[ "{FORCE_TODAY}" != "True" ]]; then
>&2 echo "{wildcards.date} is not today"
exit 1
fi
varfish-server-worker db to-bin \
--input-type xlink \
--path-input {input.tsv} \
Expand Down
5 changes: 5 additions & 0 deletions rules/work/genes/conditions.smk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ rule work_conditions_integrate: # integrate conditions file
jsonl="work/genes/conditions/{v_hpo}+{date}/conditions.jsonl",
shell:
r"""
if [[ "$(date +%Y%m%d)" != "{wildcards.date}" ]] && [[ "{FORCE_TODAY}" != "True" ]]; then
>&2 echo "{wildcards.date} is not today"
exit 1
fi
MIM2GENE_MEDGEN_PATH="{input.mim2gene_medgen}" \
GENES_XLINK_PATH="{input.genes_xlink}" \
HPOA_PATH="{input.hpoa}" \
Expand Down
5 changes: 5 additions & 0 deletions rules/work/genes/ctd.smk
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@ rule genes_ctd_download: # -- download CTD
tsv="work/download/genes/ctd/{date}/CTD_diseases.tsv.gz",
shell:
"""
if [[ "$(date +%Y%m%d)" != "{wildcards.date}" ]] && [[ "{FORCE_TODAY}" != "True" ]]; then
>&2 echo "{wildcards.date} is not today"
exit 1
fi
wget -O {output.tsv} https://ctdbase.org/reports/CTD_diseases.tsv.gz
"""
5 changes: 5 additions & 0 deletions rules/work/genes/do.smk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ rule work_disease_ontology_download: # -- download DO files
omim_import="work/download/do/{date}/omim_import.obo",
shell:
r"""
if [[ "$(date +%Y%m%d)" != "{wildcards.date}" ]] && [[ "{FORCE_TODAY}" != "True" ]]; then
>&2 echo "{wildcards.date} is not today"
exit 1
fi
wget -O {output.unmapped_csv} \
https://github.com/DiseaseOntology/HumanDiseaseOntology/raw/main/src/deprecated/reports/omim-unmapped.csv
wget -O {output.omimindo_tsv} \
Expand Down
7 changes: 6 additions & 1 deletion rules/work/genes/omim.smk
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ rule genes_omim: # -- prepare HGNC to OMIM disease mapping
"""
set -x
if [[ "$(date +%Y%m%d)" != "{wildcards.date}" ]] && [[ "{FORCE_TODAY}" != "True" ]]; then
>&2 echo "{wildcards.date} is not today"
exit 1
fi
export TMPDIR=$(mktemp -d)
# trap "rm -rf $TMPDIR" ERR EXIT
trap "rm -rf $TMPDIR" ERR EXIT
head -n 1 {input.mim2gene} | sed -e 's/ /_/g' -e 's/#//g' \
> $TMPDIR/mim2gene.tsv
Expand Down
12 changes: 7 additions & 5 deletions rules/work/genes/orphadata.smk
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@

rule genes_orphadata_download: # -- download orphadatas
output:
jsonl="work/genes/orphadata/{version}/orphadata.jsonl",
jsonl_md5="work/genes/orphadata/{version}/orphadata.jsonl.md5",
tsv="work/genes/orphadata/{version}/orpha_diseases.tsv", # xxx
jsonl="work/genes/orphadata/{date}/orphadata.jsonl",
jsonl_md5="work/genes/orphadata/{date}/orphadata.jsonl.md5",
tsv="work/genes/orphadata/{date}/orpha_diseases.tsv", # xxx
shell:
"""
export TMPDIR=$(mktemp -d)
trap "rm -rf $TMPDIR" ERR EXIT
if [[ "$(date +%Y%m%d)" != "{wildcards.date}" ]] && [[ "{FORCE_TODAY}" != "True" ]]; then
>&2 echo "{wildcards.date} is not today"
exit 1
fi
python ./scripts/genes-orpha-diseases.py \
> {output.jsonl}
Expand Down

0 comments on commit 3a33bb8

Please sign in to comment.