Skip to content

Commit

Permalink
feat: remove fetch (moved to vrs anvil toolkit)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Nov 22, 2024
1 parent 9ae32e3 commit 12e3535
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 204 deletions.
73 changes: 0 additions & 73 deletions src/vrsix/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
import click

from vrsix import load as load_vcf
from vrsix.fetch import fetch_by_pos_range as vcf_fetch_by_pos_range
from vrsix.fetch import fetch_by_vrs_ids
from vrsix.output import generate_csv

_logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -56,73 +53,3 @@ def load(vcfs: tuple[Path], db_location: Path | None) -> None:
load_vcf.load_vcf(vcf, db_location)
end = timer()
_logger.info("Processed `%s` in %s seconds", vcf, end - start)


@cli.command()
@click.argument(
"vrs-ids",
nargs=-1,
)
@click.option(
"--db-location",
type=click.Path(
file_okay=True, dir_okay=True, readable=True, writable=True, path_type=Path
),
)
@click.option(
"-o",
"--output",
type=click.Path(readable=True, writable=True, path_type=Path),
)
def fetch_by_id(
vrs_ids: list[str], db_location: Path | None, output: Path | None
) -> None:
"""Fetch VCF positions by VRS ID"""
if not vrs_ids:
return
rows = fetch_by_vrs_ids(vrs_ids, db_location)
if output:
generate_csv(rows, output)
else:
for row in rows:
click.echo(",".join(row))


@cli.command()
@click.argument("chrom", required=True)
@click.argument(
"start",
type=click.INT,
required=True,
)
@click.argument(
"end",
type=click.INT,
required=True,
)
@click.option(
"--db-location",
type=click.Path(
file_okay=True, dir_okay=True, readable=True, writable=True, path_type=Path
),
)
@click.option(
"-o",
"--output",
type=click.Path(readable=True, writable=True, path_type=Path),
)
def fetch_by_range(
chrom: str, start: int, end: int, db_location: Path | None, output: Path | None
) -> None:
"""Fetch VCF rows by position range.
:param chrom: chromosome
:param start: starting position
:param end: ending position
"""
rows = vcf_fetch_by_pos_range(chrom, start, end, db_location)
if output:
generate_csv(rows, output)
else:
for row in rows:
click.echo(",".join(row))
57 changes: 0 additions & 57 deletions src/vrsix/fetch.py

This file was deleted.

22 changes: 0 additions & 22 deletions src/vrsix/output.py

This file was deleted.

52 changes: 0 additions & 52 deletions tests/test_fetch.py

This file was deleted.

0 comments on commit 12e3535

Please sign in to comment.