<jupyter_start><jupyter_text>Born to slide: mobile origin licensing factors confer resistance to transcription conflicts Jupyter notebooks  Figures:+ 1D+ 1E+ S1E+ S1F+ S1G+ S1H Archives:+ Photobleaching_licensed-DNA_ATP.yama+ Photobleaching_licensed-DNA_ATPgS.yama+ Transcription_licensed-DNA_T7T_ATP.yama+ Transcription_licensed-DNA_T7T_ATPgS.yama Additional data:+ none  Initialize ImageJ<jupyter_code>import imagej
ij = imagej.init('/Applications/Fiji.app')
ij.getVersion()<jupyter_output><empty_output><jupyter_text>Imports<jupyter_code>import sys
sys.path.insert(0, '..')
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import re
import awesome_data
from marspy.convert.archive import DnaMoleculeArchive, instantiate_archive, describe_archives
from marspy.stats import bootstrap, calc_ci
from tqdm.notebook import tqdm
from functools import reduce<jupyter_output>marspy initialized.<jupyter_text>Select archives<jupyter_code>selected_archives = ['Photobleaching_licensed-DNA_ATP.yama',
                     'Photobleaching_licensed-DNA_ATPgS.yama',
                     'Transcription_licensed-DNA_T7T_ATP.yama',
                     'Transcription_licensed-DNA_T7T_ATPgS.yama']<jupyter_output><empty_output><jupyter_text>Figure style and output directory<jupyter_code>from figure_style import *
set_style_paper()
dir_out = '/Volumes/pool-duderstadt/Matthias/Manuscript/Figures/SVGs/Figure1/'
dir_out<jupyter_output><empty_output><jupyter_text>Instantiate selected archives<jupyter_code>for archive in tqdm(selected_archives):
    instantiate_archive(archive, awesome_data.datasets)<jupyter_output><empty_output><jupyter_text>Archives Overview<jupyter_code>describe_archives(DnaMoleculeArchive.instances)<jupyter_output><empty_output><jupyter_text>Load segment tables, apply filter & calculate bleaching steps<jupyter_code>for index,archive in enumerate(tqdm(DnaMoleculeArchive.instances)):
    
    archive.add_segments_tables()
    for i in range(5):
        archive.filter_segments()
    try:
        archive.calc_bleaching_steps()
    except IndexError:
        # archives without bleaching data
        continue<jupyter_output><empty_output><jupyter_text>Generate main df<jupyter_code>def setup_pandas_df(archive_instances):
    '''Sets up a 2-level df with all relevant information'''
    #indices will be UIDs
    #outside: set comprehension to cover all possible prefixes in all instances
    col_1 = sorted(list({prefix for prefix in archive.prefixes for archive in archive_instances}))
    #inside
    col_2 = 'position_on_dna bleaching_steps initial_intensity lifetime colocalization'.split()

    hier_index = pd.MultiIndex.from_product([col_1,col_2],names=['molecule','properties'])

    return pd.DataFrame(columns=hier_index)
    
df = setup_pandas_df(DnaMoleculeArchive.instances)

# sort MultiIndexCols for performance
df.sort_index(axis=1, inplace=True)
df.head()

