<commit_before><commit_msg>generate read and kmer counts<commit_after>#! /usr/bin/env python
import sys, screed

K = 32

for filename in sys.argv[1:]:
   n_kmers = 0
   n_reads = 0

   for record in screed.open(filename):
      n_kmers += len(record.sequence) - K + 1
      n_reads += 1

   fp = open(filename + '.stats', 'w')
   fp.write('K=%d\nn_kmers: %d\nn_reads: %d\n' % (K, n_kmers, n_reads))
   fp.close()

{'fraction_non_alphanumeric': 0.15738498789346247, 'fraction_numerical': 0.01694915254237288, 'mean_word_length': 3.1818181818181817, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1849466', 'n_tokens_mistral': 177, 'n_tokens_neox': 164, 'n_words': 41}