<jupyter_start><jupyter_text>RELEVANT PART OF JUPYTER NOTEBOOK STARTS HERE<jupyter_code>new_df['deltaSHAPE_confirmed_rep1'] = 0

data = pd.read_csv('../../../deltaSHAPE_confirmed_sites/deltaSHAPE_rep1.igv',sep="\t",index_col=0)
data=data.reset_index()

for j in data.index:
    
    start = int(data.loc[j,"Start"])          
    end = int(data.loc[j,"End"])
    coordinates = np.arange(start,end+1)
    new_df.loc[coordinates,'deltaSHAPE_confirmed_rep1'] = 1
    

print(new_df)

new_df['deltaSHAPE_confirmed_rep2'] = 0

data = pd.read_csv('../../../deltaSHAPE_confirmed_sites/deltaSHAPE_rep2.igv',sep="\t",index_col=0)
data=data.reset_index()

for j in data.index:
    
    start = int(data.loc[j,"Start"])          
    end = int(data.loc[j,"End"])
    coordinates = np.arange(start,end+1)
    new_df.loc[coordinates,'deltaSHAPE_confirmed_rep2'] = 1
    

print(new_df)

df_1 = pd.read_csv("../../../Xist in vivo vs. ex vivo scaled by dc_diff_BUM_HMM_analysis.txt",sep="\t")
#Select columns
df_1 = df_1[['UM','MU']]

#Rename columns
df_1.columns = ['diffBUMHMM_ex_vivo', 'diffBUMHMM_in_cell']
new_df ["diffBUMHMM_in_cell"] = 0
new_df ['diffBUMHMM_ex_vivo'] = 0

new_df["diffBUMHMM_in_cell"].loc[df_1.index] = df_1["diffBUMHMM_in_cell"]
new_df['diffBUMHMM_ex_vivo'].loc[df_1.index] = df_1['diffBUMHMM_ex_vivo']
print(new_df)
exvivodiffbumhmm = new_df[new_df.diffBUMHMM_ex_vivo > 0.9]
incelldiffbumhmm = new_df[new_df.diffBUMHMM_in_cell > 0.9]
print(exvivodiffbumhmm)
print(exvivodiffbumhmm.columns)
counter = 0
counter2 = 0
for index, row in new_df.iterrows():
    if row['deltaSHAPE_confirmed_rep1'] > 0.0:
        counter = counter+1    
    elif row['deltaSHAPE_confirmed_rep2'] > 0.0:
        counter2= counter2 +1
    else:
        continue
        
print(" total number of dSHAPE confirmed site in rep 1   %s" % counter)
print(" total number of dSHAPE confirmed site in rep 2    %s" % counter2)
#Numbrt of deltaSHAPE confirmed sites that correpsond to positions
#with diffBUMHMM posterior probability higher than 0.9 for ex vivo

detected_deltashape_rep1_exvivodiffbumhmm= exvivodiffbumhmm['deltaSHAPE_confirmed_rep1'].sum()
detected_deltashape_rep2_exvivodiffbumhmm= exvivodiffbumhmm['deltaSHAPE_confirmed_rep2'].sum()

#Numbrt of deltaSHAPE confirmed sites that correpsond to positions
#with diffBUMHMM posterior probability higher than 0.9 for incell

detected_deltashape_rep1_incelldiffbumhmm= incelldiffbumhmm['deltaSHAPE_confirmed_rep1'].sum()
detected_deltashape_rep2_incelldiffbumhmm= incelldiffbumhmm['deltaSHAPE_confirmed_rep2'].sum()

#Percentage of confirmed deltaSHAPE value predicted by either diffBUM HMM ev v
#print(exvivodiffbumhmm[exvivodiffbumhmm.deltaSHAPE_confirmed_rep1 >0])

perc_rep1=(detected_deltashape_rep1_exvivodiffbumhmm+detected_deltashape_rep1_incelldiffbumhmm)/1066*100

perc_rep2=(detected_deltashape_rep2_exvivodiffbumhmm+detected_deltashape_rep2_incelldiffbumhmm)/989*100


print("Percentage of agreement deltashape rep 1 with diffbumhmm is " + str(perc_rep1))
print("Percentage of agreement deltashape rep 2 with diffbumhmm is " + str(perc_rep2))<jupyter_output>Percentage of agreement deltashape rep 1 with diffbumhmm is 13.03939962476548
Percentage of agreement deltashape rep 2 with diffbumhmm is 17.087967644084934
{'fraction_non_alphanumeric': 0.10848912044131168, 'fraction_numerical': 0.03555010726325467, 'mean_word_length': 5.81419624217119, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 9, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '616042', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1349, 'n_tokens_neox': 1253, 'n_words': 226, 'path': 'Jupyter_notebooks/Xist_analysis/Big_dataframe_SHAPEMAP_BED_for_Xist/.ipynb_checkpoints/Computing overlap diffBUMHMM with deltaSHAPE confirmed -checkpoint.ipynb', 'repo_name': 'marangiop/my_binder', 'size': '3263'}