# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.




"""
Jellyfish binding
"""


from sys import version_info
if version_info >= (2,6,0):
    def swig_import_helper():
        from os.path import dirname
        import imp
        fp = None
        try:
            fp, pathname, description = imp.find_module('_jellyfish', [dirname(__file__)])
        except ImportError:
            import _jellyfish
            return _jellyfish
        if fp is not None:
            try:
                _mod = imp.load_module('_jellyfish', fp, pathname, description)
            finally:
                fp.close()
            return _mod
    _jellyfish = swig_import_helper()
    del swig_import_helper
else:
    import _jellyfish
del version_info
try:
    _swig_property = property
except NameError:
    pass # Python < 2.2 doesn't have 'property'.
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
    if (name == "thisown"): return self.this.own(value)
    if (name == "this"):
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name,None)
    if method: return method(self,value)
    if (not static):
        self.__dict__[name] = value
    else:
        raise AttributeError("You cannot add attributes to %s" % self)

def _swig_setattr(self,class_type,name,value):
    return _swig_setattr_nondynamic(self,class_type,name,value,0)

def _swig_getattr(self,class_type,name):
    if (name == "thisown"): return self.this.own()
    method = class_type.__swig_getmethods__.get(name,None)
    if method: return method(self)
    raise AttributeError(name)

def _swig_repr(self):
    try: strthis = "proxy of " + self.this.__repr__()
    except: strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)

try:
    _object = object
    _newclass = 1
except AttributeError:
    class _object : pass
    _newclass = 0


class MerDNA(_object):
    """Class representing a mer. All the mers have the same length, which must be set BEFORE instantiating any mers with jellyfish::MerDNA::k(int)"""
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, MerDNA, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, MerDNA, name)
    __repr__ = _swig_repr
    def __init__(self, *args): 
        """
        Class representing a mer. All the mers have the same length, which must be set BEFORE instantiating any mers with jellyfish::MerDNA::k(int)
        Class representing a mer. All the mers have the same length, which must be set BEFORE instantiating any mers with jellyfish::MerDNA::k(int)
        Class representing a mer. All the mers have the same length, which must be set BEFORE instantiating any mers with jellyfish::MerDNA::k(int)
        """
        this = _jellyfish.new_MerDNA(*args)
        try: self.this.append(this)
        except: self.this = this
    def k(*args):
        """
        Get the length of the k-mers
        Set the length of the k-mers
        """
        return _jellyfish.MerDNA_k(*args)

    if _newclass:k = staticmethod(k)
    __swig_getmethods__["k"] = lambda x: k
    def polyA(self):
        """Change the mer to a homopolymer of A"""
        return _jellyfish.MerDNA_polyA(self)

    def polyC(self):
        """Change the mer to a homopolymer of C"""
        return _jellyfish.MerDNA_polyC(self)

    def polyG(self):
        """Change the mer to a homopolymer of G"""
        return _jellyfish.MerDNA_polyG(self)

    def polyT(self):
        """Change the mer to a homopolymer of T"""
        return _jellyfish.MerDNA_polyT(self)

    def randomize(self):
        """Change the mer to a random one"""
        return _jellyfish.MerDNA_randomize(self)

    def is_homopolymer(self):
        """Check if the mer is a homopolymer"""
        return _jellyfish.MerDNA_is_homopolymer(self)

    def shift_left(self, *args):
        """Shift a base to the left and the leftmost base is return . "ACGT", shift_left('A') becomes "CGTA" and 'A' is returned"""
        return _jellyfish.MerDNA_shift_left(self, *args)

    def shift_right(self, *args):
        """Shift a base to the right and the rightmost base is return . "ACGT", shift_right('A') becomes "AACG" and 'T' is returned"""
        return _jellyfish.MerDNA_shift_right(self, *args)

    def canonicalize(self):
        """Change the mer to its canonical representation"""
        return _jellyfish.MerDNA_canonicalize(self)

    def reverse_complement(self):
        """Change the mer to its reverse complement"""
        return _jellyfish.MerDNA_reverse_complement(self)

    def get_canonical(self):
        """Return canonical representation of the mer"""
        return _jellyfish.MerDNA_get_canonical(self)

    def get_reverse_complement(self):
        """Return the reverse complement of the mer"""
        return _jellyfish.MerDNA_get_reverse_complement(self)

    def __eq__(self, *args):
        """Equality between mers"""
        return _jellyfish.MerDNA___eq__(self, *args)

    def __lt__(self, *args):
        """Lexicographic less-than"""
        return _jellyfish.MerDNA___lt__(self, *args)

    def __gt__(self, *args):
        """Lexicographic greater-than"""
        return _jellyfish.MerDNA___gt__(self, *args)

    def dup(self):
        """Duplicate the mer"""
        return _jellyfish.MerDNA_dup(self)

    def __str__(self):
        """Return string representation of the mer"""
        return _jellyfish.MerDNA___str__(self)

    def set(self, *args):
        """Set the mer from a string"""
        return _jellyfish.MerDNA_set(self, *args)

    def __getitem__(self, *args):
        """Get base i (0 <= i < k)"""
        return _jellyfish.MerDNA___getitem__(self, *args)

    def __setitem__(self, *args):
        """Set base i (0 <= i < k)"""
        return _jellyfish.MerDNA___setitem__(self, *args)

    def __lshift__(self, *args):
        """Shift a base to the left and return the mer"""
        return _jellyfish.MerDNA___lshift__(self, *args)

    def __rshift__(self, *args):
        """Shift a base to the right and return the mer"""
        return _jellyfish.MerDNA___rshift__(self, *args)

    __swig_destroy__ = _jellyfish.delete_MerDNA
    __del__ = lambda self : None;
