Exemple #1
0
def print_report_from_dirs(extra_dir, intra_dir):
    extra_clu_path = find_file_with_ext(extra_dir,
                                        '.clu.1',
                                        ex_if_not_found=True)
    extra_res_path = find_file_with_ext(extra_dir,
                                        '.res.1',
                                        ex_if_not_found=True)
    intra_res_path = find_file_with_ext(intra_dir,
                                        '.res.1',
                                        ex_if_not_found=True)

    xml_path = find_file_with_ext(extra_dir, '.xml')

    oprint(
        "Comparing extracellular units from res file %s, clu file %s to intracellular unit with time file %s"
        % tuple(
            map(os.path.basename,
                (extra_clu_path, extra_res_path, intra_res_path))))
    from xml.etree.ElementTree import ElementTree
    sample_rate = float(ElementTree().parse(xml_path).find(
        'acquisitionSystem').find('samplingRate').text)

    meas_clu_counts, isect_counts, n_undetected = match_real_to_meas(
        output.read_res(intra_res_path), output.read_res(extra_res_path),
        output.read_clu(extra_clu_path), sample_rate)
    print_report(meas_clu_counts, isect_counts, n_undetected,
                 len(output.read_res(intra_res_path)))
Exemple #2
0
def print_report_from_dirs(extra_dir,intra_dir):
    extra_clu_path = find_file_with_ext(extra_dir,'.clu.1',ex_if_not_found = True)
    extra_res_path = find_file_with_ext(extra_dir,'.res.1',ex_if_not_found = True)
    intra_res_path = find_file_with_ext(intra_dir,'.res.1',ex_if_not_found = True)        

    
    xml_path = find_file_with_ext(extra_dir,'.xml')
    
    
    oprint("Comparing extracellular units from res file %s, clu file %s to intracellular unit with time file %s"
          %tuple(map(os.path.basename,(extra_clu_path,extra_res_path,intra_res_path))))
    from xml.etree.ElementTree import ElementTree
    sample_rate = float(ElementTree().parse(xml_path).find('acquisitionSystem').find('samplingRate').text)
    
    meas_clu_counts,isect_counts,n_undetected = match_real_to_meas(output.read_res(intra_res_path),output.read_res(extra_res_path),
                                                                   output.read_clu(extra_clu_path),sample_rate)
    print_report(meas_clu_counts,isect_counts,n_undetected,len(output.read_res(intra_res_path)))
Exemple #3
0
def print_isect_table_from_dirs(sad_dir,happy_dir):
    rc_path = find_file_with_ext(sad_dir,'.clu.1',ex_if_not_found = True)
    rt_path = find_file_with_ext(sad_dir,'.res.1',ex_if_not_found = True)
    mc_path = find_file_with_ext(happy_dir,'.clu.1',ex_if_not_found = True)
    mt_path = find_file_with_ext(happy_dir,'.res.1',ex_if_not_found = True)        

    
    xml_path1 = find_file_with_ext(happy_dir,'.xml')
    xml_path2 = find_file_with_ext(sad_dir,'.xml')
    xml_path = xml_path1 if xml_path1 else xml_path2    
    
    
    oprint("Comparing cluster file %s with time file %s to cluster file %s with time file %s"
          %map(os.path.basename,(rc_path,rt_path,mc_path,mt_path)))
    from xml.etree.ElementTree import ElementTree
    sample_rate = float(ElementTree().parse(xml_path).find('acquisitionSystem').find('samplingRate').text)
    print_isect_table(output.read_res(rt_path),output.read_clu(rc_path),
                       output.read_res(mt_path),output.read_clu(mc_path),sample_rate)
Exemple #4
0
def print_isect_table_from_dirs(sad_dir, happy_dir):
    rc_path = find_file_with_ext(sad_dir, '.clu.1', ex_if_not_found=True)
    rt_path = find_file_with_ext(sad_dir, '.res.1', ex_if_not_found=True)
    mc_path = find_file_with_ext(happy_dir, '.clu.1', ex_if_not_found=True)
    mt_path = find_file_with_ext(happy_dir, '.res.1', ex_if_not_found=True)

    xml_path1 = find_file_with_ext(happy_dir, '.xml')
    xml_path2 = find_file_with_ext(sad_dir, '.xml')
    xml_path = xml_path1 if xml_path1 else xml_path2

    oprint(
        "Comparing cluster file %s with time file %s to cluster file %s with time file %s"
        % map(os.path.basename, (rc_path, rt_path, mc_path, mt_path)))
    from xml.etree.ElementTree import ElementTree
    sample_rate = float(ElementTree().parse(xml_path).find(
        'acquisitionSystem').find('samplingRate').text)
    print_isect_table(output.read_res(rt_path), output.read_clu(rc_path),
                      output.read_res(mt_path), output.read_clu(mc_path),
                      sample_rate)