# Path: diagnostic_primers/blast.py
# def build_commands(collection, blastexe, blastdb, outdir=None, existingfiles=[]):
# def build_blastscreen_cmd(queryfile, blastexe, blastdb, outdir=None):
# def apply_screen(blastfile, primerjson, jsondir=None, maxaln=15):
# def parse_blasttab(fhandle):
# 
# Path: diagnostic_primers/nucmer.py
# class PDPNucmerException(PDPException):
# class NucmerCommand(object):
# class DeltaFilterCommand(object):
# class DeltaData(object):
# class DeltaMetadata(object):
# class DeltaComparison(object):
# class DeltaHeader(object):
# class DeltaAlignment(object):
# class DeltaIterator(object):
#     def __init__(self, msg="Error in `nucmer` processing"):
#     def __init__(self, cline, infile, outfile):
#     def __str__(self):
#     def __init__(self, cline, infile, outfile):
#     def __str__(self):
#     def __init__(self, name, handle=None):
#     def from_delta(self, handle):
#     def comparisons(self):
#     def metadata(self):
#     def reference(self):
#     def program(self):
#     def query(self):
#     def __eq__(self, other):
#     def __len__(self):
#     def __str__(self):
#     def __init__(self):
#     def __eq__(self, other):
#     def __str__(self):
#     def __init__(self, header, alignments):
#     def add_alignment(self, aln):
#     def __eq__(self, other):
#     def __len__(self):
#     def __str__(self):
#     def __init__(self, reference, query, reflen, querylen):
#     def __eq__(self, other):
#     def __str__(self):
#     def __init__(self, refstart, refend, qrystart, qryend, errs, simerrs, stops):
#     def __lt__(self, other):
#     def __eq__(self, other):
#     def __str__(self):
#     def __init__(self, handle):
#     def __iter__(self):
#     def __next__(self):
# def generate_nucmer_jobs(
#     groupdata, outdir, nucmer_exe, filter_exe, maxmatch=False, jobprefix="PDPNUCmer"
# ):
# def generate_nucmer_commands(groupdata, outdir, nucmer_exe, filter_exe, maxmatch=False):
# def construct_nucmer_cmdline(
#     query, subject, outdir, nucmer_exe, filter_exe, maxmatch=False
# ):
# def parse_delta_query_regions(fname, min_sim_errors=0, min_err_rate=0):


import copy
import json
import os
import re
import shlex
import shutil
import subprocess
import unittest
from diagnostic_primers import blast, nucmer
        """Assert that two passed ePrimer3 output files are equal.

        :param fname1:  path to reference ePrimer3 file
        :param fname2:  path to comparator ePrimer3 file

        This is a standard file comparison, skipping the first line.
        """
        with open(fname1, "r") as fh1:
            with open(fname2, "r") as fh2:
                fdata1 = fh1.readlines()[1:]
                fdata2 = fh2.readlines()[1:]
                self.assertEqual(
                    fdata1,
                    fdata2,
                    msg="ePrimer3 files {} and {} are not equivalent".format(
                        fname1, fname2
                    ),
                )

    def assertNucmerEqual(self, fname1, fname2):
        """Assert that two passed nucmer output files are equal.

        :param fname1:  path to reference .delta/.filter file
        :param fname2:  path to comparator .delta/.filter file

        This is a standard file comparison, skipping the first line.
        """
        with open(fname1, "r") as fh1:
            with open(fname2, "r") as fh2:
                fdata1 = nucmer.DeltaData("fh1", fh1)

# Path: diagnostic_primers/blast.py
# def build_commands(collection, blastexe, blastdb, outdir=None, existingfiles=[]):
# def build_blastscreen_cmd(queryfile, blastexe, blastdb, outdir=None):
# def apply_screen(blastfile, primerjson, jsondir=None, maxaln=15):
# def parse_blasttab(fhandle):
# 
# Path: diagnostic_primers/nucmer.py
# class PDPNucmerException(PDPException):
# class NucmerCommand(object):
# class DeltaFilterCommand(object):
# class DeltaData(object):
# class DeltaMetadata(object):
# class DeltaComparison(object):
# class DeltaHeader(object):
# class DeltaAlignment(object):
# class DeltaIterator(object):
#     def __init__(self, msg="Error in `nucmer` processing"):
#     def __init__(self, cline, infile, outfile):
#     def __str__(self):
#     def __init__(self, cline, infile, outfile):
#     def __str__(self):
#     def __init__(self, name, handle=None):
#     def from_delta(self, handle):
#     def comparisons(self):
#     def metadata(self):
#     def reference(self):
#     def program(self):
#     def query(self):
#     def __eq__(self, other):
#     def __len__(self):
#     def __str__(self):
#     def __init__(self):
#     def __eq__(self, other):
#     def __str__(self):
#     def __init__(self, header, alignments):
#     def add_alignment(self, aln):
#     def __eq__(self, other):
#     def __len__(self):
#     def __str__(self):
#     def __init__(self, reference, query, reflen, querylen):
#     def __eq__(self, other):
#     def __str__(self):
#     def __init__(self, refstart, refend, qrystart, qryend, errs, simerrs, stops):
#     def __lt__(self, other):
#     def __eq__(self, other):
#     def __str__(self):
#     def __init__(self, handle):
#     def __iter__(self):
#     def __next__(self):
# def generate_nucmer_jobs(
#     groupdata, outdir, nucmer_exe, filter_exe, maxmatch=False, jobprefix="PDPNUCmer"
# ):
# def generate_nucmer_commands(groupdata, outdir, nucmer_exe, filter_exe, maxmatch=False):
# def construct_nucmer_cmdline(
#     query, subject, outdir, nucmer_exe, filter_exe, maxmatch=False
# ):
# def parse_delta_query_regions(fname, min_sim_errors=0, min_err_rate=0):


# Path: tests/tools.py
import copy
import json
import os
import re
import shlex
import shutil
import subprocess
import unittest
from diagnostic_primers import blast, nucmer

        """Assert that two passed ePrimer3 output files are equal.

        :param fname1:  path to reference ePrimer3 file
        :param fname2:  path to comparator ePrimer3 file

        This is a standard file comparison, skipping the first line.
        """
        with open(fname1, "r") as fh1:
            with open(fname2, "r") as fh2:
                fdata1 = fh1.readlines()[1:]
                fdata2 = fh2.readlines()[1:]
                self.assertEqual(
                    fdata1,
                    fdata2,
                    msg="ePrimer3 files {} and {} are not equivalent".format(
                        fname1, fname2
                    ),
                )

    def assertNucmerEqual(self, fname1, fname2):
        """Assert that two passed nucmer output files are equal.

        :param fname1:  path to reference .delta/.filter file
        :param fname2:  path to comparator .delta/.filter file

        This is a standard file comparison, skipping the first line.
        """
        with open(fname1, "r") as fh1:
            with open(fname2, "r") as fh2:
                fdata1 = nucmer.DeltaData("fh1", fh1)

                fdata2 = nucmer.DeltaData("fh2", fh2)