Skip to content

Instantly share code, notes, and snippets.

@joverlee521
Last active August 29, 2024 18:04
Show Gist options
  • Save joverlee521/f88da0703c5b51fdfd0d37f502e3e518 to your computer and use it in GitHub Desktop.
Save joverlee521/f88da0703c5b51fdfd0d37f502e3e518 to your computer and use it in GitHub Desktop.

Revisions

  1. joverlee521 revised this gist Aug 29, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions vidrl-human-sera-ingest.smk
    Original file line number Diff line number Diff line change
    @@ -84,7 +84,7 @@ rule ingest_h3n2_fra:
    shell:
    r"""
    python3 tdb/vidrl_upload.py \
    -db test_tdb \
    -db vidrl_tdb \
    -v flu \
    --subtype h3n2 \
    --assay_type fra \
    @@ -109,7 +109,7 @@ rule ingest_vic:
    shell:
    r"""
    python3 tdb/vidrl_upload.py \
    -db test_tdb \
    -db vidrl_tdb \
    -v flu \
    --subtype vic \
    --assay_type hi \
  2. joverlee521 renamed this gist Aug 29, 2024. 1 changed file with 2 additions and 2 deletions.
    Original file line number Diff line number Diff line change
    @@ -34,7 +34,7 @@ rule ingest_h1n1pdm:
    shell:
    r"""
    python3 tdb/vidrl_upload.py \
    -db test_tdb \
    -db vidrl_tdb \
    -v flu \
    --subtype h1n1pdm \
    --assay_type hi \
    @@ -59,7 +59,7 @@ rule ingest_h3n2:
    shell:
    r"""
    python3 tdb/vidrl_upload.py \
    -db test_tdb \
    -db vidrl_tdb \
    -v flu \
    --subtype h3n2 \
    --assay_type hi \
  3. joverlee521 created this gist Aug 27, 2024.
    121 changes: 121 additions & 0 deletions vidrl-test-tdb-human-sera-ingest.smk
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,121 @@

    PREVIEW = config.get("preview", False)
    YEAR = config.get("year", '2024')

    VIDRL_PATH = "../fludata/VIDRL-Melbourne-WHO-CC/raw-data"

    H1N1_PATH = f"{VIDRL_PATH}/A/H1N1pdm/HI"
    H3N2_PATH = f"{VIDRL_PATH}/A/H3N2/HI"
    H3N2_FRA = f"{VIDRL_PATH}/A/H3N2/FRA"
    VIC_PATH = f"{VIDRL_PATH}/B/Victoria/HI"

    H1N1_FSTEMS, = glob_wildcards(f"{H1N1_PATH}/{YEAR}/{{fstem}}.xlsx")
    H3N2_FSTEMS, = glob_wildcards(f"{H3N2_PATH}/{YEAR}/{{fstem}}.xlsx")
    H3N2_FRA_FSTEMS, = glob_wildcards(f"{H3N2_FRA}/{YEAR}/{{fstem}}.xlsx")
    VIC_FSTEMs, = glob_wildcards(f"{VIC_PATH}/{YEAR}/{{fstem}}.xlsx")

    rule ingest_all:
    input:
    h1n1pdm = expand("data/results/h1n1pdm/hi/{year}/{fstem}.done", year=[YEAR], fstem=H1N1_FSTEMS),
    h3n2 = expand("data/results/h3n2/hi/{year}/{fstem}.done", year=[YEAR], fstem=H3N2_FSTEMS),
    h3n2_fra = expand("data/results/h3n2/fra/{year}/{fstem}.done", year=[YEAR], fstem=H3N2_FRA_FSTEMS),
    vix = expand("data/results/vic/hi/{year}/{fstem}.done", year=[YEAR], fstem=VIC_FSTEMs),

    rule ingest_h1n1pdm:
    input:
    excel_worbook = f"{H1N1_PATH}/{{year}}/{{fstem}}.xlsx"
    output:
    touch("data/results/h1n1pdm/hi/{year}/{fstem}.done")
    params:
    h1n1_path = H1N1_PATH,
    preview = "--preview" if PREVIEW else "",
    log:
    "data/logs/h1n1pdm/hi/{year}/{fstem}.log"
    shell:
    r"""
    python3 tdb/vidrl_upload.py \
    -db test_tdb \
    -v flu \
    --subtype h1n1pdm \
    --assay_type hi \
    --path {params.h1n1_path}/{wildcards.year} \
    --fstem {wildcards.fstem} \
    --ftype vidrl \
    --human-ref-only \
    {params.preview} 2>&1 | tee {log}
    """


    rule ingest_h3n2:
    input:
    excel_worbook = f"{H3N2_PATH}/{{year}}/{{fstem}}.xlsx"
    output:
    touch("data/results/h3n2/hi/{year}/{fstem}.done")
    params:
    h3n2_path = H3N2_PATH,
    preview = "--preview" if PREVIEW else "",
    log:
    "data/logs/h3n2/hi/{year}/{fstem}.log"
    shell:
    r"""
    python3 tdb/vidrl_upload.py \
    -db test_tdb \
    -v flu \
    --subtype h3n2 \
    --assay_type hi \
    --path {params.h3n2_path}/{wildcards.year} \
    --fstem {wildcards.fstem} \
    --ftype vidrl \
    --human-ref-only \
    {params.preview} 2>&1 | tee {log}
    """


    rule ingest_h3n2_fra:
    input:
    excel_worbook = f"{H3N2_FRA}/{{year}}/{{fstem}}.xlsx"
    output:
    touch("data/results/h3n2/fra/{year}/{fstem}.done")
    params:
    h3n2_path = H3N2_FRA,
    preview = "--preview" if PREVIEW else "",
    log:
    "data/logs/h3n2/fra/{year}/{fstem}.log"
    shell:
    r"""
    python3 tdb/vidrl_upload.py \
    -db test_tdb \
    -v flu \
    --subtype h3n2 \
    --assay_type fra \
    --path {params.h3n2_path}/{wildcards.year} \
    --fstem {wildcards.fstem} \
    --ftype vidrl \
    --human-ref-only \
    {params.preview} 2>&1 | tee {log}
    """


    rule ingest_vic:
    input:
    excel_worbook = f"{VIC_PATH}/{{year}}/{{fstem}}.xlsx"
    output:
    touch("data/results/vic/hi/{year}/{fstem}.done")
    params:
    vic_path = VIC_PATH,
    preview = "--preview" if PREVIEW else "",
    log:
    "data/logs/vic/hi/{year}/{fstem}.log"
    shell:
    r"""
    python3 tdb/vidrl_upload.py \
    -db test_tdb \
    -v flu \
    --subtype vic \
    --assay_type hi \
    --path {params.vic_path}/{wildcards.year} \
    --fstem {wildcards.fstem} \
    --ftype vidrl \
    --human-ref-only \
    {params.preview} 2>&1 | tee {log}
    """