# Path: pyani/pyani_config.py
# BLASTALL_DEFAULT = Path("blastall")
# 
# BLASTN_DEFAULT = Path("blastn")
# 
# FILTER_DEFAULT = Path("delta-filter")
# 
# FORMATDB_DEFAULT = Path("formatdb")
# 
# MAKEBLASTDB_DEFAULT = Path("makeblastdb")
# 
# NUCMER_DEFAULT = Path("nucmer")
# 
# Path: pyani/scripts/average_nucleotide_identity.py
# def parse_cmdline(argv: Optional[List] = None) -> Namespace:
# def last_exception() -> str:
# def make_outdirs(args: Namespace):
# def compress_delete_outdir(outdir: Path, logger: Logger) -> None:
# def calculate_anim(
#     args: Namespace, infiles: List[Path], org_lengths: Dict
# ) -> pyani_tools.ANIResults:
# def calculate_tetra(infiles: List[Path]) -> pd.DataFrame:
# def make_sequence_fragments(
#     args: Namespace, logger: Logger, infiles: List[Path], blastdir: Path
# ) -> Tuple[List, Dict]:
# def run_blast(
#     args: Namespace, logger: Logger, infiles: List[Path], blastdir: Path
# ) -> Tuple:
# def unified_anib(
#     args: Namespace, infiles: List[Path], org_lengths: Dict[str, int]
# ) -> pyani_tools.ANIResults:
# def write(args: Namespace, results: pd.DataFrame) -> None:
# def draw(args: Namespace, filestems: List[str], gformat: str) -> None:
# def subsample_input(args: Namespace, logger: Logger, infiles: List[Path]) -> List[Path]:
# def process_arguments(args: Optional[Namespace]) -> Namespace:
# def test_class_label_paths(args: Namespace, logger: Logger) -> None:
# def get_method(args: Namespace) -> Tuple:
# def test_scheduler(args: Namespace, logger: Logger) -> None:
# def run_main(argsin: Optional[Namespace] = None) -> int:
# 
# Path: pyani/scripts/genbank_get_genomes_by_taxon.py
# class NCBIDownloadException(Exception):
#     def __init__(self):
# def parse_cmdline(argv=None):
# def last_exception():
# def set_ncbi_email(args: Namespace) -> None:
# def make_outdir(args: Namespace) -> None:
# def entrez_retry(args, func, *fnargs, **fnkwargs):
# def entrez_batch_webhistory(args, record, expected, batchsize, *fnargs, **fnkwargs):
# def get_asm_uids(args, taxon_uid):
# def extract_filestem(data):
# def get_ncbi_asm(args, asm_uid, fmt="fasta"):
# def retrieve_asm_contigs(
#     args,
#     filestem,
#     ftpstem="ftp://ftp.ncbi.nlm.nih.gov/genomes/all",
#     fmt="fasta",
# ):
# def extract_archive(archivepath):
# def write_contigs(args, asm_uid, contig_uids, batchsize=10000):
# def logreport_downloaded(accn, skiplist, accndict, uidaccndict):
# def run_main(args=None):


