<jupyter_start><jupyter_text>Plot Energy Matrices<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
import glob
import pandas as pd
import scipy as sp<jupyter_output><empty_output><jupyter_text>We will be plotting heatmaps of all arrays in the 'example arrays' folder, so first we will get the file names of the listed arrays<jupyter_code>names = glob.glob('../data/example_arrays/aphAAnaerodataset_alldone_with_largeMCMC194_activator')
for n in names:
    tempdf = pd.io.parsers.read_csv(n,delim_whitespace=True)
    # Convert to numpy array
    temparr = np.array(tempdf[['val_A','val_C','val_G','val_T']])
    
    # find maximum absolute to center colorbar
    maximum = np.max(np.abs(temparr))
    
    #now plot using matplotlib
    fig,ax = plt.subplots(figsize=((10,2)))
    plt.imshow(
        temparr.T, 
        aspect='auto', 
        interpolation='nearest',
        cmap='coolwarm',
        vmin=-maximum,
        vmax=maximum
    )
    plt.colorbar()
    plt.xlabel('Position')
    ax.set_yticklabels(['','A','C','G','T'])
    plt.savefig(n+'_array.png',format='png')<jupyter_output><empty_output><jupyter_text>Finally, here are the versions of packages used in this notebook. To display the versions, we are using the Jupyter Lab extension `watermark`, which can be found [here](https://github.com/rasbt/watermark).  Computing environment<jupyter_code>%load_ext watermark
%watermark -v -p jupyterlab,numpy,pandas,matplotlib,scipy<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11685695097380792, 'fraction_numerical': 0.004029550033579583, 'mean_word_length': 4.559701492537314, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 1, '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}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '618632', 'license': 'MIT', 'n_tokens_mistral': 525, 'n_tokens_neox': 517, 'n_words': 116, 'path': 'notebooks/deprecated_notebooks/plot_arrays.ipynb', 'repo_name': 'RPGroup-PBoC/RegSeq', 'size': '1489'}