# fill dataframe
for archive in tqdm(DnaMoleculeArchive.instances):

    for molecule in archive.molecules:
        #general columns first
        #this could be generalized with mol prefixes
        df.loc[molecule.uid,'number_orc'] = molecule.params['Number_ORC']
        df.loc[molecule.uid,'number_mcm'] = molecule.params['Number_MCM']
        df.loc[molecule.uid,'tags'] = reduce(lambda tag1,tag2: tag1+','+tag2, molecule.tags)
        df.loc[molecule.uid,'nucleotide'] = archive.nucleotide
        df.loc[molecule.uid,'dna_length'] = molecule.calc_length_dna()

        for prefix in molecule.prefixes:
            #mean position
            df.loc[molecule.uid,(prefix,'position_on_dna')] = molecule.df[prefix+'Position_on_DNA'].mean()

            #sometimes bleaching is rejected (reject_bleach_prefix)
            try:
                if not 'reject_bleach_'+prefix in molecule.tags:
                    #from attribute
                    df.loc[molecule.uid,(prefix,'bleaching_steps')] = molecule.bleaching_steps[prefix]

                #take intensity from corrected segment table (intensity in first segment)
                df.loc[molecule.uid,(prefix,'initial_intensity')] = \
                list(filter(lambda seg_df: seg_df.prefix == prefix, molecule.seg_dfs))[0].df.loc[0,'y1']
                
            except KeyError:
                # archives without bleaching data
                pass
            except AttributeError:
                # archives without bleaching data
                pass

            #lifetime (in frames) defined on tracking length
            df.loc[molecule.uid,(prefix,'lifetime')] = len(molecule.df[prefix+'y'].dropna())

            #orc/mcm colocalization based on mean?
            #first set to False (default)
            df.loc[molecule.uid,(prefix,'colocalization')] = np.nan
            for other_prefix in molecule.prefixes:
                #only consider proteins different from current protein (prefix)
                if other_prefix.startswith(prefix.split('_')[0]):
                    #iterate to next prefix
                    continue

                #define colocalization if mean distance of both proteins is < 1000 bp
                elif abs(molecule.df[prefix+'Position_on_DNA'] - molecule.df[other_prefix+'Position_on_DNA']).mean() < 1000:
                    #set value to True and break out of loop
                    df.loc[molecule.uid,(prefix,'colocalization')] = other_prefix
                    break          
            
# convert tags back to list
df['tags'] = df['tags'].apply(lambda tags: tags.split(','))

# again sort MultiIndexCols for performance
df.sort_index(axis=1, inplace=True)

# fix data types
df = df.infer_objects()

df.head()<jupyter_output><empty_output><jupyter_text>Figures  Figure 1D: MCM bleaching steps<jupyter_code># estimate standard error by bootstrapping
_plot_df = pd.DataFrame(columns=['bleaching_steps','nucleotide'])
protein = 'MCM'

for nuc in df['nucleotide'].unique():
    _temp_df = pd.DataFrame(data=(pd.melt(df[df['nucleotide']==nuc].filter(regex=(protein+"_"),axis=1)
                                          .xs('bleaching_steps',level='properties',axis=1))
                                  ['value'].dropna().value_counts(normalize=True).rename('probability').
                                  reset_index().sort_values('index')))
    _temp_df.columns = ['bleaching_steps','probability']
    _temp_df['nucleotide'] = nuc
    _plot_df = pd.concat([_plot_df,_temp_df])
    _plot_df = _plot_df.convert_dtypes()
    _plot_df.reset_index(drop=True,inplace=True)
_plot_df
for row in _plot_df.index:
    bootstrap_data = pd.DataFrame(data=(pd.melt(df[df['nucleotide']==_plot_df.loc[row,'nucleotide']].filter(regex=(protein+"_"),axis=1)
                                          .xs('bleaching_steps',level='properties',axis=1))['value'].dropna()))
    bootstrap_data['value'] = bootstrap_data['value'].apply(lambda value: 1 if value == _plot_df.loc[row,'bleaching_steps'] else 0)
    bootstrap_means = bootstrap(bootstrap_data['value'],n_boot=10000)
    _plot_df.loc[row,'bs_mean'] = np.mean(bootstrap_means)
    _plot_df.loc[row,'standard_error'] = np.std(bootstrap_means)
    _plot_df.loc[row,'68_ci_lower'], _plot_df.loc[row,'68_ci_upper'] = calc_ci(bootstrap_means,ci=68)
    _plot_df.loc[row,'95_ci_lower'], _plot_df.loc[row,'95_ci_upper'] = calc_ci(bootstrap_means,ci=95)
