Ejemplo n.º 1
0
if __name__ == '__main__':
    # Make the traits data frame.
    traits_outrm = traits.drop(['Age', 'etiv'], axis=1).apply(qc.remove_outliers)
    traits_outrm['age'] = traits['Age']
    traits_outrm['icv'] = traits['etiv']
    traits1 = traits_outrm

    # Make jobs
    univariates = traits1.columns.tolist()
    univariates.remove('age')
    univariates.remove('icv')

    for trait in univariates:
        make_jobs.make_single_job(
            'asymmetries_mpi', trait, [trait], cov='age sex n_icv', old_peds=False
        )
        for chrom in xrange(1, 23):
            make_jobs.make_single_job(
                'asymmetries_yale_1', '%s_%i' % (trait, chrom), [trait], chrom=chrom
            )
    for structure in structures:
        make_jobs.make_single_job(
            'asymmetries_mpi', 'rhog_' + structure,
            ['Left_%s' % structure, 'Right_%s' % structure],
            cov='age sex n_icv', tests='-testrhog', old_peds=False
        )
        for chrom in xrange(1, 23):
            make_jobs.make_single_job(
                'asymmetries_yale_1', 'rhog_%s_%i' %(structure, chrom),
                ['Left_%s' % struct, 'Right_%s' % struct], tests='-testrhog',
Ejemplo n.º 2
0
cols = [c for c in df.columns if '_tmp' in c and 'bl_' in c]
y= df[cols].sum(axis=1) / df[[c for c in df.columns if '_area' in c and 'bl_' in c and '_p' not in c[-4:] and 'total' not in c]].sum(axis=1)
print y.head()
for region in regions:
    df['bl_%s_thickness_p' % region] = df['bl_%s_thickness_x' % region] - x
cols = [c for c in df.columns if 'thickness_p' in c]
df = df.drop([c for c in df.columns if '_tmp' in c], axis=1)
df['avg_thick'] = x
dont_screen_these = [
    'gcog_vm',
    'gcog_wm',
    'gcog_sm',
    'gcog_ef',
    'gcog_g',
    'bifg_vm',
    'bifg_wm',
    'bifg_sm',
    'bifg_ef',
    'bifg_g',
    'age'
]
for trait in [c for c in df.columns if 'bl_' in c[:3]]:
    make_jobs.make_single_job(
        'braincog',
        trait,
        [trait],
        cov='age^1,2#sex',
        old_peds=False,
        resid=True
    )
df.to_csv(paths.pj(paths.JOBS_DIR, 'braincog', '_traits.csv'), index_label='id')