Module Expr Str Import alias identifier Import alias identifier Import alias identifier Import alias identifier Import alias identifier Import alias identifier Import alias identifier ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assert CompareEq Call NameLoad NameLoad Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr BinOpMult ListLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr For NameStore Call NameLoad NameLoad body Assign AttributeStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign AttributeStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return SubscriptLoad AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore AttributeLoad NameLoad attr Return SubscriptLoad NameLoad Index UnaryOpInvert Call AttributeLoad NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore AttributeLoad NameLoad attr Return SubscriptLoad NameLoad Index UnaryOpInvert Call AttributeLoad NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr keyword TupleLoad Num Num Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Num Num keyword Str keyword Dict Str Str Str Num keyword Str Assign NameStore Num Assign NameStore Num For NameStore Call NameLoad BinOpMult NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad TupleLoad BinOpFloorDiv NameLoad NameLoad BinOpMod NameLoad NameLoad Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr keyword Str keyword Str Expr Call AttributeLoad NameLoad attr keyword ListLoad NameLoad NameLoad keyword Str keyword Num keyword TupleLoad Num Num Num Num keyword AttributeLoad Call AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr keyword Num keyword Num keyword Num keyword Num keyword Num keyword Num decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If BoolOpOr CompareIs NameLoad NameLoad CompareIs NameLoad NameLoad body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Return Assert CompareEq AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Return AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign NameStore AttributeLoad NameLoad attr If Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr body If BoolOpOr BoolOpAnd NameLoad AttributeLoad NameLoad attr BoolOpAnd UnaryOpInvert NameLoad CompareGt AttributeLoad AttributeLoad NameLoad attr attr Num body Assign AttributeStore NameLoad attr UnaryOpUSub AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr orelse If Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr body If BoolOpOr BoolOpAnd NameLoad AttributeLoad NameLoad attr BoolOpAnd UnaryOpInvert NameLoad CompareGt AttributeLoad AttributeLoad NameLoad attr attr Num body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr BinOpDiv BinOpSub AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body If CompareIs AttributeLoad NameLoad attr NameLoad body Return AttributeLoad NameLoad attr orelse Return AttributeLoad AttributeLoad NameLoad attr attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body If CompareIs AttributeLoad NameLoad attr NameLoad body Return AttributeLoad NameLoad attr orelse Return AttributeLoad AttributeLoad NameLoad attr attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Return AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body If AttributeLoad NameLoad attr body Return AttributeLoad NameLoad attr orelse Assign TupleStore NameStore AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Return AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body If AttributeLoad NameLoad attr body Return AttributeLoad NameLoad attr orelse If UnaryOpNot BoolOpOr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr body Assign TupleStore NameStore AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr orelse Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Assert CompareEq AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Return AttributeLoad AttributeLoad NameLoad attr attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Str decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Str decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Str decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Return AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore BinOpAdd NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad NameLoad NameLoad Assign TupleStore NameStore AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body TryExcept body Return AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign TupleStore AttributeStore NameLoad attr NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Return AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign AttributeStore NameLoad attr BoolOpOr BoolOpAnd AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr BoolOpAnd AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore Str orelse Assign NameStore Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Str attr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AugAssignAdd NameStore Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad ListComp SubscriptLoad NameLoad Index Num comprehension NameStore ListLoad NameLoad NameLoad Assign NameStore Call NameLoad ListComp SubscriptLoad NameLoad Index Num comprehension NameStore ListLoad NameLoad NameLoad If CompareLtE AttributeLoad NameLoad attr Num body Assign NameStore TupleLoad Num Num Num orelse If CompareLtE AttributeLoad NameLoad attr Num body Assign NameStore TupleLoad Num Num Num orelse If CompareLtE AttributeLoad NameLoad attr Num body Assign NameStore TupleLoad Num Num Num orelse If CompareLtE AttributeLoad NameLoad attr Num body Assign NameStore TupleLoad Num Num Num orelse Assign NameStore TupleLoad Num Num Num Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr NameLoad Num If NameLoad body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad Call NameLoad NameLoad Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword Dict Str Str SubscriptLoad NameLoad Slice NameLoad SubscriptLoad NameLoad Slice NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword Str keyword Str keyword NameLoad keyword Str keyword AttributeLoad AttributeLoad NameLoad attr attr keyword Str Expr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr keyword Num orelse Expr Call AttributeLoad NameLoad attr keyword Str keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword Num keyword Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword Num keyword Str keyword Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword Num Expr Call AttributeLoad NameLoad attr Str keyword Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Num Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr NameLoad Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr NameLoad Expr Call AttributeLoad Call AttributeLoad NameLoad attr attr Expr Call AttributeLoad Call AttributeLoad NameLoad attr attr If NameLoad body Expr Call AttributeLoad NameLoad attr keyword ListLoad NameLoad NameLoad keyword ListLoad Str Str keyword Str keyword Num decorator_list decorator_list
N/A N/A 
manager.py

