<jupyter_start><jupyter_text>Part 1: Initialize<jupyter_code>host = 'a_tract_21mer'
strand_id = 'STRAND1'
make_df = False
make_dihedral = False
plot_agent = MixPlot3(host, strand_id, big_traj_folder, dihedral_folder, backbone_data_folder, make_df)<jupyter_output>/home/yizaochen/codes/dna_rna/backbone_data/a_tract_21mer exists
/home/yizaochen/codes/dna_rna/backbone_data/a_tract_21mer/STRAND1 exists
/home/yizaochen/codes/dna_rna/backbone_data/a_tract_21mer/STRAND1/ndx exists
/home/yizaochen/codes/dna_rna/backbone_data/a_tract_21mer/STRAND1/plumed_input exists
/home/yizaochen/codes/dna_rna/backbone_data/a_tract_21mer/STRAND1/plumed_out exists
/home/yizaochen/codes/backbone_rigidity/plumed_test/a_tract_21mer exists<jupyter_text>Part 2: Make/Read DataFrame<jupyter_code>if make_df:
    plot_agent.make_k_df()
else:
    plot_agent.read_k_df()
    
if make_dihedral:
    plot_agent.make_all_dihedral_df()
else:
    plot_agent.read_all_diehdral_df()<jupyter_output><empty_output><jupyter_text>Part 2: Plot<jupyter_code>figsize = (6, 12)
hspace = 0
bottom = 0 
top = 5
fig, d_axes = plot_agent.plot_main(figsize, hspace, bottom, top)
png_out = path.join(drawzone_folder, f'{host}_{strand_id}.png')
plt.tight_layout()
#plt.savefig(png_out, dpi=100)
plt.show()<jupyter_output><empty_output><jupyter_text>Batch Drawing<jupyter_code>hosts = ['a_tract_21mer', 'g_tract_21mer', 'atat_21mer', 'gcgc_21mer']
strands = ['STRAND1', 'STRAND2']
make_df = False
make_dihedral = False

for host in hosts:
    for strand_id in strands:
        plot_agent = MixPlot3(host, strand_id, big_traj_folder, dihedral_folder, backbone_data_folder, make_df)
        
        if make_df:
            plot_agent.make_k_df()
        else:
            plot_agent.read_k_df()

        if make_dihedral:
            plot_agent.make_all_dihedral_df()
        else:
            plot_agent.read_all_diehdral_df()
            
        figsize = (6, 12)
        hspace = 0
        bottom = 0 
        top = 5
        fig, d_axes = plot_agent.plot_main(figsize, hspace, bottom, top)
        png_out = path.join(drawzone_folder, f'{host}_{strand_id}.png')
        plt.tight_layout()
        #plt.savefig(png_out, dpi=100)
        plt.show()
hosts = ['g_tract_21mer', 'atat_21mer', 'gcgc_21mer']
strands = ['STRAND1', 'STRAND2']
make_df = True
make_dihedral = True

for host in hosts:
    for strand_id in strands:
        plot_agent = MixPlot2(host, strand_id, big_traj_folder, dihedral_folder, backbone_data_folder, make_df)
        
        if make_df:
            plot_agent.make_k_df()
        else:
            plot_agent.read_k_df()

        if make_dihedral:
            plot_agent.make_all_dihedral_df()
        else:
            plot_agent.read_all_diehdral_df()
            
        figsize = (6, 12)
        hspace = 0
        bottom = 0 
        top = 6.0
        fig, d_axes = plot_agent.plot_main(figsize, hspace, bottom, top)
        png_out = path.join(drawzone_folder, f'{host}_{strand_id}.png')
        plt.tight_layout()
        plt.savefig(png_out, dpi=100)
        plt.show()<jupyter_output><empty_output><jupyter_text>Addtional Part: Data Matrix Max, Min<jupyter_code>dihedral_name_lst = ["O4prime-O5prime", "C2prime-C8orC6", "O4prime-C8orC6"]
d_min_max = {label: {'Min': list(), 'Max': list()} for label in dihedral_name_lst}

