Skip to content

Commit

Permalink
Get pheno info
Browse files Browse the repository at this point in the history
  • Loading branch information
anibalsolon committed May 7, 2017
1 parent 2449e94 commit cc28c56
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions pheno_info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Describe phenotypical info
Usage:
pheno_info.py
pheno_info.py (-h | --help)
Options:
-h --help Show this screen
"""

from docopt import docopt
from utils import (load_phenotypes)


if __name__ == "__main__":

arguments = docopt(__doc__)

pheno_path = "./data/phenotypes/Phenotypic_V1_0b_preprocessed1.csv"
pheno = load_phenotypes(pheno_path)

for site, df_site in pheno.groupby("SITE_ID"):
asd = df_site[df_site["DX_GROUP"] == 0]
tc = df_site[df_site["DX_GROUP"] == 1]
fmt = "% 8s & % 8.1f (% 8.1f) & % 8.1f (% 8.1f) & M % 3d, F % 3d & % 8.1f (% 8.1f) & M % 3d, F % 3d \\\\"

print (fmt % (
site,
asd["AGE"].mean(),
asd["AGE"].std(),
asd["ADOS"].mean(),
asd["ADOS"].std(),
int(asd[asd["SEX"] == "M"].shape[0]),
int(asd[asd["SEX"] == "F"].shape[0]),
tc["AGE"].mean(),
tc["AGE"].std(),
int(tc[tc["SEX"] == "M"].shape[0]),
int(tc[tc["SEX"] == "F"].shape[0]),
)).replace(" nan", "$\dag$").replace("_", " ")

0 comments on commit cc28c56

Please sign in to comment.