diff --git a/seqcol/__init__.py b/seqcol/__init__.py index c67de6c..e894ea0 100644 --- a/seqcol/__init__.py +++ b/seqcol/__init__.py @@ -6,4 +6,4 @@ __classes__ = ["SeqColClient"] -__all__ = (__classes__ + ["build_sorted_name_length_pairs", "compare", "validate_seqcol"],) +__all__ = (__classes__ + ["build_sorted_name_length_pairs", "compare", "validate_seqcol", "fasta_to_digest"],) diff --git a/seqcol/seqcol.py b/seqcol/seqcol.py index 4c0ed28..54f9240 100644 --- a/seqcol/seqcol.py +++ b/seqcol/seqcol.py @@ -19,6 +19,11 @@ def explain_flag(flag): if flag & 2**e: print(FLAGS[2**e]) +def fasta_to_digest(fa_file_path: str) -> str: + """Given a fasta, return a digest""" + seqcol_obj = fasta_to_seqcol(fa_file_path) + return seqcol_digest(seqcol_obj) + def parse_fasta(fa_file) -> pyfaidx.Fasta: """ diff --git a/seqcol/seqcol_client.py b/seqcol/seqcol_client.py index adeaf1f..2d047b2 100644 --- a/seqcol/seqcol_client.py +++ b/seqcol/seqcol_client.py @@ -119,7 +119,7 @@ def compare_digests(self, digestA, digestB): B = self.retrieve(digestB, reclimit=1) # _LOGGER.info(A) # _LOGGER.info(B) - return compare(A, B) + return compare_seqcols(A, B) def retrieve(self, druid, reclimit=None, raw=False): try: