# Path: crumbs/exceptions.py
# class OptionalRequirementError(Exception):
#     'An optional module is not present'
#     pass


from crumbs.exceptions import OptionalRequirementError
    from Bio.SeqRecord import SeqRecord
    from Bio.Seq import Seq
    from Bio.SeqFeature import SeqFeature, FeatureLocation
    from Bio.Restriction.Restriction import (CommOnly, RestrictionBatch,
                                             Analysis)
    from Bio.SeqIO.SffIO import SffIterator
    from Bio.bgzf import BgzfWriter
    from Bio.SeqIO.QualityIO import FastqGeneralIterator
    from crumbs.utils.biopython_code import FastqGeneralIterator
    from Bio.SeqIO.FastaIO import FastaIterator
    from Bio.SeqIO.QualityIO import QualPhredIterator
    from Bio.SeqIO.QualityIO import PairedFastaQualIterator
    from Bio.SeqIO.QualityIO import FastqPhredIterator
    from Bio.SeqIO.QualityIO import FastqSolexaIterator
    from Bio.SeqIO.QualityIO import FastqIlluminaIterator
    from Bio.SeqIO import parse as parse_into_seqrecs
    from Bio.SeqIO import write as write_seqrecs
    from Bio.Blast import NCBIXML, NCBIWWW
    from Bio._py3k import _bytes_to_string, _as_bytes
    from Bio.SeqIO._index import SeqFileRandomAccess
    from Bio.SeqIO._index import _FormatToRandomAccess
    from Bio.SeqIO import index as seq_index
    from Bio.Alphabet import Alphabet, AlphabetEncoder
    from toolz.itertoolz import merge_sorted, first
    from pysam import Samfile
    from pysam import view, index, faidx, calmd
    from pysam import AlignmentFile
    from configobj import ConfigObj
    from vcf.parser import _Filter, _Info
    from vcf import Reader, Writer
    from vcf.model import make_calldata_tuple, _Call, _Record
    from numpy import linspace, histogram, zeros, median, sum
    from numpy import absolute, exp, array, percentile
    from matplotlib.mlab import griddata
    from matplotlib import cm
    from matplotlib.colorbar import make_axes, Colorbar
    from matplotlib.ticker import ScalarFormatter
    from matplotlib.colors import LogNorm, Normalize
    from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
    from matplotlib.figure import Figure
    from mpl_toolkits.axes_grid1 import make_axes_locatable
    from scipy.optimize import curve_fit
    from scipy.stats.distributions import t
    from scipy.stats import fisher_exact as scipy_fisher
    from rpy2.robjects import IntVector, r
# License, or (at your option) any later version.

# ngs_crumbs is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR  PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with ngs_crumbs. If not, see <http://www.gnu.org/licenses/>.

'''
In this module all the imports of the optional modules are handled
'''


MSG = 'A python package to run this executable is required,'
MSG += ' but it is not installed: '
BIO = 'biopython'
BIO_BGZF = 'biopython with Bgzf support'


def create_fake_class(msg):
    class FakePythonRequiredClass(object):
        def __init__(self, *args, **kwargs):
            raise OptionalRequirementError(msg)
    return FakePythonRequiredClass


def create_fake_funct(msg):
    def FakeRequiredfunct(*args, **kwargs):

# Path: crumbs/exceptions.py
# class OptionalRequirementError(Exception):
#     'An optional module is not present'
#     pass


# Path: crumbs/utils/optional_modules.py
from crumbs.exceptions import OptionalRequirementError
    from Bio.SeqRecord import SeqRecord
    from Bio.Seq import Seq
    from Bio.SeqFeature import SeqFeature, FeatureLocation
    from Bio.Restriction.Restriction import (CommOnly, RestrictionBatch,
                                             Analysis)
    from Bio.SeqIO.SffIO import SffIterator
    from Bio.bgzf import BgzfWriter
    from Bio.SeqIO.QualityIO import FastqGeneralIterator
    from crumbs.utils.biopython_code import FastqGeneralIterator
    from Bio.SeqIO.FastaIO import FastaIterator
    from Bio.SeqIO.QualityIO import QualPhredIterator
    from Bio.SeqIO.QualityIO import PairedFastaQualIterator
    from Bio.SeqIO.QualityIO import FastqPhredIterator
    from Bio.SeqIO.QualityIO import FastqSolexaIterator
    from Bio.SeqIO.QualityIO import FastqIlluminaIterator
    from Bio.SeqIO import parse as parse_into_seqrecs
    from Bio.SeqIO import write as write_seqrecs
    from Bio.Blast import NCBIXML, NCBIWWW
    from Bio._py3k import _bytes_to_string, _as_bytes
    from Bio.SeqIO._index import SeqFileRandomAccess
    from Bio.SeqIO._index import _FormatToRandomAccess
    from Bio.SeqIO import index as seq_index
    from Bio.Alphabet import Alphabet, AlphabetEncoder
    from toolz.itertoolz import merge_sorted, first
    from pysam import Samfile
    from pysam import view, index, faidx, calmd
    from pysam import AlignmentFile
    from configobj import ConfigObj
    from vcf.parser import _Filter, _Info
    from vcf import Reader, Writer
    from vcf.model import make_calldata_tuple, _Call, _Record
    from numpy import linspace, histogram, zeros, median, sum
    from numpy import absolute, exp, array, percentile
    from matplotlib.mlab import griddata
    from matplotlib import cm
    from matplotlib.colorbar import make_axes, Colorbar
    from matplotlib.ticker import ScalarFormatter
    from matplotlib.colors import LogNorm, Normalize
    from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
    from matplotlib.figure import Figure
    from mpl_toolkits.axes_grid1 import make_axes_locatable
    from scipy.optimize import curve_fit
    from scipy.stats.distributions import t
    from scipy.stats import fisher_exact as scipy_fisher
    from rpy2.robjects import IntVector, r

# License, or (at your option) any later version.

# ngs_crumbs is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR  PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with ngs_crumbs. If not, see <http://www.gnu.org/licenses/>.

'''
In this module all the imports of the optional modules are handled
'''


MSG = 'A python package to run this executable is required,'
MSG += ' but it is not installed: '
BIO = 'biopython'
BIO_BGZF = 'biopython with Bgzf support'


def create_fake_class(msg):
    class FakePythonRequiredClass(object):
        def __init__(self, *args, **kwargs):
            raise OptionalRequirementError(msg)
    return FakePythonRequiredClass


def create_fake_funct(msg):
    def FakeRequiredfunct(*args, **kwargs):

        raise OptionalRequirementError(msg)