예제 #1
0
def analyze_allometry_slm(output_dir, log_file, slm_handling, slm, args):
    curves_processor = common.get_processor(output_dir, log_file, args.verbose,
                                            False)
    curves_processor.preprocess_curves(slm, True)
    curves_processor.analyze_allometry(output_dir,
                                       output_dir,
                                       slm_handling=slm_handling)
예제 #2
0
def compute_means(slm, output_dir, log_file, slm_handling, args):
    curves_processor = common.get_processor(output_dir, log_file, args.verbose)
    logging.info('Preprocess curves')
    curves_processor.preprocess_curves(slm, True)
    logging.info('Analyze variability')
    curves_processor.analyze_variability(output_dir,
                                         output_dir,
                                         slm_handling=slm_handling)
예제 #3
0
def generate_loading_visualization(input_dir, output_dir, log_file):
    curves_processor = common.get_processor(input_dir, log_file)
    common.mkdir_if_not_exist(output_dir)
    for i in range(curves_processor.get_groups_count() - 1):
        curves_processor.visualize_loadings(input_dir,
                                            output_dir,
                                            opts=get_vis_opts(
                                                output_dir, [0.03, 0.1], i))
예제 #4
0
def generate_means_visualization(input_dir, output_dir, log_file, args):
    curves_processor = common.get_processor(input_dir, log_file)
    common.mkdir_if_not_exist(output_dir)

    logging.info('Visualize all means')
    curves_processor.visualize_means(input_dir,
                                     opts=get_vis_opts(output_dir, 0.03, None))

    groups_count = curves_processor.get_groups_count()
    females_shift = int(groups_count / 2)

    logging.info('Visualize group mean diffs to all mean')
    for i in range(groups_count):
        curves_processor.visualize_mean_difference(
            input_dir,
            opts=get_vis_opts(output_dir, [0.03, 0.10], [[groups_count, i]],
                              groups_count))

    logging.info('Visualize subsequent means diffs')
    for sex_name, sex_shift in dict(male=0, female=females_shift).items():
        logging.info('Visualize subsequent means diffs for %s' % sex_name)
        for i in range(sex_shift, sex_shift + females_shift - 1):
            curves_processor.visualize_mean_difference(
                input_dir,
                opts=get_vis_opts(output_dir, [0.03, 0.10], [[i, i + 1]],
                                  groups_count))

    logging.info('Visualize 0-3, 3-6, 0-6')
    for sex_shift in (0, females_shift):
        for groups in ([0, 3], [3, 6], [0, 6]):
            curves_processor.visualize_mean_difference(
                input_dir,
                opts=get_vis_opts(
                    output_dir, [0.03, 0.10],
                    [[sex_shift + groups[0], sex_shift + groups[1]]]))

    logging.info('Visualize sex diffs for 3, 5')
    for group in (3, 5):
        curves_processor.visualize_mean_difference(
            input_dir,
            opts=get_vis_opts(output_dir, [0.03, 0.10],
                              [[group, females_shift + group]]))
예제 #5
0
def analyze_io_error_slm(slm, data_dir, output_dir, log_file):
    curves_processor = common.get_processor(data_dir, log_file)
    curves_processor.preprocess_curves(slm, True)
    curves_processor.analyze_io_error(data_dir,
                                      common.mkdir_if_not_exist(output_dir))
예제 #6
0
def compute_variability(slm, output_dir, log_file, slm_handling):
    curves_processor = common.get_processor(output_dir, log_file)
    curves_processor.preprocess_curves(slm, True)
    curves_processor.analyze_variability(output_dir,
                                         output_dir,
                                         slm_handling=slm_handling)
예제 #7
0
#!/usr/bin/python3

import os

from projects.tibiacurve import common
from base import rscriptsupport

OUTPUT_DIR = os.path.join(common.TARGET_ROOT,
                          'TIBIA/CURVATURE/results/length_analysis')
OUTPUT_LOG = 'output.txt'

curves_processor = common.get_processor(OUTPUT_DIR, OUTPUT_LOG)
curves, names = curves_processor.load_all_curves(None)

curves_lengths = curves_processor.measure_length(curves)
rscript = rscriptsupport.RScripInterface(OUTPUT_DIR)
rscript.write_csv('curves_lengths.csv', curves_lengths)

curves_processor.length_analysis(OUTPUT_DIR)