Skip to content

Commit

Permalink
Switch for Lineage field queried on CovSpectrum
Browse files Browse the repository at this point in the history
- nextcladePangoLineage vs pangoLineage
  • Loading branch information
DrYak committed Feb 22, 2024
1 parent 1b5db88 commit c44b170
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
12 changes: 11 additions & 1 deletion cojac/cooc_curate.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,14 @@ def curate_muts(
type=str,
help="url to use when querying covspectrum (e.g. https://lapis.cov-spectrum.org/open/v2, https://lapis.cov-spectrum.org/gisaid/v2, etc.)",
)
@click.option(
"--lintype",
metavar="FIELD",
required=False,
default=None,
type=str,
help="switch the lineage field queried on covspectrum (e.g. nextcladePangoLineage: as determined with nextclade, pangoLineage: as provided by upstream sequence repository)",
)
@click.option(
"-a",
"--amplicons",
Expand Down Expand Up @@ -347,9 +355,11 @@ def curate_muts(
help="use coloured output",
)
@click.argument("voc", nargs=-1)
def cooc_curate(url, amp, domuts, high, low, collapse, colour, voc):
def cooc_curate(url, lintype, amp, domuts, high, low, collapse, colour, voc):
if url:
setURL(url)
if lintype:
setLinType(lintype)
amplicons = None
if amp:
with open(amp, "r") as yf:
Expand Down
16 changes: 14 additions & 2 deletions cojac/sig_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import yaml
import csv

from .cooc_curate import listfilteredmutations, setURL
from .cooc_curate import listfilteredmutations, setURL, setLinType


# regex
Expand All @@ -29,6 +29,14 @@
type=str,
help="url to use when querying covspectrum (e.g. https://lapis.cov-spectrum.org/open/v1, https://lapis.cov-spectrum.org/gisaid/v1, etc.)",
)
@click.option(
"--lintype",
metavar="FIELD",
required=False,
default=None,
type=str,
help="switch the lineage field queried on covspectrum (e.g. nextcladePangoLineage: as determined with nextclade, pangoLineage: as provided by upstream sequence repository)",
)
@click.option(
"--var",
"--variant",
Expand Down Expand Up @@ -88,9 +96,13 @@
"debug",
default=False,
)
def sig_generate(url, var, minfreq, mindelfreq, minseqs, extras, covariants, debug):
def sig_generate(
url, lintype, var, minfreq, mindelfreq, minseqs, extras, covariants, debug
):
if url:
setURL(url)
if lintype:
setLinType(lintype)

if debug:
import sys
Expand Down

0 comments on commit c44b170

Please sign in to comment.