File size: 3,729 Bytes
9ba61b2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#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