# Path: crumbs/utils/optional_modules.py
# MSG = 'A python package to run this executable is required,'
# BIO = 'biopython'
# BIO_BGZF = 'biopython with Bgzf support'
#     NCBIXML = create_fake_class(MSG + BIO)
#     NCBIWWW = create_fake_class(MSG + BIO)
# def create_fake_class(msg):
#         def __init__(self, *args, **kwargs):
# def create_fake_funct(msg):
#     def FakeRequiredfunct(*args, **kwargs):
#     class FakePythonRequiredClass(object):


import subprocess
import os
from tempfile import NamedTemporaryFile
from crumbs.utils.optional_modules import Seq, write_seqrecs
    for line in fhand:
        if line.startswith('# Score:'):
            return float(line.split(':')[1].strip())
    return None


def get_water_alignment(seq1, seq2, gap_open=10.0, gap_extend=0.5,
                        out_fmt='markx10'):
    out_fhand = NamedTemporaryFile()
    _do_water_alignment(seq1, seq2,  out_fhand, gap_open=10.0, gap_extend=0.5,
                        out_fmt='markx10', reverse2=False)
    out_fhand2 = NamedTemporaryFile()
    _do_water_alignment(seq1, seq2,  out_fhand2, gap_open=10.0, gap_extend=0.5,
                        out_fmt='markx10', reverse2=True)
    forw_score = _get_water_score(out_fhand)
    rev_score = _get_water_score(out_fhand2)
    if forw_score > rev_score:
        out_fhand.seek(0)
        return out_fhand, False
    else:
        out_fhand2.seek(0)
        return out_fhand2, True


def _do_water_alignment(seq1, seq2,  out_fhand, gap_open=10.0, gap_extend=0.5,
                        out_fmt='markx10', reverse2=False):
    seq1_fhand = NamedTemporaryFile()
    seq2_fhand = NamedTemporaryFile()

    write_seqrecs(seq1, seq1_fhand, 'fasta')

# Path: crumbs/utils/optional_modules.py
# MSG = 'A python package to run this executable is required,'
# BIO = 'biopython'
# BIO_BGZF = 'biopython with Bgzf support'
#     NCBIXML = create_fake_class(MSG + BIO)
#     NCBIWWW = create_fake_class(MSG + BIO)
# def create_fake_class(msg):
#         def __init__(self, *args, **kwargs):
# def create_fake_funct(msg):
#     def FakeRequiredfunct(*args, **kwargs):
#     class FakePythonRequiredClass(object):


# Path: crumbs/vcf/prot_change.py
import subprocess
import os
from tempfile import NamedTemporaryFile
from crumbs.utils.optional_modules import Seq, write_seqrecs

    for line in fhand:
        if line.startswith('# Score:'):
            return float(line.split(':')[1].strip())
    return None


def get_water_alignment(seq1, seq2, gap_open=10.0, gap_extend=0.5,
                        out_fmt='markx10'):
    out_fhand = NamedTemporaryFile()
    _do_water_alignment(seq1, seq2,  out_fhand, gap_open=10.0, gap_extend=0.5,
                        out_fmt='markx10', reverse2=False)
    out_fhand2 = NamedTemporaryFile()
    _do_water_alignment(seq1, seq2,  out_fhand2, gap_open=10.0, gap_extend=0.5,
                        out_fmt='markx10', reverse2=True)
    forw_score = _get_water_score(out_fhand)
    rev_score = _get_water_score(out_fhand2)
    if forw_score > rev_score:
        out_fhand.seek(0)
        return out_fhand, False
    else:
        out_fhand2.seek(0)
        return out_fhand2, True


def _do_water_alignment(seq1, seq2,  out_fhand, gap_open=10.0, gap_extend=0.5,
                        out_fmt='markx10', reverse2=False):
    seq1_fhand = NamedTemporaryFile()
    seq2_fhand = NamedTemporaryFile()

    write_seqrecs(seq1, seq1_fhand, 'fasta')

    write_seqrecs(seq2, seq2_fhand, 'fasta')