def load_data(self, histfile):
    self.data = []
    self.totalKmers = 0
    self.hist = {}
    kformat = self.guess_format(histfile)
    kformats = ('Meryl', 'Soap', 'AllPaths')
    logging.debug('Guessed format: {0}'.format(kformats[kformat]))
    fp = open(histfile)
    for (rowno, row) in enumerate(fp):
        if (row[0] == '#'):
            continue
        if (kformat == KSOAP):
            K = (rowno + 1)
            counts = int(row.strip())
        else:
            (K, counts) = row.split()[:2]
            (K, counts) = (int(K), int(counts))
        Kcounts = (K * counts)
        self.totalKmers += Kcounts
        self.hist[K] = Kcounts
        self.data.append((K, counts))
def load_data(self, histfile):
    self.data = []
    self.totalKmers = 0
    self.hist = {}
    kformat = self.guess_format(histfile)
    kformats = ('Meryl', 'Soap', 'AllPaths')
    logging.debug('Guessed format: {0}'.format(kformats[kformat]))
    fp = open(histfile)
    for (rowno, row) in enumerate(fp):
        if (row[0] == '#'):
            continue
        if (kformat == KSOAP):
            K = (rowno + 1)
            counts = int(row.strip())
        else:
            (K, counts) = row.split()[:2]
            (K, counts) = (int(K), int(counts))
        Kcounts = (K * counts)
        self.totalKmers += Kcounts
        self.hist[K] = Kcounts
        self.data.append((K, counts))