Beispiel #1
0
def iterate_over_queries():
    channel_name = 'ss_PSD.tif'
    query_number = 4
    df_list = iterate_over_mice(query_number, channel_name)
    aa.write_dfs_to_excel(df_list, 'blob_synapse', 'psd_q4_ratio.xlsx')

    channel_name = 'ss_VGluT1.tif'
    query_number = 5
    df_list = iterate_over_mice(query_number, channel_name)
    aa.write_dfs_to_excel(df_list, 'blob_synapse', 'vglut1_q5_ratio.xlsx')

    channel_name = 'ss_Synap.tif'
    query_number = 5
    df_list = iterate_over_mice(query_number, channel_name)
    aa.write_dfs_to_excel(df_list, 'blob_synapse', 'synap_q5_ratio.xlsx')

    channel_name = 'ss_VGluT2.tif'
    query_number = 6
    df_list = iterate_over_mice(query_number, channel_name)
    aa.write_dfs_to_excel(df_list, 'blob_synapse', 'vglut2_q6_ratio.xlsx')

    channel_name = 'ss_Synap.tif'
    query_number = 6
    df_list = iterate_over_mice(query_number, channel_name)
    aa.write_dfs_to_excel(df_list, 'blob_synapse', 'synap_q6_ratio.xlsx')
