<s> """<STR_LIT>""" <EOL> import sys <EOL> import os <EOL> import numpy as np <EOL> import pandas as pd <EOL> import matplotlib . pyplot as plt <EOL> sys . path . append ( '<STR_LIT:..>' ) <EOL> import open_worm_analysis_toolbox as mv <EOL> def example_worms ( num_frames = <NUM_LIT:1000> ) : <EOL> """<STR_LIT>""" <EOL> skeleton_x = np . linspace ( <NUM_LIT> , <NUM_LIT> , mv . config . N_POINTS_NORMALIZED ) <EOL> skeleton_y = np . linspace ( <NUM_LIT> , <NUM_LIT> , mv . config . N_POINTS_NORMALIZED ) <EOL> skeleton_frame1 = np . rollaxis ( np . dstack ( [ skeleton_x , <EOL> skeleton_y ] ) , <EOL> axis = <NUM_LIT:0> , start = <NUM_LIT:3> ) <EOL> skeleton = np . repeat ( skeleton_frame1 , num_frames , axis = <NUM_LIT:2> ) <EOL> bw = mv . BasicWorm . from_skeleton_factory ( skeleton ) <EOL> motion_overlay_x = np . linspace ( <NUM_LIT:0> , <NUM_LIT:100> , num_frames ) <EOL> motion_overlay_y = np . linspace ( <NUM_LIT:0> , <NUM_LIT:0> , num_frames ) <EOL> motion_overlay = np . rollaxis ( np . dstack ( [ motion_overlay_x , <EOL> motion_overlay_y ] ) , <EOL> axis = <NUM_LIT:0> , start = <NUM_LIT:3> ) <EOL> return bw <EOL> def main ( ) : <EOL> base_path = os . path . abspath ( mv . user_config . EXAMPLE_DATA_PATH ) <EOL> schafer_bw_file_path = os . path . join ( <EOL> base_path , "<STR_LIT>" ) <EOL> bw = mv . BasicWorm . from_schafer_file_factory ( schafer_bw_file_path ) <EOL> nw = mv . NormalizedWorm . from_BasicWorm_factory ( bw ) <EOL> wf = mv . WormFeaturesDos ( nw ) <EOL> base_path = os . path . abspath ( mv . user_config . EXAMPLE_DATA_PATH ) <EOL> control_path = os . path . join ( base_path , '<STR_LIT>' , '<STR_LIT:R>' ) <EOL> experiment_files = [ wf , wf ] <EOL> control_files = get_matlab_filepaths ( control_path ) <EOL> experiment_histograms = mv . HistogramManager ( experiment_files ) <EOL> control_histograms = mv . HistogramManager ( control_files ) <EOL> experiment_histograms . plot_information ( ) <EOL> stat = mv . StatisticsManager ( experiment_histograms , control_histograms ) <EOL> stat [ <NUM_LIT:0> ] . plot ( ax = None , use_alternate_plot = True ) <EOL> print ( "<STR_LIT>" % <EOL> ( stat . min_p_wilcoxon , stat . min_q_wilcoxon ) ) <EOL> def get_matlab_filepaths ( root_path ) : <EOL> """<STR_LIT>""" <EOL> matlab_filepaths = [ ] <EOL> for root , dirs , files in os . walk ( root_path ) : <EOL> mat_files = [ f for f in files if f [ - <NUM_LIT:4> : ] == '<STR_LIT>' ] <EOL> for f in mat_files : <EOL> matlab_filepaths . append ( os . path . join ( root , f ) ) <EOL> return matlab_filepaths <EOL> def geppetto_to_features ( minimal_worm_spec_path ) : <EOL> pass <EOL> pd . set_option ( '<STR_LIT>' , False ) <EOL> pd . set_option ( '<STR_LIT>' , lambda x : '<STR_LIT>' % x ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> start_time = mv . utils . timing_function ( ) <EOL> main ( ) <EOL> print ( "<STR_LIT>" % <EOL> ( mv . utils . timing_function ( ) - start_time ) ) </s>