_plot_df
fig,axes = plt.subplots()
protein = 'MCM'
_plot_df.groupby(['bleaching_steps','nucleotide'])['probability'].sum().unstack().plot(kind='bar', width=0.8, ax=axes,lw=0.5, edgecolor='.15',
                                                                                       color=[sns.desaturate(palettes['MCM'][1],0.75),sns.desaturate(palettes['OCCM'][1],0.75)],
                                                                                       error_kw=dict(ecolor='.15', lw=0.5, capsize=2, capthick=0.5),
                                                                                       yerr=_plot_df.groupby(['bleaching_steps','nucleotide'])['standard_error'].sum().unstack())
axes.set_xlim(-0.5,7.5)
axes.set_ylim(0,1)
axes.set_xlabel('Bleaching steps')
axes.set_ylabel('Probability')

axes.text(0.95, 0.75, f"n-ATP = {len(pd.melt(df[df['nucleotide']=='ATP'].filter(regex=(protein+'_'),axis=1).xs('bleaching_steps',level='properties',axis=1))['value'].dropna())}",
        verticalalignment='top', horizontalalignment='right',
        transform=axes.transAxes,
        color='.15')
axes.text(0.95, 0.65, f"n-ATPgS = {len(pd.melt(df[df['nucleotide']=='ATPgS'].filter(regex=(protein+'_'),axis=1).xs('bleaching_steps',level='properties',axis=1))['value'].dropna())}",
        verticalalignment='top', horizontalalignment='right',
        transform=axes.transAxes,
        color='.15')

plt.xticks(rotation=0)
plt.legend(frameon=False,loc=1)
sns.despine()
plt.savefig(dir_out+'1D_MCM_bleaching_hueNuc.svg',transparent=True)<jupyter_output><empty_output><jupyter_text>Figure 1E: ORC bleaching steps<jupyter_code># estimate standard error by bootstrapping
_plot_df = pd.DataFrame(columns=['bleaching_steps','nucleotide'])
protein = 'ORC'

for nuc in df['nucleotide'].unique():
    _temp_df = pd.DataFrame(data=(pd.melt(df[df['nucleotide']==nuc].filter(regex=(protein+"_"),axis=1)
                                          .xs('bleaching_steps',level='properties',axis=1))
                                  ['value'].dropna().value_counts(normalize=True).rename('probability').
                                  reset_index().sort_values('index')))
    _temp_df.columns = ['bleaching_steps','probability']
    _temp_df['nucleotide'] = nuc
    _plot_df = pd.concat([_plot_df,_temp_df])
    _plot_df = _plot_df.convert_dtypes()
    _plot_df.reset_index(drop=True,inplace=True)
_plot_df
for row in _plot_df.index:
    bootstrap_data = pd.DataFrame(data=(pd.melt(df[df['nucleotide']==_plot_df.loc[row,'nucleotide']].filter(regex=(protein+"_"),axis=1)
                                          .xs('bleaching_steps',level='properties',axis=1))['value'].dropna()))
    bootstrap_data['value'] = bootstrap_data['value'].apply(lambda value: 1 if value == _plot_df.loc[row,'bleaching_steps'] else 0)
    bootstrap_means = bootstrap(bootstrap_data['value'],n_boot=10000)
    _plot_df.loc[row,'bs_mean'] = np.mean(bootstrap_means)
    _plot_df.loc[row,'standard_error'] = np.std(bootstrap_means)
    _plot_df.loc[row,'68_ci_lower'], _plot_df.loc[row,'68_ci_upper'] = calc_ci(bootstrap_means,ci=68)
    _plot_df.loc[row,'95_ci_lower'], _plot_df.loc[row,'95_ci_upper'] = calc_ci(bootstrap_means,ci=95)
