def generate_scatter_bokeh(data_dir=op.join('generated', 'data'),
                           output_dir=op.join('generated', 'plots')):
    """Various scatter plots"""

    for atlas, measures in prefixes.items():
        # Generate area vs. thickness plots
        if atlas.lower() == 'destrieux':
            continue

        # Thickness vs. area
        do_scatter(atlas=atlas, prefixes=[op.commonprefix(measures.values())],
                   x_key='%s:AI:mean' % measures['area'],
                   y_key='%s:AI:mean' % measures['thickness'],
                   title="Area vs. thickness",
                   data_dir=data_dir,
                   output_dir=output_dir,
                   output_format='bokeh')

        for measure, prefix in measures.items():
            # Generate scatter plot for given dataset / data point
            do_scatter(atlas=atlas, prefixes=[prefix], x_key='AI:mean',
                       y_key='AI:std', size_key='LH_PLUS_RH:mean',
                       data_dir=data_dir,
                       output_dir=output_dir,
                       output_format='bokeh')
def generate_similarity_bokeh(data_dir=op.join('generated', 'data'),
                              output_dir=op.join('generated', 'plots',
                                                 'similarity')):
    """Asymmetry partial correlation matrix"""

    for atlas, measures in prefixes.items():
        if atlas == 'destrieux':  # skip destrieux
            continue
        for measure, prefix in measures.items():
            # Generate similarity matrix for given dataset / data point
            do_similarity(atlas=atlas, prefixes=[prefix],
                          metric='partial-correlation',
                          measures=['Asymmetry Index'],
                          data_dir=data_dir,
                          output_dir=output_dir, output_format='bokeh')
def generate_multivariate(data_dir=op.join('generated', 'data'),
                          output_dir=op.join('generated', 'data')):
    """PCA overlay for roygbiv"""
    from ping.ping.data import prefixes
    from ping.scripts.multivariate import do_multivariate

    for atlas, measures in prefixes.items():
        if atlas == 'destrieux':  # skip destrieux
            continue
        for measure, prefix in measures.items():
            do_multivariate(prefixes=[prefix], atlas=atlas,
                            data_dir=data_dir,
                            output_dir=op.join(output_dir, 'fsaverage', atlas),
                            output_format='json',
                            verbose=0, pc_thresh=0.05)
def generate_similarity_json(data_dir=op.join('generated', 'data'),
                             output_dir=op.join('generated', 'data')):
    """Asymmetry partial correlation data as json overlay for roygbiv"""
    from ping.ping.data import prefixes
    from ping.scripts.similarity import do_similarity

    for atlas, measures in prefixes.items():
        if atlas == 'destrieux':  # skip destrieux
            continue
        for measure, prefix in measures.items():
            do_similarity(atlas=atlas, prefixes=[prefix],
                          metric='partial-correlation',
                          measures=['Asymmetry Index'],
                          data_dir=data_dir,
                          output_dir=op.join(output_dir, 'fsaverage', atlas),
                          output_format='json')
def generate_regressions(data_dir=op.join('generated', 'data'),
                         output_dir=op.join('generated', 'plots',
                                            'regression')):
    """Regression between age and value, grouped by gender/handedness"""
    from ping.ping.data import prefixes
    from ping.scripts.grouping import do_grouping

    for atlas, measures in prefixes.items():
        if atlas == 'destrieux':  # skip destrieux
            continue
        for measure, prefix in measures.items():
            for grouping_key in ['Gender', 'FDH_23_Handedness_Prtcpnt']:
                do_grouping(prefixes=[prefix], grouping_keys=[grouping_key],
                            xaxis_key='Age_At_IMGExam',
                            plots='regressions', atlas='desikan',
                            data_dir=data_dir,
                            output_dir=output_dir,
                            output_type='matplotlib')