<jupyter_start><jupyter_text>Plot MRT average and two individuals mrt<jupyter_code>f = figure(figsize=(15,7))
f.add_subplot(211)
plot(genomic_position / 1000,data["mean_MRT_normed"])

genomic_position_mrt,MRT = load_data(startp,endp,ch,"MRT")
plot(genomic_position_mrt/1000,MRT,label="Experimental")
legend()

xlabel("Genomic Position (Mb)")
f.add_subplot(212)
plot(genomic_position / 1000,data["mean_MRT_time"]/60,label="Average")

#Plot two individual MRTs
plot(genomic_position / 1000,data["hist_MRT"][0]/60,label="MRT0")
plot(genomic_position / 1000,data["hist_MRT"][1]/60,label="MRT1")
legend(loc="best")
ylabel("time (h)")
xlabel("Genomic Position (Mb)")
f.tight_layout()<jupyter_output><empty_output><jupyter_text>Plot RFD<jupyter_code>f = figure(figsize=(20,5))
plot(genomic_position/1000,data["mean_RFD"])

_,RFD = load_data(startp,endp,ch,"OKSeq")

plot(genomic_position/1000,RFD,label="Experimental")

xlabel("Genomic Position (Mb)")
ylabel("RFD")
f.tight_layout()<jupyter_output><empty_output><jupyter_text>I(t)<jupyter_code>plot(data["time"] / 60,data["It"])
ylabel("/kb/min")
xlabel("time (h)")<jupyter_output><empty_output><jupyter_text>Single mol analysis<jupyter_code>from repli1d.single_mol_analysis import compute_info, compute_real_inter_ori ,compute_mean_activated_ori

#Fiber 
fiber_size= 200 # in kb


# small function to format output
def trunc2(v):
    try:
        return float("%.2e" % v)
    except:
        return v

    
resolution = binsize
Deltas0 = compute_info(Sme=data["single_mol_exp"], size_single_mol=int(fiber_size/resolution), n_sample=200)

Res = {}

Res["Fiber200meaninterdist"] = trunc2(np.mean(np.concatenate(Deltas0["dist_ori"])*resolution))

print("Mean inter ori distance", np.mean(np.concatenate(Deltas0["dist_ori"])*resolution))

Deltas = compute_real_inter_ori(data["position_time_activated_oris"])
print("Mean real inter ori distance", np.mean(Deltas)*resolution)

Res["Realinterdist"] = trunc2(np.mean(Deltas)*resolution)


nfork_per_fiber = np.array([len(di) for di in Deltas0["size_forks"]])
# hist(nfork_per_fiber,range=[0,5],bins=6,normed=True)
for i in range(5):
    print("Nfork %i, percent %.2f" % (i, np.sum(nfork_per_fiber == i)/len(nfork_per_fiber)))

    Res["Fiber200_percent_%i_Forks" % i] = trunc2(np.sum(nfork_per_fiber == i)/len(nfork_per_fiber))

print("Mean number of fork / fiber having forks",
      np.mean(nfork_per_fiber[nfork_per_fiber != 0]))

Res["Nforkperfibrwithfork"] = trunc2(np.mean(nfork_per_fiber[nfork_per_fiber != 0]))<jupyter_output>Mean inter ori distance 86.05721393034825
Mean real inter ori distance 212.97490911682942
Nfork 0, percent 0.63
Nfork 1, percent 0.17
Nfork 2, percent 0.13
Nfork 3, percent 0.02
Nfork 4, percent 0.03
Mean number of fork / fiber having forks 1.912921573339742
{'fraction_non_alphanumeric': 0.1500539762504498, 'fraction_numerical': 0.05433609211946743, 'mean_word_length': 7.910256410256411, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '140924', 'license': 'MIT', 'n_tokens_mistral': 1232, 'n_tokens_neox': 1087, 'n_words': 173, 'path': 'notebook_demo/Typical_sim.ipynb', 'repo_name': 'amir-zeraati/repli1D', 'size': '2779'}