hosts = ['a_tract_21mer', 'g_tract_21mer', 'atat_21mer', 'gcgc_21mer']
strands = ['STRAND1', 'STRAND2']

make_df = False
make_dihedral = False

for host in hosts:
    for strand_id in strands:
        plot_agent = MixPlot3(host, strand_id, big_traj_folder, dihedral_folder, backbone_data_folder, make_df)
        
        if make_df:
            plot_agent.make_k_df()
        else:
            plot_agent.read_k_df()

        if make_dihedral:
            plot_agent.make_all_dihedral_df()
        else:
            plot_agent.read_all_diehdral_df()

        for label in dihedral_name_lst:
            data_mat = plot_agent.assemble_data_mat(plot_agent.d_dihedral_df[label])
            d_min_max[label]['Min'].append(data_mat.min())
            d_min_max[label]['Max'].append(data_mat.max())
            
for label in dihedral_name_lst:
    print(label)
    minimum = np.array(d_min_max[label]['Min']).min()
    maximum = np.array(d_min_max[label]['Max']).max() 
    print(f'Min: {minimum:.3f}')
    print(f'Max: {maximum:.3f}')    
plot_agent.get_data_mat_min_max()<jupyter_output>C2'-C3'-O3'-P
Min: 0.0 Max: 0.029
epsilon - zeta:
Min: 0.0 Max: 0.022<jupyter_text>Additional Part: Spring Constant Minimum Maximum<jupyter_code>k_labels = ["C1'-N3/C1'-O2", "C2'-C8/C2'-C6", "O4'-O5'"]
d_min_max = {label: {'Min': list(), 'Max': list()} for label in k_labels}

hosts = ['a_tract_21mer', 'g_tract_21mer', 'atat_21mer', 'gcgc_21mer']
strands = ['STRAND1', 'STRAND2']

make_df = False
make_dihedral = False

for host in hosts:
    for strand_id in strands:
        plot_agent = MixPlot3(host, strand_id, big_traj_folder, dihedral_folder, backbone_data_folder, make_df)
        
        if make_df:
            plot_agent.make_k_df()
        else:
            plot_agent.read_k_df()

        if make_dihedral:
            plot_agent.make_all_dihedral_df()
        else:
            plot_agent.read_all_diehdral_df()
            
        figsize = (6, 12)
        hspace = 0
        bottom = 0 
        top = 6.0
        fig, d_axes = plot_agent.plot_main(figsize, hspace, bottom, top)
        png_out = path.join(drawzone_folder, f'{host}_{strand_id}.png')
        #plt.tight_layout()
        #plt.savefig(png_out, dpi=100)
        #plt.show()
        
        for idx, label in enumerate(k_labels):
            ylim = d_axes[idx].get_ylim()
            d_min_max[label]['Min'].append(ylim[0])
            d_min_max[label]['Max'].append(ylim[1])
            
for label in k_labels:
    print(label)
    minimum = np.array(d_min_max[label]['Min']).min()
    maximum = np.array(d_min_max[label]['Max']).max() 
    print(f'Min: {minimum:.3f}')
    print(f'Max: {maximum:.3f}')    
idx = 2
ylim = d_axes[idx].get_ylim()
print(f'Min: {ylim[0]:.3f}')
print(f'Max: {ylim[1]:.3f}')<jupyter_output>Min: 2.665
Max: 6.763<jupyter_text>Additional Part : Color Bar<jupyter_code>figsize = (8,4)
dihedral_name = "C2prime-P" #"C2prime-P", "C4prime-P", "C3prime-O5prime", "epsilon-zeta"
fig, ax1, cb1  = plot_agent.draw_color_bar(figsize, dihedral_name)
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12635039924847347, 'fraction_numerical': 0.025677156724596837, 'mean_word_length': 3.339673913043478, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 26, '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}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '644291', 'license': 'MIT', 'n_tokens_mistral': 2607, 'n_tokens_neox': 2447, 'n_words': 393, 'path': 'notebooks/mix_k_dihedral_2.ipynb', 'repo_name': 'yizaochen/backbone_rigidity', 'size': '6387'}