Counts all k-mers in sequence.
178023
def consume(self, seq):
        ''''''
        for kmer in iter_kmers(seq, self.k, canonical=self.canonical):
            self._incr(kmer)
1092475
def count(index,h):
    '''
    
    '''
    try:
        response = base.es.cat.count(index,h=h)
        table = base.draw_table(response)
    except Exception as e:
        click.echo(e)
    else:
        click.echo(table)
191637
def total_count(self, seqs, nreport=100, scan_rc=True):
        
        
        count_table = [counts for counts in self.count(seqs, nreport, scan_rc)]
        return np.sum(np.array(count_table), 0)
428176
def count_unique_sequences(
        allele_reads,
        max_prefix_size=None,
        max_suffix_size=None):
    
    groups = group_unique_sequences(
        allele_reads,
        max_prefix_size=max_prefix_size,
        max_suffix_size=max_suffix_size)
    return {
        seq_tuple: len(read_names)
        for (seq_tuple, read_names) in groups.items()
    }
71150
def _count_fastq_reads(in_fastq, min_reads):
    
    with open(in_fastq) as in_handle:
        items = list(itertools.takewhile(lambda i : i <= min_reads,
                                         (i for i, _ in enumerate(FastqGeneralIterator(in_handle)))))
    return len(items)
264552
def count_by_type(self,table,timesteps):
        """"""
        hbonds = defaultdict(int)
        for contact in table:
            #count by residue name not by proteinring
            pkey = (contact.donor_idx,contact.acceptor_idx,contact.donor_atom, contact.acceptor_atom,contact.donor_resnm,contact.donor_resid, contact.acceptor_resnm,contact.acceptor_resid)
            hbonds[pkey]+=1
        dtype = [("donor_idx",int),("acceptor_idx",int),("donor_atom","|U4"),("acceptor_atom","|U4"),("donor_resnm","|U8"),("donor_resid","|U8"),("acceptor_resnm","|U8"),("acceptor_resid","|U8"),("frequency",float) ]
        out = np.empty((len(hbonds),),dtype=dtype)
        tsteps = float(len(timesteps))
        for cursor,(key,count) in enumerate(hbonds.iteritems()):
            out[cursor] = key + (count / tsteps,)
        return out.view(np.recarray)
166130
def _count(self, cmd, collation=None):
        """"""
        with self._socket_for_reads() as (sock_info, slave_ok):
            res = self._command(
                sock_info, cmd, slave_ok,
                allowable_errors=["ns missing"],
                codec_options=self.__write_response_codec_options,
                read_concern=self.read_concern,
                collation=collation)
        if res.get("errmsg", "") == "ns missing":
            return 0
        return int(res["n"])
945723
def count_residues(self, record, pdb_record):
        ''''''
        mutations = self.get_record_mutations(record)
        pdb_chains = set([m['Chain'] for m in mutations])
        assert(len(pdb_chains) == 1) # we expect monomeric cases
        pdb_chain = pdb_chains.pop()
        return len(pdb_record.get('Chains', {}).get(pdb_chain, {}).get('Sequence', ''))
1270558
def count(self):
        """"""
        if self.request["Select"] == "COUNT":
            while not self.exhausted:
                next(self, None)
        return self._count
664605
public static int getBondCount(IChemSequence sequence) {
        int count = 0;
        for (int i = 0; i < sequence.getChemModelCount(); i++) {
            count += ChemModelManipulator.getBondCount(sequence.getChemModel(i));
        }
        return count;
    }
329380
def filter_sequences(self, seq_type):
        
        return DictList(x for x in self.sequences if isinstance(x, seq_type))
378461
def count(args):
    
    counts = defaultdict(int)
    for arg in args:
        for item in arg:
            counts[item] = counts[item] + 1
    return counts
915170
def count_by(records: Sequence[Dict], field_name: str) -> defaultdict:
    

    counter = defaultdict(int)

    for record in records:
        name = record[field_name]
        counter[name] += 1

    return counter
485655
def count_variants(graph):
    
    return Counter(
        variant_data[KIND]
        for data in graph
        if has_variant(graph, data)
        for variant_data in data[VARIANTS]
    )
1074609
def count(self):
        
        return (
            self
            .mapPartitions(lambda p: [sum(1 for _ in p)])
            .reduce(operator.add)
        )
499724
def _count(dicts):
    
    counts = defaultdict(int)
    for d in dicts:
        for k, v in d.items():
            counts[k] += v
    return counts
713960
def count(self, **query_dict):
        """"""
        param_dict = query_dict.copy()
        param_dict['count'] = 0
        resp_dict = self._get_query(**param_dict)
        return resp_dict['response']['numFound']