_plot_df
fig,axes = plt.subplots()
protein = 'ORC'
_plot_df.groupby(['bleaching_steps','nucleotide'])['probability'].sum().unstack().plot(kind='bar', width=0.8, ax=axes,lw=0.5, edgecolor='.15',
                                                                                       color=[sns.desaturate(palettes[protein][1],0.75),sns.desaturate(palettes[protein][3],0.75)],
                                                                                       error_kw=dict(ecolor='.15', lw=0.5, capsize=2, capthick=0.5),
                                                                                       yerr=_plot_df.groupby(['bleaching_steps','nucleotide'])['standard_error'].sum().unstack())
axes.set_xlim(-0.5,7.5)
axes.set_ylim(0,1)
axes.set_xlabel('Bleaching steps')
axes.set_ylabel('Probability')

axes.text(0.95, 0.75, f"n-ATP = {len(pd.melt(df[df['nucleotide']=='ATP'].filter(regex=(protein+'_'),axis=1).xs('bleaching_steps',level='properties',axis=1))['value'].dropna())}",
        verticalalignment='top', horizontalalignment='right',
        transform=axes.transAxes)
axes.text(0.95, 0.65, f"n-ATPgS = {len(pd.melt(df[df['nucleotide']=='ATPgS'].filter(regex=(protein+'_'),axis=1).xs('bleaching_steps',level='properties',axis=1))['value'].dropna())}",
        verticalalignment='top', horizontalalignment='right',
        transform=axes.transAxes)

plt.xticks(rotation=0)
plt.legend(frameon=False,loc=1)
sns.despine()
plt.savefig(dir_out+'1E_ORC_bleaching_hueNuc.svg',transparent=True)<jupyter_output><empty_output><jupyter_text>Figure S1E: MCM bleaching trajectories<jupyter_code>example_molecules_atp_uid = ['sc7XcNAgUwYRSrNDLAZ8gU','2mc2iKhd2nps2mNmEbY19V','7xFMFh6FAVBE6o43oRrHuj','twz6GxzAWHfFvMubfHXyVH']
example_molecules_atpgs_uid = ['dTWpa7iPTQ9zDqRtE3V2EJ','9CtFLGKSFNwq3VNNH6S7W8','cwr8DRcz5zKg1EaDVzrN9m','jzSPiaQJiLWW53AXpb9anw']
example_molecules_atp = []
example_molecules_atpgs = []
# grab molecule objects
for uid in example_molecules_atp_uid:
    for archive in DnaMoleculeArchive.instances:
        try:
            example_molecules_atp.append(archive.get_molecule_by_uid(uid))
            break
        except IndexError:
            continue
            
for uid in example_molecules_atpgs_uid:
    for archive in DnaMoleculeArchive.instances:
        try:
            example_molecules_atpgs.append(archive.get_molecule_by_uid(uid))
            break
        except IndexError:
            continue
protein = 'MCM'
fig,axes=plt.subplots(2,4,figsize=(4,2.5),sharex=True, sharey=True)

# ATP
col_counter = 0

for molecule in example_molecules_atp:
    
    sns.lineplot(x='MCM_1_Time (s)', y='MCM_1_Intensity',data=molecule.df,
                 ax=axes[0,col_counter],color=palettes['MCM'][1],lw=0.5)
    
    for seg_df in molecule.seg_dfs:
        if seg_df.prefix == 'MCM_1_':
            for row in seg_df.df.index:
                temp_df = pd.DataFrame(data=[seg_df.df.loc[row,['x1','y1']].values, seg_df.df.loc[row,['x2','y2']].values],columns=['x','y'])
                sns.lineplot(x='x', y='y',data=temp_df,ax=axes[0,col_counter],color='0.15',lw=1)
            break
    
    col_counter+=1


# ATPgS
col_counter = 0

