<commit_before>"""
Plot a heatmap of the coverage data from coverage_depth.py, except this needs the data to be transposed from that code
"""

import os
import sys

import argparse
import matplotlib.pyplot as plt
import numpy as np
import math



if __name__ == '__main__':
    parser = argparse.ArgumentParser(description="Plot a heatmap")
    parser.add_argument('-f', help='file of tab delimited data', required=True)
    parser.add_argument('-w', help='window to use (default=1000)', default=1000, type=int)
    parser.add_argument('-n', help="column number to start at (default = 1; 0 indexed)", default=1, type=int)
    parser.add_argument('-l', help="Log normalize the data", action="store_true")
    parser.add_argument('-o', help='output file to save figure')
    parser.add_argument('-m', help='maximum value to use for any average', type=float)
    args = parser.parse_args()

    header = None
    data = []
    row_labels = []
    eps = 0.00000000000000001 # epsilon since we can't do log 0

    with open(args.f, 'r') as f:<commit_msg>Using agg<commit_after>"""
Plot a heatmap of the coverage data from coverage_depth.py, except this needs the data to be transposed from that code
"""

import os
import sys

import argparse
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import math



if __name__ == '__main__':
    parser = argparse.ArgumentParser(description="Plot a heatmap")
    parser.add_argument('-f', help='file of tab delimited data', required=True)
    parser.add_argument('-w', help='window to use (default=1000)', default=1000, type=int)
    parser.add_argument('-n', help="column number to start at (default = 1; 0 indexed)", default=1, type=int)
    parser.add_argument('-l', help="Log normalize the data", action="store_true")
    parser.add_argument('-o', help='output file to save figure')
    parser.add_argument('-m', help='maximum value to use for any average', type=float)
    args = parser.parse_args()

    header = None
    data = []
    row_labels = []
    eps = 0.00000000000000001 # epsilon since we can't do log 0

    with open(args.f, 'r') as f:
{'fraction_non_alphanumeric': 0.1232427366447985, 'fraction_numerical': 0.028116213683223992, 'mean_word_length': 4.284653465346534, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '2243666', 'n_tokens_mistral': 718, 'n_tokens_neox': 643, 'n_words': 225}