Classes
-----------------------
StatisticsManager
WormStatistics

Notes
-----------------------
A translation of Matlab code written by Jim Hokanson,
in the SegwormMatlabClasses GitHub repo.

 N/A numpy np N/A scipy sp N/A matplotlib.pyplot plt N/A matplotlib.patches mpatches N/A matplotlib mpl N/A seaborn sns N/A pandas pd N/A utils histogram Histogram StatisticsManager N/A object N/A N/A 
    A class that encapsulates a statistical comparison between two
    arrays of histograms, experiment histograms and control histograms.

    This class stores WormStatistics objects for each of the 726 features,
    and some shared statistical properties.

    Attributes
    ---------------------------------------
    worm_statistics_objects: numpy array of WormStatistics objects
        one object for each of 726 features
    min_p_wilcoxon: float
        minimum p_wilcoxon from all objects in worm_statistics_objects
    min_q_wilcoxon: float
        minimum q_wilcoxon from all objects in worm_statistics_objects

    (HELPER ATTRIBUTES:)
    valid_p_studentst_array: numpy array
        each non-null p_studentst from worm_statistics_objects
    valid_p_wilcoxon_array: numpy array
        each non-null p_wilcoxon from worm_statistics_objects
    q_studentst_array: numpy array
        False Discovery Rate (FDR) (i.e. q-values) for p_studentst
    q_wilcoxon_array: numpy array
        False Discovery Rate (FDR) (i.e. q-values) for p_wilcoxon

    Methods
    ---------------------------------------
    __init__
        Initializer
    plot
        Plot the histograms against each other and display statistics

    Notes
    ---------------------------------------
    Formerly seg_worm.stats.manager

     __init__ N/A N/A self exp_histogram_manager ctl_histogram_manager N/A N/A N/A 
        Initializes the Manager class.

        Parameters
        ---------------------------------------
        exp_histogram_manager: HistogramManager object
            Experiment
        ctl_histogram_manager: HistogramManager object
            Control

        Notes
        ---------------------------------------
        Formerly seg_worm.stats.manager.initObject

         N/A N/A N/A len exp_histogram_manager N/A len ctl_histogram_manager N/A num_features N/A len exp_histogram_manager N/A N/A self worm_statistics_objects N/A N/A np array N/A N/A None num_features N/A feature_index N/A range num_features N/A N/A N/A N/A self worm_statistics_objects N/A feature_index N/A WormStatistics N/A exp_histogram_manager N/A feature_index N/A ctl_histogram_manager N/A feature_index N/A N/A self q_studentst_array N/A N/A utils compute_q_values N/A self p_studentst_array N/A N/A self q_wilcoxon_array N/A N/A utils compute_q_values N/A self p_wilcoxon_array N/A feature_index N/A range num_features N/A N/A N/A N/A N/A self worm_statistics_objects N/A feature_index q_studentst N/A N/A self q_studentst_array N/A feature_index N/A N/A N/A N/A self worm_statistics_objects N/A feature_index q_wilcoxon N/A N/A self q_wilcoxon_array N/A feature_index N/A __getitem__ N/A N/A self index N/A N/A N/A N/A N/A self worm_statistics_objects N/A index N/A p_studentst_array N/A N/A self N/A N/A N/A N/A N/A np array N/A N/A x p_studentst N/A x N/A self worm_statistics_objects N/A property p_wilcoxon_array N/A N/A self N/A N/A N/A N/A N/A np array N/A N/A x p_wilcoxon N/A x N/A self worm_statistics_objects N/A property valid_p_studentst_array N/A N/A self N/A N/A N/A p_studentst_array N/A self p_studentst_array N/A N/A p_studentst_array N/A N/A N/A N/A np isnan p_studentst_array N/A property valid_p_wilcoxon_array N/A N/A self N/A N/A N/A p_wilcoxon_array N/A self p_wilcoxon_array N/A N/A p_wilcoxon_array N/A N/A N/A N/A np isnan p_wilcoxon_array N/A property min_p_wilcoxon N/A N/A self N/A N/A N/A N/A N/A np nanmin N/A self p_wilcoxon_array N/A property min_q_wilcoxon N/A N/A self N/A N/A N/A N/A N/A np nanmin N/A self q_wilcoxon_array N/A property __repr__ N/A N/A self N/A N/A N/A N/A N/A utils print_object self N/A plot N/A N/A self N/A N/A N/A fig N/A N/A plt figure figsize N/A 12 9 N/A N/A N/A fig suptitle Histogram Plots for all Features N/A N/A N/A fig text 1 1 s SUBTITLE fontdict N/A weight size bold 8 horizontalalignment center N/A rows 5 N/A cols 4 N/A i N/A range N/A rows cols N/A N/A ax N/A N/A plt subplot2grid N/A rows cols N/A N/A i cols N/A i cols N/A N/A N/A N/A N/A self worm_statistics_objects N/A i plot ax N/A green_patch N/A N/A mpatches Patch color g label Experiment N/A grey_patch N/A N/A mpatches Patch color 0.85 label Control N/A N/A N/A plt legend handles N/A green_patch grey_patch loc upper left fontsize 12 bbox_to_anchor N/A 0 -0.1 1 1 bbox_transform N/A N/A N/A plt gcf transFigure N/A N/A N/A plt subplots_adjust left 0.125 right 0.9 bottom 0.1 top 0.9 wspace 0.8 hspace 0.6 N/A N/A WormStatistics N/A object N/A N/A 
    WormStatistics class.  Statistical comparison of two MergedHistogram
    objects.

    Attributes
    --------------------
    exp_histogram  (the underlying histogram)
    ctl_histogram  (the underlying histogram)

    z_score_experiment: float
    exp_p_normal: float
        Probability of the experiment data given a normality assumption
            (Using Shapiro-Wilk)
    ctl_p_normal: float
        Same as exp_p_normal, but for the control.
    p_wilcoxon: float
        Probability of the data given a null hypothesis that all data are
        drawn from the same distribution (Using Wilcoxon signed-rank test)
    p_studentst: float
        Probability of the data given a null hypothesis that all data are
        drawn from the same distribution (Using Student's t test)

    specs
    histogram_type
    motion_type
    data_type

    Notes
    --------------------
    All attributes are set to np.NaN if one or both of ctl or exp are None.

    Formerly: seg_worm.stats

     __init__ N/A N/A self exp_histogram ctl_histogram USE_OLD_CODE N/A False N/A N/A 
        Initializer for StatisticsManager

        Parameters
        ---------------------
        exp_histogram: MergedHistogram object
            "experiment"
        ctl_histogram: MergedHistogram object
            "control"
        USE_OLD_CODE: bool
            Use old code (i.e. Schafer Lab code)

        Notes
        ------------------
        Formerly:
        seg_worm.stats.initObject(obj,exp_hist,ctl_hist)
        worm2StatsInfo
        "Compute worm statistics information and save it to a file."
        See Also:
        seg_worm.stats.helpers.swtest

         N/A N/A N/A exp_histogram None N/A ctl_histogram None N/A N/A N/A self _z_score_experiment N/A np NaN N/A N/A self _p_wilcoxon N/A np NaN N/A N/A self _p_studentst N/A np NaN N/A N/A self _t_statistic N/A np NaN N/A N/A self _fisher_p N/A np NaN N/A N/A N/A N/A N/A exp_histogram specs name N/A N/A ctl_histogram specs name N/A N/A self exp_histogram exp_histogram N/A N/A self ctl_histogram ctl_histogram N/A N/A self USE_OLD_CODE USE_OLD_CODE N/A z_score_experiment N/A N/A self N/A N/A N/A 
        Calculate the z-score experiment value.

        Returns
        ------------
        float
            the z_score_experiment value

        Notes
        ------------
        This definition is slightly different than the old version,
        but matches the textual description

        TODO: it does in code, but what about in published paper?

        From Nature Methods 2013 Supplemental Description:
        "Measurements exclusively found in the experimental group have
        a zScore of infinity and those found exclusively found in the
        control are -infinity."

         N/A N/A N/A N/A self _z_score_experiment N/A N/A N/A AttributeError N/A N/A USE_OLD_CODE N/A self USE_OLD_CODE N/A N/A N/A np isnan N/A N/A self exp_histogram mean N/A N/A N/A N/A USE_OLD_CODE N/A self is_exclusive N/A N/A USE_OLD_CODE N/A N/A N/A self ctl_histogram num_valid_videos 1 N/A N/A N/A self _z_score_experiment N/A N/A np Inf N/A N/A N/A self z_score_experiment N/A np NaN N/A N/A N/A N/A np isnan N/A N/A self ctl_histogram mean N/A N/A N/A N/A USE_OLD_CODE N/A self is_exclusive N/A N/A USE_OLD_CODE N/A N/A N/A self exp_histogram num_valid_videos 1 N/A N/A N/A self _z_score_experiment N/A np Inf N/A N/A N/A self _z_score_experiment N/A np NaN N/A N/A N/A self _z_score_experiment N/A N/A N/A N/A self exp_histogram mean N/A N/A self ctl_histogram mean N/A N/A self ctl_histogram std N/A N/A self _z_score_experiment N/A property exp_p_normal N/A N/A self N/A N/A N/A N/A N/A self exp_histogram None N/A N/A N/A np NaN N/A N/A N/A N/A self exp_histogram p_normal N/A property ctl_p_normal N/A N/A self N/A N/A N/A N/A N/A self ctl_histogram None N/A N/A N/A np NaN N/A N/A N/A N/A self ctl_histogram p_normal N/A property p_studentst N/A N/A self N/A N/A N/A 
        p-value calculated using the Student's t-test.

        Rules:

        1. If no valid means exist in one, but all exist in the other:
            Use Fisher's exact test.

        2. Otherwise use Student's t-test

        Notes
        ----------
        mattest (bioinformatics toolbox)

        mattest([exp_histogram_manager.mean_per_video]',
                [ctl_histogram_manager.mean_per_video]')
        http://www.mathworks.com/help/bioinfo/ref/mattest.html
        perform an unpaired t-test for differential expression with
        a standard two-tailed and two-sample t-test on every gene in
        DataX and DataY and return a p-value for each gene.
        PValues = mattest(DataX, DataY)
        p_studentst_all is a 726x1 matrix with values between 0 and 1.

        (From SciPy docs:)
        Calculates the T-test for the means of TWO INDEPENDENT samples
        of scores.
        This is a two-sided test for the null hypothesis that 2
        independent samples have identical average (expected) values.
        This test assumes that the populations have identical variances.

         N/A N/A N/A N/A self _p_studentst N/A N/A N/A AttributeError N/A N/A N/A self is_exclusive N/A N/A N/A self fisher_p N/A N/A N/A _ N/A self _p_studentst N/A N/A N/A sp stats ttest_ind N/A N/A self exp_histogram valid_mean_per_video N/A N/A self ctl_histogram valid_mean_per_video N/A N/A self _p_studentst N/A property p_wilcoxon N/A N/A self N/A N/A N/A 
        p-value calculated using the Wilcoxon signed-rank test.

        Rules:

        1. If no valid means exist in one, but all exist in the other:
            Use Fisher's exact test.

        2. If at least one mean exists in both:
            Use the Wilcoxon signed-rank test.

        3. If no valid means exist in either:
            NaN.

         N/A N/A N/A N/A self _p_wilcoxon N/A N/A N/A AttributeError N/A N/A N/A self is_exclusive N/A N/A N/A self fisher_p N/A N/A N/A N/A N/A N/A self exp_histogram no_valid_videos N/A N/A self ctl_histogram no_valid_videos N/A N/A N/A _ N/A self _p_wilcoxon N/A N/A N/A sp stats ranksums N/A N/A self exp_histogram valid_mean_per_video N/A N/A self ctl_histogram valid_mean_per_video N/A N/A N/A self _p_wilcoxon N/A np NaN N/A N/A self _p_wilcoxon N/A property specs N/A N/A self N/A N/A N/A N/A N/A N/A N/A self exp_histogram specs name N/A N/A N/A self ctl_histogram specs name N/A N/A N/A self exp_histogram specs N/A property histogram_type N/A N/A self N/A N/A N/A histogram_type N/A property motion_type N/A N/A self N/A N/A N/A motion_type N/A property data_type N/A N/A self N/A N/A N/A data_type N/A property fisher_p N/A N/A self N/A N/A N/A 
        Return Fisher's exact method

        Notes
        ---------------
        Original Matlab version
        self.p_wilcoxon = seg_worm.stats.helpers.fexact(*params)

         N/A N/A N/A N/A self _fisher_p N/A N/A N/A AttributeError N/A N/A num_exp_videos N/A N/A self exp_histogram num_videos N/A num_ctl_videos N/A N/A self ctl_histogram num_videos N/A num_videos N/A num_exp_videos num_ctl_videos N/A params N/A N/A np array N/A num_exp_videos num_videos num_exp_videos num_exp_videos N/A N/A _ N/A self _fisher_p N/A N/A N/A sp stats fisher_exact params N/A N/A self _fisher_p N/A property t_statistic N/A N/A self N/A N/A N/A N/A N/A N/A self _t_statistic N/A N/A N/A AttributeError N/A N/A N/A N/A self _t_statistic _ N/A N/A N/A sp stats ttest_ind N/A N/A self exp_histogram valid_mean_per_video N/A N/A self ctl_histogram valid_mean_per_video N/A N/A self _t_statistic N/A property is_exclusive N/A N/A self N/A N/A N/A 
        A flag indicating if either experiment has all valid means but
        control has none, or vice versa.

         N/A N/A N/A N/A self _is_exclusive N/A N/A N/A AttributeError N/A N/A N/A self _is_exclusive N/A N/A N/A N/A self exp_histogram no_valid_videos N/A N/A self ctl_histogram all_videos_valid N/A N/A N/A self ctl_histogram no_valid_videos N/A N/A self exp_histogram all_videos_valid N/A N/A self _is_exclusive N/A property __repr__ N/A N/A self N/A N/A N/A N/A N/A utils print_object self N/A plot_title N/A N/A self N/A N/A N/A 
        Return the title for the plot, information about control
        and experiment videos along with with p- and q- values.

         N/A exp_histogram N/A self exp_histogram N/A ctl_histogram N/A self ctl_histogram N/A N/A N/A self data_type all N/A N/A data_type_string N/A N/A data_type_string N/A N/A - {0} format N/A self data_type N/A title N/A N/A {0} - {1}{2} {3}
WORMS = {4} [{5}] \u00A4 SAMPLES = {6:,} [{7:,}]
 format N/A N/A N/A N/A self specs name upper N/A self motion_type data_type_string N/A self histogram_type N/A exp_histogram num_videos N/A ctl_histogram num_videos N/A exp_histogram num_samples N/A ctl_histogram num_samples N/A title N/A N/A ALL = {0:.2f} +/- {1:.2f} <<< [{2:.2f} +/- {3:.2f}] \u00A4 (p={4:.4f}, q={5:.4f}) format N/A exp_histogram mean N/A exp_histogram std N/A ctl_histogram mean N/A ctl_histogram std N/A self p_wilcoxon N/A self q_wilcoxon N/A title N/A property plot N/A N/A self ax use_legend use_alternate_plot N/A False False N/A N/A 
        Use matplotlib to plot the experiment histogram against the control.

        Note: You must still call plt.show() after calling this function.

        Parameters
        -----------
        ax: An matplotlib.axes.Axes object
            The place where the plot occurs.

        Usage example
        -----------------------
        import matplotlib.pyplot as plt

        fig = plt.figure(1)
        ax = fig.gca()
        worm_statistics_object.plot(ax)
        plt.show()

        # A more typical use would be this method being called by
        # a StatisticsManager object.

        Parameters
        -----------------------
        ax: A matplotlib.axes.Axes object
            This is the handle where we'll make the plot
        exp_hist: A Histogram object
            The "experiment"
        ctl_hist: A Histogram object
            The "control"

         N/A ctl_bins N/A N/A self ctl_histogram bin_midpoints N/A ctl_y_values N/A N/A self ctl_histogram pdf N/A exp_bins N/A N/A self exp_histogram bin_midpoints N/A exp_y_values N/A N/A self exp_histogram pdf N/A min_x N/A min N/A N/A h N/A 0 N/A h N/A ctl_bins exp_bins N/A max_x N/A min N/A N/A h N/A -1 N/A h N/A ctl_bins exp_bins N/A N/A N/A self q_wilcoxon 0.0001 N/A N/A bgcolour N/A 229 204 255 N/A N/A N/A N/A self q_wilcoxon 0.001 N/A N/A bgcolour N/A 255 204 204 N/A N/A N/A N/A self q_wilcoxon 0.01 N/A N/A bgcolour N/A 255 229 178 N/A N/A N/A N/A self q_wilcoxon 0.05 N/A N/A bgcolour N/A 255 255 178 N/A N/A bgcolour N/A 255 255 255 N/A bgcolour N/A N/A N/A np array bgcolour 255 N/A use_alternate_plot N/A N/A x N/A N/A self exp_histogram data N/A y N/A N/A self ctl_histogram data N/A truncated_length N/A min N/A len x N/A len y N/A df N/A N/A pd DataFrame data N/A Experiment Control N/A x N/A truncated_length N/A y N/A truncated_length N/A g N/A N/A sns jointplot x Experiment y Control data df kind hex stat_func N/A N/A sp stats wilcoxon color #4CB391 N/A N/A N/A N/A N/A N/A g fig gca set_title N/A self plot_title fontsize 10 N/A N/A N/A N/A plt ticklabel_format style plain useOffset True N/A h1 N/A N/A ax fill_between ctl_bins ctl_y_values alpha 1 color 0.85 label Control N/A h2 N/A N/A ax fill_between exp_bins exp_y_values alpha 0.5 color g label Experiment N/A N/A N/A ax set_axis_bgcolor bgcolour N/A N/A N/A ax set_xlabel N/A N/A N/A self exp_histogram specs units fontsize 10 N/A N/A N/A ax set_ylabel Probability ($\sum P(x)=1$) fontsize 10 N/A N/A N/A N/A ax yaxis set_ticklabels N/A N/A N/A N/A N/A ax yaxis set_ticks N/A N/A N/A N/A ax set_title N/A self plot_title fontsize 10 N/A N/A N/A ax set_xlim min_x max_x N/A N/A N/A N/A N/A ax spines N/A top set_visible False N/A N/A N/A N/A N/A ax spines N/A right set_visible False N/A N/A N/A N/A N/A ax get_xaxis tick_bottom N/A N/A N/A N/A N/A ax get_yaxis tick_left N/A use_legend N/A N/A N/A N/A ax legend handles N/A h1 h2 labels N/A Control Experiment loc upper left fontsize 12 N/A N/A