def main():
    """ Run comparisons """

    VGLUT3_df = VGLUT3()

    sheet_name = '20180424_AT_VGLUT3'
    fn = '20180424_AT_VGLUT3.xlsx'
    df_list = [VGLUT3_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
Beispiel #3
0
def main():
    """ Run comparisons """

    CPU_df = CPU()

    sheet_name = '20180417_AT_CPU'
    fn = '20180417_AT_CPU.xlsx'
    df_list = [CPU_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
def main():
    """ Run comparisons """

    COMP_df = COMP()

    sheet_name = '20180727_Microscope_TBS_NM'
    fn = '20180727_Microscope_TBS_NM.xlsx'
    df_list = [COMP_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
Beispiel #5
0
def main():
    """ Run comparisons """

    NM_Scope_df = NM_Scope()

    sheet_name = 'NM_Scope'
    fn = 'NM_Scope.xlsx'
    df_list = [NM_Scope_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
def main():
    """ Run comparisons """

    SAPAP3_df = SAPAP3()

    sheet_name = '20180320_AT_SAPAP3'
    fn = '20180320_AT_SAPAP3.xlsx'
    df_list = [SAPAP3_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
def main(): #Do not change
    """ Run comparisons """

    NAME_df = Name() #The "NAME" should match the term used in line 13
    
    sheet_name = 'YYYYMMDD_(project title)' #name of excel sheet
    fn = 'YYYMMDD_(project title).xlsx' #name of excel file
    df_list = [NAME_df] # the term inside the brackets must match the _____df in line 155
    aa.write_dfs_to_excel(df_list, sheet_name, fn) #Do not change
def main():
    """ Run comparisons """

    N452_df = N452()

    sheet_name = '20180202_AT_N452'
    fn = '20180202_AT_N452.xlsx'
    df_list = [N452_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
def main():
    """ Run homer comparisons """

    homer_df = homer()

    sheet_name = 'Homer-L113'
    fn = 'Homer-L113.xlsx'
    df_list = [homer_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
Beispiel #10
0
def main():
    """ Run comparisons """

    VMAT2_df = VMAT2()

    sheet_name = '20180627_N449_VMAT2_Parent'
    fn = '20180627_N449_VMAT2_Parent.xlsx'
    df_list = [VMAT2_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
def main():
    """ Run comparisons """

    VIP_df = VIP()

    sheet_name = '20180316_AT_VIP'
    fn = '20180316_AT_VIP.xlsx'
    df_list = [VIP_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
Beispiel #12
0
def main():
    """ Run comparisons """

    GABRA4_df = GABRA4()

    sheet_name = '20180524_N398A_GABRA4'
    fn = '20180524_N398A_GABRA4.xlsx'
    df_list = [GABRA4_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
Beispiel #13
0
def main():
    """ Run comparisons """

    BASSOON_df = BASSOON()

    sheet_name = '20180607_L124_Isotype'
    fn = '20180607_L124_Isotype.xlsx'
    df_list = [BASSOON_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
Beispiel #14
0
def main():
    """ Run comparisons """

    N39B_df = N39B()

    sheet_name = '20180609_N39_N416_N59'
    fn = '220180609_N39_N416_N59.xlsx'
    df_list = [N39B_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
Beispiel #15
0
def main():
    """ Run comparisons """

    SYN3_df = SYN3()

    sheet_name = '20180124_AT_SYN3_Hip'
    fn = '20180124_AT_SYN3_Hip.xlsx'
    df_list = [SYN3_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
Beispiel #16
0
def main():
    """ Run comparisons """

    cck_df = cask()
    
    sheet_name = 'cask-K56A'
    fn = 'cask-K56A-1,2.xlsx'
    df_list = [cck_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
def main():
    """ Run comparisons """

    ISOTYPE_df = ISOTYPE()

    sheet_name = '20180620_L106_ISOTYPE'
    fn = '20180620_L106_ISOTYPE.xlsx'
    df_list = [ISOTYPE_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
Beispiel #18
0
def main():
    """ Run comparisons """

    validation_df = validation()

    sheet_name = 'validation-cortex-6'
    fn = 'validation-cortex-6.xlsx'
    df_list = [validation_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
Beispiel #19
0
def main():
    """ Run comparisons """

    SHANK1_df = SHANK1()

    sheet_name = '20180216_AT_SHANK1'
    fn = '20180216_AT_SHANK1.xlsx'
    df_list = [SHANK1_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
def main():
    """ Run comparisons """

    MULTI_df = MULTI()

    sheet_name = '20180516_N39B_N50_N422_N23B'
    fn = '20180516_N39B_N50_N422_N23B.xlsx'
    df_list = [MULTI_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
def main():
    """ Run homer comparisons """

    mitochrondia_170906_df = mitochrondia_170906()

    sheet_name = 'mitochrondia_170906'
    fn = 'mitochrondia_170906.xlsx'
    df_list = [mitochrondia_170906_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
def main():
    """ Run homer comparisons """

    isotype_specific_df = isotype_specific()

    sheet_name = 'isotype_specific'
    fn = 'isotype_specific.xlsx'
    df_list = [isotype_specific_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
def main():
    """Run pairwise comparisons and save to an excel file"""

    cav31_dflist = cav31_pairwise()
    gephyrin_dflist = gephyrin_pairwise()
    synapsin_dflist = synapsin_pairwise()
    psd_dflist = psd95_pairwise()
    vglut1_dflist = vglut1_pairwise()

    sheet_name = 'Pairwise'
    fn = 'pairwise_comparisons2.xlsx'
    df_list = synapsin_dflist + vglut1_dflist + psd_dflist + gephyrin_dflist + cav31_dflist
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
Beispiel #24
0
def main():
    """ Run concentration comparisons """

    synapsin_df = synapsin_concentrations()
    glur1_df = glur1_concentrations()
    glur2_df = glur2_concentrations()
    glur3_df = glur3_concentrations()
    nr1_df = nr1_concentrations()

    sheet_name = 'Concentration'
    fn = 'concentration_comparisons.xlsx'
    df_list = [synapsin_df, glur1_df, glur2_df, glur3_df, nr1_df]
    #df_list = [nr1_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
Beispiel #25
0
def main():
    """Run pairwise comparisons and save to an excel file"""

    gephyrin_df = gephyrin_pairwise()
    cav31_df = cav31_pairwise()
    synapsin_df = synapsin_pairwise()
    psd_df = psd95_pairwise()
    vglut1_df = vglut1_pairwise()


    sheet_name = 'Pairwise'
    fn = 'pairwise_comparisons.xlsx'
    df_list = [synapsin_df, vglut1_df, psd_df, gephyrin_df, cav31_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
def main():
    # Output filename
    fn = 'sact_psd_example.xlsx'
    sheet_name = 'sact_psd_example'

    # Determine if file exists. This is only an issue when running on windows
    if os.path.isfile(fn):
        print('A sheet with this name already exists; rename sheet and rerun')
        if socket.gethostname() != 'anish':  #this line is optional
            sys.exit()

    psd_df = psd_pairwise_comparison()
    df_list = [psd_df]

    # Export the dataframe to excel
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
Beispiel #27
0
def main():
    """ Run concentration comparisons """

    bassoon_psd_21_df = bassoon_L170921_psd_multipleclones()
    bassoon_vglut1_21_df = bassoon_L170921_vglut1_multipleclones()

    bassoon_20 = bassoon_L170920_multipleclones()
    irsp53_df = irsp53_lowicryl_multipleclones()
    homer_df = homer_multipleclones()
    vgat_df = VGAT_LRWhite_multipleclones()
    collybistin_df = collybistin_multipleclones()
    gephyrin_df = gephyrin_multipleclones()

    irsp53_3_df = irsp53_lowicryl_multipleclones3()
    basson_3_21_df = bassoon_L170921_multipleclones3()

    sheet_name = 'Multipleclones'
    fn = 'multipleclones.xlsx'
    df_list = [gephyrin_df, homer_df, irsp53_df, vgat_df, collybistin_df,
               bassoon_20, bassoon_vglut1_21_df, bassoon_psd_21_df, basson_3_21_df, irsp53_3_df]
               
    aa.write_dfs_to_excel(df_list, sheet_name, fn)
Beispiel #28
0
def write_df(vol_name_list, signal_list, output_fn):
    """Save signal measurement results as a df

    Paramters
    ---------------
    vol_name_list : list of strs 
    signal_list : list of floats 
    output_fn : str - output filename

    Return
    ----------------
    df : dataframe
    """

    column_labels = ['YFP Size']
    df = pd.DataFrame(np.nan, index=vol_name_list, columns=column_labels)

    df.iloc[:, 0] = signal_list
    sheet_name = 'YFP Size'
    df_list = [df]

    aa.write_dfs_to_excel(df_list, sheet_name, output_fn)

    return df
Beispiel #29
0
def run_list_of_queries(mouse_number, mouse_project_str, sheet_name):
    """
    run queries in a parallel manner

    Parameters
    -----------------
    mouse_number : int 
    mouse_project_str : str
    sheet_name : str 

    """

    output_foldername = 'results_' + sheet_name
    query_fn = 'queries/' + mouse_project_str + '_queries.json'
    data_location = '/Users/anish/Documents/yi_mice/' + \
        str(mouse_number) + 'ss_stacks/'

    hostname = socket.gethostname()
    if hostname == 'Galicia':
        data_location = '/data5TB/yi_mice/' + str(mouse_number) + 'ss_stacks'
        dapi_mask_str_base = '/data5TB/yi_mice/dapi-masks/' + \
            str(mouse_number) + 'ss_stacks'

    print('Query Filename: ', query_fn)
    print('Data Location: ', data_location)
    print('OutputFoldername: ', output_foldername)
    print('Sheetname: ', sheet_name)

    listOfQueries = syn.loadQueriesJSON(query_fn)
    resolution = {'res_xy_nm': 100, 'res_z_nm': 70}
    region_name_base = 'F00'
    thresh = 0.9

    result_list = []
    num_workers = mp.cpu_count() - 1

    print(num_workers)
    pool = mp.Pool(num_workers)

    atet_inputs_list = []
    mask_location_str = -1
    queryID = 0
    foldernames = []
    for region_num in range(0, 4):
        region_name = region_name_base + str(region_num)
        data_region_location = os.path.join(data_location, region_name)
        dapi_mask_str = os.path.join(dapi_mask_str_base, region_name)

        for nQuery, query in enumerate(listOfQueries):
            foldername = region_name + '-Q' + str(nQuery)
            foldernames.append(foldername)
            print(foldername)

            mask_location_str = -1
            #dapi_mask_str = -1

            atet_input = {
                'query': query,
                'queryID': queryID,
                'nQuery': nQuery,
                'resolution': resolution,
                'data_region_location': data_region_location,
                'data_location': data_location,
                'output_foldername': output_foldername,
                'region_name': region_name,
                'mask_str': mask_location_str,
                'dapi_mask_str': dapi_mask_str,
                'mouse_number': mouse_number
            }
            atet_inputs_list.append(atet_input)

            queryID = queryID + 1

    # Run processes
    result_list = pool.map(sa.run_synapse_detection, atet_inputs_list)

    pool.close()
    pool.join()

    print('Get process results from the output queue')
    sorted_queryresult = sa.organize_result_lists(result_list)

    mouse_df = sa.create_synapse_df(sorted_queryresult, foldernames)
    print(mouse_df)

    fn = sheet_name + '.xlsx'
    df_list = [mouse_df]
    aa.write_dfs_to_excel(df_list, sheet_name, fn)