<commit_before>import re
import string
import pysam
import matplotlib.pyplot as plt
import pandas as pd
from collections import defaultdict
from collections import OrderedDict
import argparse
import itertools


class MismatchFrequencies:
    '''Iterate over a SAM/BAM alignment file, collecting reads with mismatches. One
    class instance per alignment file. The result_dict attribute will contain a
    nested dictionary with name, readlength and mismatch count.'''
    def __init__(self, result_dict={}, alignment_file=None, name="name", minimal_readlength=21,<commit_msg>Specify pdf backend for mismatch_frequencies.py<commit_after>import re
import string
import pysam
import matplotlib
import pandas as pd
from collections import defaultdict
from collections import OrderedDict
import argparse
import itertools

matplotlib.use('pdf')
import matplotlib.pyplot as plt  # noqa: E402


class MismatchFrequencies:
    '''Iterate over a SAM/BAM alignment file, collecting reads with mismatches. One
    class instance per alignment file. The result_dict attribute will contain a
    nested dictionary with name, readlength and mismatch count.'''
    def __init__(self, result_dict={}, alignment_file=None, name="name", minimal_readlength=21,
{'fraction_non_alphanumeric': 0.05640612409347301, 'fraction_numerical': 0.0056406124093473006, 'mean_word_length': 5.641711229946524, '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': '6810056', 'n_tokens_mistral': 339, 'n_tokens_neox': 327, 'n_words': 136}