for molecule in example_molecules_atpgs:
    
    sns.lineplot(x='MCM_1_Time (s)', y='MCM_1_Intensity',data=molecule.df,
                 ax=axes[1,col_counter],color=palettes['OCCM'][1],lw=0.5)
    
    for seg_df in molecule.seg_dfs:
        if seg_df.prefix == 'MCM_1_':
            for row in seg_df.df.index:
                temp_df = pd.DataFrame(data=[seg_df.df.loc[row,['x1','y1']].values, seg_df.df.loc[row,['x2','y2']].values],columns=['x','y'])
                sns.lineplot(x='x', y='y',data=temp_df,ax=axes[1,col_counter],color='.15',lw=1)
            break
    
    col_counter+=1
        
fig.text(0.5, 0.04, 'Time (s)', ha='center')
fig.text(0.04, 0.5, 'MCM fluorescence (AU)', va='center', rotation='vertical')
        
for ax_array in axes:
    for ax in ax_array:
        ax.set_xlabel(None)
        ax.set_ylabel(None)


plt.xticks([0,200,400,600])
plt.yticks([0,20000,40000,60000])
plt.xlim(0,600)
#plt.ylim([-3000,60000])
plt.ticklabel_format(axis="y", style="sci",scilimits=(0,0))
#fig.suptitle('Photobleaching confirms MCM DH formation')

sns.despine(trim=True)

fig.tight_layout(rect=[0.05, 0.05, 0.95, 0.95])

plt.savefig(dir_out+"S1E_MCM_bleaching_trajectories_hueNuc.svg",transparent=True)<jupyter_output><empty_output><jupyter_text>Figure S1F: ORC-MCM colocalization<jupyter_code># estimate standard error by bootstrapping
_plot_df = pd.DataFrame(columns=['protein','nucleotide'])
proteins = ['MCM','','ORC']
for protein in proteins:
    if protein == '':
        _temp_df = pd.DataFrame(data=[0])
        _temp_df.columns = ['probability']
        _temp_df['protein'] = ''
        _temp_df['nucleotide'] = ''
        _temp_df['nobs'] = 0
        _temp_df['bs_mean'] = 0
        _temp_df['standard_error'] = 0
        _temp_df['68_ci_lower'], _temp_df['68_ci_upper'] = (0,0)
        _temp_df['95_ci_lower'], _temp_df['95_ci_upper'] = (0,0)
        
        _plot_df = pd.concat([_plot_df,_temp_df])
        _plot_df = _plot_df.convert_dtypes()
        _plot_df.reset_index(drop=True,inplace=True)
        continue
        
    for nuc in df['nucleotide'].unique():
        _temp_df = pd.DataFrame(data=[df[df['nucleotide']==nuc].filter(regex=(protein+'_'),axis=1).xs('colocalization',level='properties',axis=1).notnull().sum().sum()
                    /df[df['nucleotide']==nuc]['number_'+protein.lower()].sum()])
        _temp_df.columns = ['probability']
        _temp_df['protein'] = protein
        _temp_df['nucleotide'] = nuc
        
        # bootstrapping
        not_null_count = int(df[df['nucleotide']==nuc].filter(regex=(protein+'_'),axis=1).xs('colocalization',level='properties',axis=1).notnull().sum().sum())
        total_count = int(df[df['nucleotide']==nuc]['number_'+protein.lower()].sum())
        
        _temp_df['nobs'] = total_count
        # generate list with 1 for colocalization and 0 for no colocalization
        bootstrap_data = ([0 for _ in range(total_count - not_null_count)] +
                          [1 for _ in range(not_null_count)])
        
        bootstrap_means = bootstrap(bootstrap_data,n_boot=10000)
        _temp_df['bs_mean'] = np.mean(bootstrap_means)
        _temp_df['standard_error'] = np.std(bootstrap_means)
        _temp_df['68_ci_lower'], _temp_df['68_ci_upper'] = calc_ci(bootstrap_means,ci=68)
        _temp_df['95_ci_lower'], _temp_df['95_ci_upper'] = calc_ci(bootstrap_means,ci=95)
        
        _plot_df = pd.concat([_plot_df,_temp_df])
        _plot_df = _plot_df.convert_dtypes()
        _plot_df.reset_index(drop=True,inplace=True)