MerDNA_swigregister = _jellyfish.MerDNA_swigregister
MerDNA_swigregister(MerDNA)

def MerDNA_k(*args):
  """
    Get the length of the k-mers
    Set the length of the k-mers
    """
  return _jellyfish.MerDNA_k(*args)

class QueryMerFile(_object):
    """Give random access to a Jellyfish database. Given a mer, it returns the count associated with that mer"""
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, QueryMerFile, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, QueryMerFile, name)
    __repr__ = _swig_repr
    def __init__(self, *args): 
        """Open the jellyfish database"""
        this = _jellyfish.new_QueryMerFile(*args)
        try: self.this.append(this)
        except: self.this = this
    def __getitem__(self, *args):
        """Get the count for the mer m"""
        return _jellyfish.QueryMerFile___getitem__(self, *args)

    __swig_destroy__ = _jellyfish.delete_QueryMerFile
    __del__ = lambda self : None;
QueryMerFile_swigregister = _jellyfish.QueryMerFile_swigregister
QueryMerFile_swigregister(QueryMerFile)

class ReadMerFile(_object):
    """Read a Jellyfish database sequentially"""
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, ReadMerFile, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, ReadMerFile, name)
    __repr__ = _swig_repr
    def __init__(self, *args): 
        """Open the jellyfish database"""
        this = _jellyfish.new_ReadMerFile(*args)
        try: self.this.append(this)
        except: self.this = this
    def next_mer(self):
        """Move to the next mer in the file. Returns false if no mers left, true otherwise"""
        return _jellyfish.ReadMerFile_next_mer(self)

    def mer(self):
        """Returns current mer"""
        return _jellyfish.ReadMerFile_mer(self)

    def count(self):
        """Returns the count of the current mer"""
        return _jellyfish.ReadMerFile_count(self)

    def __iter__(self):
        """Iterate through all the mers in the file, passing two values: a mer and its count"""
        return _jellyfish.ReadMerFile___iter__(self)

    def __next__(self):
        """Iterate through all the mers in the file, passing two values: a mer and its count"""
        return _jellyfish.ReadMerFile___next__(self)

    def next(self):
        """Iterate through all the mers in the file, passing two values: a mer and its count"""
        return _jellyfish.ReadMerFile_next(self)

    __swig_destroy__ = _jellyfish.delete_ReadMerFile
    __del__ = lambda self : None;
ReadMerFile_swigregister = _jellyfish.ReadMerFile_swigregister
ReadMerFile_swigregister(ReadMerFile)

class HashCounter(_object):
    """Read a Jellyfish database sequentially"""
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, HashCounter, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, HashCounter, name)
    __repr__ = _swig_repr
    def __init__(self, *args): 
        """
        Read a Jellyfish database sequentially
        Read a Jellyfish database sequentially
        """
        this = _jellyfish.new_HashCounter(*args)
        try: self.this.append(this)
        except: self.this = this
    def size(self):
        """Read a Jellyfish database sequentially"""
        return _jellyfish.HashCounter_size(self)

    def val_len(self):
        """Read a Jellyfish database sequentially"""
        return _jellyfish.HashCounter_val_len(self)

    def add(self, *args):
        """Read a Jellyfish database sequentially"""
        return _jellyfish.HashCounter_add(self, *args)

    def update_add(self, *args):
        """Read a Jellyfish database sequentially"""
        return _jellyfish.HashCounter_update_add(self, *args)

    def get(self, *args):
        """Read a Jellyfish database sequentially"""
        return _jellyfish.HashCounter_get(self, *args)

    def __getitem__(self, *args):
        """Read a Jellyfish database sequentially"""
        return _jellyfish.HashCounter___getitem__(self, *args)

    __swig_destroy__ = _jellyfish.delete_HashCounter
    __del__ = lambda self : None;
HashCounter_swigregister = _jellyfish.HashCounter_swigregister
HashCounter_swigregister(HashCounter)

class HashSet(_object):
    """Read a Jellyfish database sequentially"""
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, HashSet, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, HashSet, name)
    __repr__ = _swig_repr
    def __init__(self, *args): 
        """
        Read a Jellyfish database sequentially
        Read a Jellyfish database sequentially
        """
        this = _jellyfish.new_HashSet(*args)
        try: self.this.append(this)
        except: self.this = this
    def size(self):
        """Read a Jellyfish database sequentially"""
        return _jellyfish.HashSet_size(self)

    def add(self, *args):
        """Read a Jellyfish database sequentially"""
        return _jellyfish.HashSet_add(self, *args)

    def get(self, *args):
        """Read a Jellyfish database sequentially"""
        return _jellyfish.HashSet_get(self, *args)

    def __getitem__(self, *args):
        """Read a Jellyfish database sequentially"""
        return _jellyfish.HashSet___getitem__(self, *args)

    __swig_destroy__ = _jellyfish.delete_HashSet
    __del__ = lambda self : None;
HashSet_swigregister = _jellyfish.HashSet_swigregister
HashSet_swigregister(HashSet)

# This file is compatible with both classic and new-style classes.


