Spaces:
Runtime error
Runtime error
#from turtle import shape | |
import streamlit as st | |
#from st_keyup import st_keyup | |
import pandas as pd | |
import numpy as np | |
from st_aggrid import AgGrid, GridOptionsBuilder,GridUpdateMode,DataReturnMode | |
import os | |
cwd=os.getcwd()+'/'+'data/' | |
#get genes list | |
listA = pd.read_csv(cwd+"20200513_library_1_2_unbalanced_dJR051.csv",index_col=False) | |
listB = pd.read_csv(cwd+"20200513_library_3_4_unbalanced_dJR052.csv",index_col=False) | |
listC = pd.read_csv(cwd+"20200513_library_5_6_unbalanced_dJR053.csv",index_col=False) | |
#variants=listA['sgID_A'].unique() | |
variants=listA['gene'].unique() | |
variants_s=sorted(variants) | |
#Also read LR guides | |
listA_found_ref = pd.read_csv(cwd+"seta_found_ref1.csv",index_col=False) | |
listA_notfound_ref = pd.read_csv(cwd+"seta_notfound_ref1.csv",index_col=False) | |
listA_found_lr = pd.read_csv(cwd+"seta_found_LR1.csv",index_col=False) | |
listA_notfound_lr = pd.read_csv(cwd+"seta_notfound_LR1.csv",index_col=False) | |
st.title('Long Read Guides Search') | |
#st.markdown('**Please select an option from the sidebar**') | |
#st.write(variants) | |
Calc = st.sidebar.radio( | |
"", | |
('ReadME', 'Tools Selection Menu')) | |
if Calc == 'ReadME': | |
#st.markdown("[Introduction](#Introduction)") | |
#st.markdown("[How do base editors work](#How-do-base-editors-work)") | |
expander = st.expander("How to use this app") | |
else: | |
#if Calc == 'Selection Menu': | |
#ReadMe = st.sidebar.checkbox('ReadME',value=False) | |
select_variant = st.sidebar.selectbox( | |
"Please select variant", | |
variants_s | |
) | |
#ref_sgrna=listA[listA['sgID_A']==select_variant][['protospacer_A','protospacer_B']] | |
ref_listA=listA[listA['gene']==select_variant][['guide_type','protospacer_A','protospacer_B','sgID_AB']] | |
#ref_listA=listA[listA['gene']==select_variant] | |
#st.write(ref_listA) | |
ref_listB=listB[listB['gene']==select_variant][['guide_type','protospacer_A','protospacer_B','sgID_AB']] | |
#st.write(ref_listB) | |
ref_listC=listC[listC['gene']==select_variant][['guide_type','protospacer_A','protospacer_B','sgID_AB']] | |
#st.write(ref_listC) | |
#m=pd.merge(ref_listA,ref_listC,ref_listC) | |
listA_concatenated_orig = pd.concat([ref_listA,ref_listB,ref_listC]) | |
st.write('Original Guides (all 6 from 3 sets)') | |
st.write(listA_concatenated_orig) | |
st.write('GRCh38 SetA Guides Found with at most 2 Missmatches') | |
a_ref=ref_listA.sgID_AB.values[0].split('|') | |
#check GRCh38 | |
seta_found0_ref=listA_found_ref[listA_found_ref['gene']==a_ref[0]] | |
seta_found1_ref=listA_found_ref[listA_found_ref['gene']==a_ref[1]] | |
listA_concatenated_found_ref = pd.concat([seta_found0_ref,seta_found1_ref]) | |
st.write(listA_concatenated_found_ref) | |
st.write('LR SetA Guides Found with at most 2 Missmatches') | |
seta_found0_lr=listA_found_lr[listA_found_lr['gene']==a_ref[0]] | |
seta_found1_lr=listA_found_lr[listA_found_lr['gene']==a_ref[1]] | |
listA_concatenated_found_LR = pd.concat([seta_found0_lr,seta_found1_lr]) | |
st.write(listA_concatenated_found_LR) | |
st.write('GRCh38 SetA Guides Not Found') | |
seta_notfound0_ref=listA_notfound_ref[listA_notfound_ref['gene']==a_ref[0]] | |
seta_notfound1_ref=listA_notfound_ref[listA_notfound_ref['gene']==a_ref[1]] | |
listA_concatenated_notfound_ref = pd.concat([seta_notfound0_ref,seta_notfound1_ref]) | |
st.write(listA_concatenated_notfound_ref) | |
st.write('LR SetA Guides Not Found') | |
seta_notfound0_lr=listA_notfound_lr[listA_notfound_lr['gene']==a_ref[0]] | |
seta_notfound1_lr=listA_notfound_lr[listA_notfound_lr['gene']==a_ref[1]] | |
listA_concatenated_notfound_lr = pd.concat([seta_notfound0_lr,seta_notfound1_lr]) | |
st.write(listA_concatenated_notfound_lr) | |
#protospacer_A | |