Exemple #1
0
def load_counting_hash(filename):
    """Load a counting_hash object from the given filename and return it.

    Keyword argument:
    filename -- the name of the counting_hash file
    """
    hashtable = CountingHash(1, [1])
    hashtable.load(filename)

    return hashtable
Exemple #2
0
def load_counting_hash(filename):
    """Load a counting_hash object from the given filename and return it.

    Keyword argument:
    filename -- the name of the counting_hash file
    """
    hashtable = CountingHash(1, [1])
    hashtable.load(filename)

    return hashtable
Exemple #3
0
def new_counting_hash(k, starting_size, n_tables=2):
    """Return a new countinghash object.

    Keyword arguments:
    k -- kmer size to use
    starting_size -- lower bound on hashsize to use
    n_tables -- number of hash tables to use (default = 2)
    n_threads  -- number of simultaneous threads to execute (default = 1)
    """
    primes = get_n_primes_above_x(n_tables, starting_size)

    return CountingHash(k, primes)
Exemple #4
0
 def __new__(cls, k, starting_size, n_tables):
     primes = get_n_primes_above_x(n_tables, starting_size)
     hb = CountingHash(k, primes)
     c = _LabelHash.__new__(cls, hb)
     c.graph = hb
     return c
Exemple #5
0
 def __new__(cls, k, starting_size, n_tables):
     primes = get_n_primes_near_x(n_tables, starting_size)
     c = _CountingHash.__new__(cls, k, primes)
     c.primes = primes
     return c
Exemple #6
0
 def __new__(cls, k, starting_size, n_tables):
     primes = get_n_primes_near_x(n_tables, starting_size)
     c = _CountingHash.__new__(cls, k, primes)
     c.primes = primes
     return c