_plot_df['condition'] = _plot_df['protein'] +'-'+ _plot_df['nucleotide']
_plot_df
fig,axes = plt.subplots(figsize=(1,1.7))

sns.barplot(x='condition',y='probability',data=_plot_df, lw=0.5, edgecolor='.15', 
            palette=[palettes['MCM'][1],palettes['OCCM'][1],'k',palettes['ORC'][1],palettes['ORC'][3]],
            ax=axes)

plt.errorbar(x='condition',y='probability',data=_plot_df, yerr='standard_error',fmt='none',
             ecolor='.15', elinewidth=0.5, capsize=2, capthick=0.5, capstyle='round')

# number of observations
nobs = _plot_df['nobs']
nobs = [str(x) for x in nobs]
nobs = ["n = " + i for i in nobs]

#put nobs into plot
pos = range(len(nobs))
for tick,label in zip(pos,axes.get_xticklabels()):
    axes.text(pos[tick], 0.85, nobs[tick], rotation=90,
    horizontalalignment='center',verticalalignment='bottom')

axes.set_xlabel('Nucleotide')
axes.set_ylabel('Probability')
axes.set_xlim(-0.5,4.5)
axes.set_ylim(0,1)
axes.set_xticklabels(['ATP','ATPgS','','ATP','ATPgS'],rotation=45,)

sns.despine()

#fig.tight_layout()

plt.savefig(dir_out+"S1F_ORC_MCM_colocalization.svg",transparent=True)<jupyter_output><empty_output><jupyter_text>Figure S1G: 1ORC-6MCM bleaching trajectory<jupyter_code>fig,axes=plt.subplots(figsize=(2,2))

# find molecule
for archive in DnaMoleculeArchive.instances:
        try:
            molecule = archive.get_molecule_by_uid('mJsocffox2tFJxP6NXcwF9')
            break
        except IndexError:
            continue

    
sns.lineplot(x='MCM_1_Time (s)', y='MCM_1_Intensity',data=molecule.df,
             ax=axes,color=palettes['MCM'][1],lw=0.5)
sns.lineplot(x='ORC_1_Time (s)', y='ORC_1_Intensity',data=molecule.df,
             ax=axes,color=palettes['ORC'][1],lw=0.5)

for seg_df in molecule.seg_dfs:
    if seg_df.prefix == 'MCM_1_':
        for row in seg_df.df.index:
            temp_df = pd.DataFrame(data=[seg_df.df.loc[row,['x1','y1']].values, seg_df.df.loc[row,['x2','y2']].values],columns=['x','y'])
            sns.lineplot(x='x', y='y',data=temp_df,ax=axes,color='.15',lw=1)
        break

for seg_df in molecule.seg_dfs:
    if seg_df.prefix == 'ORC_1_':
        for row in seg_df.df.index:
            temp_df = pd.DataFrame(data=[seg_df.df.loc[row,['x1','y1']].values, seg_df.df.loc[row,['x2','y2']].values],columns=['x','y'])
            sns.lineplot(x='x', y='y',data=temp_df,ax=axes,color='.15',lw=1)
        break
    
       
fig.text(0.5, 0.04, 'Time (s)', ha='center')
fig.text(0.04, 0.5, 'Fluorescence (AU)', va='center', rotation='vertical')
        


axes.set_xlabel(None)
axes.set_ylabel(None)


#plt.xticks([0,200,400,600])
#plt.yticks([0,20000,40000,60000])
plt.xlim(0,400)
#plt.ylim([-3000,60000])
plt.ticklabel_format(axis="y", style="sci",scilimits=(4,4))
#fig.suptitle('Photobleaching confirms MCM DH formation')