from argparse import Namespace
from pathlib import Path
from pyani.pyani_config import (
    BLASTALL_DEFAULT,
    BLASTN_DEFAULT,
    FILTER_DEFAULT,
    FORMATDB_DEFAULT,
    MAKEBLASTDB_DEFAULT,
    NUCMER_DEFAULT,
)
from pyani.scripts import average_nucleotide_identity, genbank_get_genomes_by_taxon
from tools import modify_namespace
import pytest
    Uses the base namespace to run ANIm with mpl output
    """
    return modify_namespace(legacy_ani_namespace, method="TETRA", gmethod="mpl")


@pytest.mark.skip_if_exe_missing("nucmer")
def test_legacy_anim_sns(legacy_anim_sns_namespace):
    r"""Use legacy script to run ANIm (seaborn output).

    average_nucleotide_identity.py \
        -l test_ANIm.log \
        -i tests/fixtures/legacy/ANI_input \
        -o tests/test_output/legacy_scripts/ANIm_seaborn \
        -g --gmethod seaborn --gformat pdf,png \
        -f --jobprefix ANI
    """
    average_nucleotide_identity.run_main(legacy_anim_sns_namespace)


@pytest.mark.skip_if_exe_missing("nucmer")
def test_legacy_anim_mpl(legacy_anim_mpl_namespace):
    r"""Use legacy script to run ANIm (mpl output).

    average_nucleotide_identity.py \
        -l test_ANIm.log \
        -i tests/fixtures/legacy/ANI_input \
        -o tests/test_output/legacy_scripts/ANIm_mpl \
        -g --gmethod mpl --gformat pdf,png \
        -f --jobprefix ANI
    """

# Path: pyani/pyani_config.py
# BLASTALL_DEFAULT = Path("blastall")
# 
# BLASTN_DEFAULT = Path("blastn")
# 
# FILTER_DEFAULT = Path("delta-filter")
# 
# FORMATDB_DEFAULT = Path("formatdb")
# 
# MAKEBLASTDB_DEFAULT = Path("makeblastdb")
# 
# NUCMER_DEFAULT = Path("nucmer")
# 
# Path: pyani/scripts/average_nucleotide_identity.py
# def parse_cmdline(argv: Optional[List] = None) -> Namespace:
# def last_exception() -> str:
# def make_outdirs(args: Namespace):
# def compress_delete_outdir(outdir: Path, logger: Logger) -> None:
# def calculate_anim(
#     args: Namespace, infiles: List[Path], org_lengths: Dict
# ) -> pyani_tools.ANIResults:
# def calculate_tetra(infiles: List[Path]) -> pd.DataFrame:
# def make_sequence_fragments(
#     args: Namespace, logger: Logger, infiles: List[Path], blastdir: Path
# ) -> Tuple[List, Dict]:
# def run_blast(
#     args: Namespace, logger: Logger, infiles: List[Path], blastdir: Path
# ) -> Tuple:
# def unified_anib(
#     args: Namespace, infiles: List[Path], org_lengths: Dict[str, int]
# ) -> pyani_tools.ANIResults:
# def write(args: Namespace, results: pd.DataFrame) -> None:
# def draw(args: Namespace, filestems: List[str], gformat: str) -> None:
# def subsample_input(args: Namespace, logger: Logger, infiles: List[Path]) -> List[Path]:
# def process_arguments(args: Optional[Namespace]) -> Namespace:
# def test_class_label_paths(args: Namespace, logger: Logger) -> None:
# def get_method(args: Namespace) -> Tuple:
# def test_scheduler(args: Namespace, logger: Logger) -> None:
# def run_main(argsin: Optional[Namespace] = None) -> int:
# 
# Path: pyani/scripts/genbank_get_genomes_by_taxon.py
# class NCBIDownloadException(Exception):
#     def __init__(self):
# def parse_cmdline(argv=None):
# def last_exception():
# def set_ncbi_email(args: Namespace) -> None:
# def make_outdir(args: Namespace) -> None:
# def entrez_retry(args, func, *fnargs, **fnkwargs):
# def entrez_batch_webhistory(args, record, expected, batchsize, *fnargs, **fnkwargs):
# def get_asm_uids(args, taxon_uid):
# def extract_filestem(data):
# def get_ncbi_asm(args, asm_uid, fmt="fasta"):
# def retrieve_asm_contigs(
#     args,
#     filestem,
#     ftpstem="ftp://ftp.ncbi.nlm.nih.gov/genomes/all",
#     fmt="fasta",
# ):
# def extract_archive(archivepath):
# def write_contigs(args, asm_uid, contig_uids, batchsize=10000):
# def logreport_downloaded(accn, skiplist, accndict, uidaccndict):
# def run_main(args=None):


# Path: tests/test_legacy_scripts.py
from argparse import Namespace
from pathlib import Path
from pyani.pyani_config import (
    BLASTALL_DEFAULT,
    BLASTN_DEFAULT,
    FILTER_DEFAULT,
    FORMATDB_DEFAULT,
    MAKEBLASTDB_DEFAULT,
    NUCMER_DEFAULT,
)
from pyani.scripts import average_nucleotide_identity, genbank_get_genomes_by_taxon
from tools import modify_namespace
import pytest

    Uses the base namespace to run ANIm with mpl output
    """
    return modify_namespace(legacy_ani_namespace, method="TETRA", gmethod="mpl")


@pytest.mark.skip_if_exe_missing("nucmer")
def test_legacy_anim_sns(legacy_anim_sns_namespace):
    r"""Use legacy script to run ANIm (seaborn output).

    average_nucleotide_identity.py \
        -l test_ANIm.log \
        -i tests/fixtures/legacy/ANI_input \
        -o tests/test_output/legacy_scripts/ANIm_seaborn \
        -g --gmethod seaborn --gformat pdf,png \
        -f --jobprefix ANI
    """
    average_nucleotide_identity.run_main(legacy_anim_sns_namespace)


@pytest.mark.skip_if_exe_missing("nucmer")
def test_legacy_anim_mpl(legacy_anim_mpl_namespace):
    r"""Use legacy script to run ANIm (mpl output).

    average_nucleotide_identity.py \
        -l test_ANIm.log \
        -i tests/fixtures/legacy/ANI_input \
        -o tests/test_output/legacy_scripts/ANIm_mpl \
        -g --gmethod mpl --gformat pdf,png \
        -f --jobprefix ANI
    """

    average_nucleotide_identity.run_main(legacy_anim_mpl_namespace)