Skip to content

Commit

Permalink
Move sequence file and rename filter function
Browse files Browse the repository at this point in the history
Documenting the filter_covid_genome_metadata function made it
clear that its name should better align with the CladeTime
vernacular ('sequence metadata'). Additionally, it makes more
sense to move sequence.py out of the utility folder, since
sequence-related functions are integral to the package.

util/sequence.py remains in the code base for now, so we can
import the filtering function with its old name for backward
compatibility.
  • Loading branch information
bsweger committed Oct 28, 2024
1 parent af906a1 commit c7cc98a
Show file tree
Hide file tree
Showing 10 changed files with 358 additions and 352 deletions.
6 changes: 0 additions & 6 deletions docs/reference/filter_covid_genome_metadata.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ API Reference
.. toctree::

cladetime
filter_covid_genome_metadata
sequence
types

6 changes: 6 additions & 0 deletions docs/reference/sequence.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
=========
sequence
=========

.. autofunction:: cladetime.sequence.filter_sequence_metadata

2 changes: 1 addition & 1 deletion docs/reference/types.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
=====
Types
types
=====


Expand Down
6 changes: 3 additions & 3 deletions src/cladetime/assign_clades.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
import rich_click as click
import structlog

from cladetime.util.config import Config
from cladetime.util.reference import get_nextclade_dataset
from cladetime.util.sequence import (
from cladetime.sequence import (
_unzip_sequence_package,
get_covid_genome_data,
parse_sequence_assignments,
)
from cladetime.util.config import Config
from cladetime.util.reference import get_nextclade_dataset

logger = structlog.get_logger()

Expand Down
2 changes: 1 addition & 1 deletion src/cladetime/cladetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import structlog

from cladetime.exceptions import CladeTimeFutureDateWarning, CladeTimeInvalidDateError, CladeTimeInvalidURLError
from cladetime.sequence import _get_ncov_metadata, get_covid_genome_metadata
from cladetime.util.config import Config
from cladetime.util.reference import _get_s3_object_url
from cladetime.util.sequence import _get_ncov_metadata, get_covid_genome_metadata

logger = structlog.get_logger()

Expand Down
8 changes: 4 additions & 4 deletions src/cladetime/get_clade_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
import structlog
from cloudpathlib import AnyPath

from cladetime.util.config import Config
from cladetime.util.sequence import (
from cladetime.sequence import (
download_covid_genome_metadata,
filter_covid_genome_metadata,
filter_sequence_metadata,
get_clade_counts,
get_covid_genome_metadata,
)
from cladetime.util.config import Config
from cladetime.util.session import _get_session
from cladetime.util.timing import time_function

Expand Down Expand Up @@ -107,7 +107,7 @@ def main(
data_dir,
)
lf_metadata = get_covid_genome_metadata(genome_metadata_path)
lf_metadata_filtered = filter_covid_genome_metadata(lf_metadata)
lf_metadata_filtered = filter_sequence_metadata(lf_metadata)
counts = get_clade_counts(lf_metadata_filtered)
clade_list = get_clades(counts, threshold, threshold_weeks, max_clades)

Expand Down
Loading

0 comments on commit c7cc98a

Please sign in to comment.