sns.despine(trim=True)

fig.tight_layout(rect=[0.05, 0.05, 0.95, 0.95])

plt.savefig(dir_out+"S1G_ORC_6MCM_bleaching_example.svg",transparent=True)<jupyter_output><empty_output><jupyter_text>Figure S1H: ORC-MCM bleaching correlation<jupyter_code>#setup two dataframes for coloc bleaching analysis
df_coloc_mcm = pd.DataFrame(columns= ['MCM','ORC','nucleotide','uid'])
df_coloc_mcm
#this fills a dataframe containing all MCM bleaching steps and bleaching steps of colocalizing ORC if applicable

for prefix in {prefix for prefix in archive.prefixes for archive in DnaMoleculeArchive.instances}:
    #looping through all MCM
    if 'MCM' in prefix:
        #looping through all rows
        for row in df.index:
            #check if there is a valid MCM bleaching step
            if df.loc[row,prefix]['bleaching_steps'] > 0:
                try:
                    num_orc = df.loc[row,df.loc[row,prefix]['colocalization']]['bleaching_steps']
                except KeyError:
                    num_orc = 0
                    
                df_coloc_mcm = df_coloc_mcm.append({'MCM':df.loc[row,prefix]['bleaching_steps'],
                                            'ORC':num_orc,
                                            'nucleotide':df.loc[row,'nucleotide'][0],
                                            'uid':row},
                                           ignore_index=True)

df_coloc_mcm = df_coloc_mcm.infer_objects()
# remove events with 3 MCM bleaching in ATPgS condition (n number too low)
df_coloc_mcm = df_coloc_mcm[(df_coloc_mcm['MCM'] < 3) | (df_coloc_mcm['nucleotide'] == 'ATP')]
# correlation (pearson)
df_coloc_mcm[df_coloc_mcm['nucleotide']=='ATP'].corr()
protein = 'MCM'
fig,axes=plt.subplots(figsize=(1.5,2))

sns.barplot(x=df_coloc_mcm['MCM'].apply(int),y='ORC',data=df_coloc_mcm,hue='nucleotide',palette=[palettes['MCM'][1],palettes['OCCM'][1]],
            n_boot=10000, seed=42, ci=68, lw=0.5, edgecolor='.15',
            ax=axes, errwidth=0.5,capsize=0.15,errcolor='.15')
axes.set_xlim(-0.5,5.5)
#axes.set_ylim(0,1.2)
axes.set_yticks([0,0.2,0.4,0.6,0.8,1.0,1.2])
axes.set_xlabel('MCM bleaching steps')
axes.set_ylabel('Average ORC bleaching steps')
# axes.set_title('Avg ORC bleaching vs MCM bleaching')
plt.legend(frameon=False,loc=1)
sns.despine()

axes.text(0.95, 0.75, f"n-ATP = {df_coloc_mcm['nucleotide'].value_counts()['ATP']}",
        verticalalignment='top', horizontalalignment='right',
        transform=axes.transAxes)
axes.text(0.95, 0.65, f"n-ATPgS = {df_coloc_mcm['nucleotide'].value_counts()['ATPgS']}",
        verticalalignment='top', horizontalalignment='right',
        transform=axes.transAxes)

plt.savefig(dir_out+"S1H_AvgORCbleach_vs_MCM_bleach.svg",transparent=True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14965359992984303, 'fraction_numerical': 0.024248004910988337, 'mean_word_length': 3.6252281484485906, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 45, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '14', 'dir': 'jupyter-structured-clean-dedup', 'id': '242440', 'license': 'BSD-2-Clause', 'n_tokens_mistral': 8634, 'n_tokens_neox': 7930, 'n_words': 1096, 'path': 'Analysis_software/Figures_1_S1/Figures_1D+E_S1E-H.ipynb', 'repo_name': 'mjosch/Born-to-slide', 'size': '22806'}