Skip to content

Commit

Permalink
Rename package to cladetime
Browse files Browse the repository at this point in the history
  • Loading branch information
bsweger committed Oct 8, 2024
1 parent 7bfd8b9 commit f47224e
Show file tree
Hide file tree
Showing 26 changed files with 97 additions and 91 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/run-code-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ jobs:

- name: Build Docker image 🐳
run: |
docker build -t virus-clade-utils .
docker build -t cladetime .
- name: lint 🧹
run: |
docker run --entrypoint /bin/bash virus-clade-utils \
docker run --entrypoint /bin/bash cladetime \
-c "ruff check"
- name: run unit tests 🧪
run: |
docker run --entrypoint /bin/bash virus-clade-utils \
docker run --entrypoint /bin/bash cladetime \
-c "pytest -k unit"
4 changes: 2 additions & 2 deletions .github/workflows/run-integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:

- name: Build Docker image 🐳
run: |
docker build -t virus-clade-utils .
docker build -t cladetime .
- name: run integration tests 🧪
run: |
docker run --entrypoint /bin/bash virus-clade-utils \
docker run --entrypoint /bin/bash cladetime \
-c "pytest -k integration"
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
exclude: >
(?x)(
^src/virus_clade_utils/bin/|
^src/virus_clade_utils/data/
^src/cladetime/bin/|
^src/cladetime/data/
)
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
FROM nextstrain/nextclade:3.8.2

FROM python:3.12-slim-bookworm
COPY --from=0 /usr/bin/nextclade /opt/src/virus_clade_utils/bin/
COPY --from=0 /usr/bin/nextclade /opt/src/cladetime/bin/

# create a user to run the app
ARG USERNAME=docker-user
Expand All @@ -23,10 +23,10 @@ RUN chown -R docker-user:docker-user /opt/
ENV PYTHONPATH "${PYTHONPATH}:/opt/"

# Install the dataformat CLI tool
WORKDIR /opt/src/virus_clade_utils/bin/
WORKDIR /opt/src/cladetime/bin/
ADD https://ftp.ncbi.nlm.nih.gov/pub/datasets/command-line/v2/linux-amd64/dataformat ./dataformat
RUN chmod +x ./dataformat
ENV PATH "${PATH}:/opt/src/virus_clade_utils/bin/"
ENV PATH "${PATH}:/opt/src/cladetime/bin/"

# Install Python dependencies
WORKDIR /opt/
Expand All @@ -47,7 +47,7 @@ RUN uv pip install --system polars-lts-cpu --no-cache-dir

USER $USERNAME

COPY src/virus_clade_utils/ ./src/virus_clade_utils/
COPY src/cladetime/ ./src/cladetime/
COPY tests/ ./tests/

ENTRYPOINT ["assign_clades"]
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Virus Clade Utils
# Cladetime

Virus Clade Utils is a wrapper around existing tools for downloading and working with virus genome sequences:
Cladetime is a wrapper around existing tools for downloading and working with virus genome sequences:

* The [NCBI Datasets API](https://www.ncbi.nlm.nih.gov/datasets/docs/v2/reference-docs/rest-api/) provided by the National Institutes of Healh.
* The [Nexclade command line interface (CLI)](https://docs.nextstrain.org/projects/nextclade/en/stable/user/nextclade-cli/index.html) provided by [Nextstrain](https://docs.nextstrain.org/en/latest/).

This package was developed to provide data required for the [COVID-19 Variant Nowcast hub](https://github.com/reichlab/variant-nowcast-hub), where modelers and teams forecast the daily proportions of COVID-19 variants in US states.

We are releasing `virus-clade-utils` as a standalone package for use by others who may find the functionality useful.
We are releasing `cladetime` as a standalone package for use by others who may find the functionality useful.


## Usage
Expand All @@ -24,7 +24,7 @@ This library contains two types of components:
To use the interactive `CladeTime` object, install this package:

```bash
pip install git+https://github.com/reichlab/virus-clade-utils.git
pip install git+https://github.com/reichlab/cladetime.git
```

Once the package is installed, you can instantiate a `CladeTime` object in a Python console
Expand All @@ -33,7 +33,7 @@ Once the package is installed, you can instantiate a `CladeTime` object in a Pyt
#### Work with the latest Nextstrain Sars-Cov-2 sequence metadata and clade assignments

```python
In [1]: from virus_clade_utils.cladetime import CladeTime
In [1]: from cladetime.cladetime import CladeTime

In [2]: ct = CladeTime()

Expand Down Expand Up @@ -86,7 +86,7 @@ Out[9]:
#### Work with point-in-time Nextstrain Sars-Cov-2 sequence metadata and clade assignments

```python
In [10]: from virus_clade_utils.cladetime import CladeTime
In [10]: from cladetime import CladeTime

In [11]: ct = CladeTime(sequence_as_of="2024-08-31", tree_as_of="2024-08-01")

Expand Down Expand Up @@ -118,20 +118,20 @@ Use the directions below to run the pipeline in a Docker container.
1. Clone this repository and change into the high-level directory:

```bash
cd virus-clade-utils
cd cladetime
```
2. Build the Docker image:

```bash
docker build --platform=linux/amd64 -t virus-clade-utils .
docker build --platform=linux/amd64 -t cladetime .
```

3. To run the target data pipeline, passing in required arguments:

```bash
docker run --platform linux/amd64 \
-v $(pwd)/data:/home/docker-user/ \
virus-clade-utils \
cladetime \
--sequence-released-since-date 2024-07-16 \
--reference-tree-date 2024-07-16 \
--data-dir /home/docker-user
Expand All @@ -147,7 +147,7 @@ The clade assignments will now be in the local directory that was mounted to the
1. Enter the container's bash shell:
```bash
docker run --platform linux/amd64 -it --entrypoint bash virus-clade-utils
docker run --platform linux/amd64 -it --entrypoint bash cladetime
```
2. Once you're in the shell of the container:
Expand All @@ -165,7 +165,7 @@ To run the test suite in the Docker container (built above):
1. Enter the container's bash shell:

```bash
docker run --platform linux/amd64 -it --entrypoint bash virus-clade-utils
docker run --platform linux/amd64 -it --entrypoint bash cladetime
```

2. Once you're in the shell of the container, run the tests:
Expand Down Expand Up @@ -199,7 +199,7 @@ Follow the directions below to set this project up on your local machine.
1. Clone this repository and change into the project's high-level directory:
```bash
cd virus-clade-utils
cd cladetime
```
2. Create a Python virtual environment:
Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "virus-clade-utils"
version = "0.1.0"
name = "cladetime"
version = "0.2.0"
description = "Assign clades to viral genome sequences at a point in time."
authors = [
{name = "Evan Ray", email="[email protected]"},
Expand Down Expand Up @@ -43,11 +43,11 @@ dev = [
]

[project.urls]
Repository = "https://github.com/reichlab/virus-clade-utils.git"
Repository = "https://github.com/reichlab/cladetime.git"

[project.entry-points."console_scripts"]
assign_clades = "virus_clade_utils.assign_clades:main"
clade_list = "virus_clade_utils.get_clade_list:main"
assign_clades = "cladetime.assign_clades:main"
clade_list = "cladetime.get_clade_list:main"

[build-system]
requires = ["setuptools>=64", "wheel"]
Expand All @@ -68,7 +68,7 @@ line-length = 120
lint.extend-select = ["I"]

[tools.setuptools]
packages = ["virus_clade_utils"]
packages = ["cladetime"]

[tool.mypy]
ignore_missing_imports = true
Expand Down
48 changes: 25 additions & 23 deletions requirements/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# This file was autogenerated by uv via the following command:
# uv pip compile pyproject.toml --extra dev -o requirements/requirements-dev.txt
awscli==1.32.116
# via virus-clade-utils (pyproject.toml)
# via cladetime (pyproject.toml)
boto3==1.34.116
# via
# virus-clade-utils (pyproject.toml)
# cladetime (pyproject.toml)
# moto
boto3-stubs==1.35.28
# via virus-clade-utils (pyproject.toml)
# via cladetime (pyproject.toml)
botocore==1.34.116
# via
# awscli
Expand All @@ -24,20 +24,20 @@ charset-normalizer==3.3.2
# via requests
click==8.1.7
# via
# virus-clade-utils (pyproject.toml)
# cladetime (pyproject.toml)
# rich-click
cloudpathlib==0.18.1
# via virus-clade-utils (pyproject.toml)
# via cladetime (pyproject.toml)
colorama==0.4.6
# via awscli
coverage==7.5.3
# via virus-clade-utils (pyproject.toml)
# via cladetime (pyproject.toml)
cryptography==43.0.1
# via moto
docutils==0.16
# via awscli
freezegun==1.5.1
# via virus-clade-utils (pyproject.toml)
# via cladetime (pyproject.toml)
idna==3.7
# via requests
iniconfig==2.0.0
Expand All @@ -59,9 +59,9 @@ markupsafe==2.1.5
mdurl==0.1.2
# via markdown-it-py
moto==5.0.15
# via virus-clade-utils (pyproject.toml)
# via cladetime (pyproject.toml)
mypy==1.10.1
# via virus-clade-utils (pyproject.toml)
# via cladetime (pyproject.toml)
mypy-boto3-s3==1.35.22
# via boto3-stubs
mypy-extensions==1.0.0
Expand All @@ -73,13 +73,13 @@ numpy==1.26.4
packaging==24.0
# via pytest
pandas==2.2.2
# via virus-clade-utils (pyproject.toml)
# via cladetime (pyproject.toml)
pluggy==1.5.0
# via pytest
polars==1.6.0
# via virus-clade-utils (pyproject.toml)
# via cladetime (pyproject.toml)
pyarrow==16.1.0
# via virus-clade-utils (pyproject.toml)
# via cladetime (pyproject.toml)
pyasn1==0.6.0
# via rsa
pycparser==2.22
Expand All @@ -88,10 +88,10 @@ pygments==2.18.0
# via rich
pytest==8.2.1
# via
# virus-clade-utils (pyproject.toml)
# cladetime (pyproject.toml)
# pytest-mock
pytest-mock==3.14.0
# via virus-clade-utils (pyproject.toml)
# via cladetime (pyproject.toml)
python-dateutil==2.9.0.post0
# via
# botocore
Expand All @@ -106,52 +106,54 @@ pyyaml==6.0.1
# responses
requests==2.32.3
# via
# virus-clade-utils (pyproject.toml)
# cladetime (pyproject.toml)
# moto
# responses
responses==0.25.3
# via moto
rich==13.7.1
# via
# virus-clade-utils (pyproject.toml)
# cladetime (pyproject.toml)
# rich-click
rich-click==1.8.2
# via virus-clade-utils (pyproject.toml)
# via cladetime (pyproject.toml)
rsa==4.7.2
# via awscli
ruff==0.5.0
# via virus-clade-utils (pyproject.toml)
# via cladetime (pyproject.toml)
s3transfer==0.10.1
# via
# awscli
# boto3
six==1.16.0
# via python-dateutil
structlog==24.2.0
# via virus-clade-utils (pyproject.toml)
# via cladetime (pyproject.toml)
types-awscrt==0.21.5
# via botocore-stubs
types-python-dateutil==2.9.0.20240906
# via virus-clade-utils (pyproject.toml)
# via cladetime (pyproject.toml)
types-requests==2.32.0.20240914
# via virus-clade-utils (pyproject.toml)
# via cladetime (pyproject.toml)
types-s3transfer==0.10.2
# via boto3-stubs
typing-extensions==4.12.0
# via
# boto3-stubs
# mypy
# mypy-boto3-s3
# rich-click
tzdata==2024.1
# via pandas
urllib3==2.2.1
# via
# virus-clade-utils (pyproject.toml)
# cladetime (pyproject.toml)
# botocore
# requests
# responses
# types-requests
us==3.2.0
# via virus-clade-utils (pyproject.toml)
# via cladetime (pyproject.toml)
werkzeug==3.0.4
# via moto
xmltodict==0.13.0
Expand Down
Loading

0 comments on commit f47224e

Please sign in to comment.