Skip to content

Commit

Permalink
adjustment to classification functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jgvhabets committed Dec 15, 2020
1 parent a594cb3 commit 7d14bbe
Showing 1 changed file with 94 additions and 18 deletions.
112 changes: 94 additions & 18 deletions code/brady_2020_classification_analyses.ipynb
Expand Up @@ -1617,42 +1617,93 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['090_indiv_SV_allfts_5000perms.csv',\n",
" '.DS_Store',\n",
" 'group_RF_allfts_5000perms.csv',\n",
" '058_indiv_SV_allfts_5000perms.csv',\n",
" '063_indiv_SV_allfts_5000perms.csv',\n",
" '002_043_indiv_SV_allfts_5000perms.csv',\n",
" '065_indiv_SV_allfts_5000perms.csv',\n",
" '051_indiv_SV_allfts_5000perms.csv',\n",
" '047_indiv_SV_allfts_5000perms.csv',\n",
" 'group_RF_allfts_actfilter_5000perms.csv',\n",
" '054_indiv_SV_allfts_5000perms.csv',\n",
" 'indiv_SV_allfts_5000perms.csv',\n",
" '079_indiv_SV_allfts_5000perms.csv']"
"['043_indiv_SV_allfts_actfilter_5000perms.csv',\n",
" '039_indiv_SV_allfts_actfilter_5000perms.csv',\n",
" '002_indiv_SV_allfts_actfilter_5000perms.csv',\n",
" '012_group_SV_allfts_actfilter_5000perms.csv',\n",
" '013_group_SV_allfts_actfilter_5000perms.csv',\n",
" '038_indiv_SV_allfts_actfilter_5000perms.csv',\n",
" '079_indiv_SV_allfts_actfilter_5000perms.csv',\n",
" '014_group_SV_allfts_actfilter_5000perms.csv',\n",
" '047_indiv_SV_allfts_actfilter_5000perms.csv',\n",
" '051_indiv_SV_allfts_actfilter_5000perms.csv',\n",
" '065_indiv_SV_allfts_actfilter_5000perms.csv',\n",
" '024_indiv_SV_allfts_actfilter_5000perms.csv',\n",
" '013_indiv_SV_allfts_actfilter_5000perms.csv',\n",
" '090_indiv_SV_allfts_actfilter_5000perms.csv',\n",
" '012_indiv_SV_allfts_actfilter_5000perms.csv',\n",
" '002_group_SV_allfts_actfilter_5000perms.csv',\n",
" '018_indiv_SV_allfts_actfilter_5000perms.csv',\n",
" '023_indiv_SV_allfts_actfilter_5000perms.csv',\n",
" '017_indiv_SV_allfts_actfilter_5000perms.csv',\n",
" '058_indiv_SV_allfts_actfilter_5000perms.csv',\n",
" '063_indiv_SV_allfts_actfilter_5000perms.csv',\n",
" '015_indiv_SV_allfts_actfilter_5000perms.csv',\n",
" '054_indiv_SV_allfts_actfilter_5000perms.csv',\n",
" '014_indiv_SV_allfts_actfilter_5000perms.csv']"
]
},
"execution_count": 12,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"## ADDING INDIVIDUAL PERMUTATIONS TO GROUP FILE\n",
"\n",
"listdir(os.path.join(path,'results/perms'))"
"listdir(os.path.join(path,'results/perms/temp'))"
]
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 41,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'015',\n",
" '017',\n",
" '018',\n",
" '023',\n",
" '024',\n",
" '038',\n",
" '039',\n",
" '043',\n",
" '047',\n",
" '051',\n",
" '054',\n",
" '058',\n",
" '063',\n",
" '065',\n",
" '079',\n",
" '090'}"
]
},
"execution_count": 41,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\n",
"f = pd.read_csv(os.path.join(path,'results/perms/indiv_SV_4fts_actfilter_5000perms.csv'), index_col=0)\n",
"set([k[:3] for k in f.keys()])\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 44,
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"# main = pd.read_csv(os.path.join(path,'results/perms/002_043_indiv_SV_allfts_5000perms.csv'), index_col=0)\n",
Expand All @@ -1665,7 +1716,32 @@
"# main[col] = temp[col]\n",
"# main.to_csv(os.path.join(path,'results/perms/indiv_SV_allfts_5000perms.csv'), index=True)\n",
"\n",
"\n"
"# model = 'indiv_SV_allfts_actfilter_5000perms'\n",
"# files = listdir(os.path.join(path,'results/perms/temp'))\n",
"# pts = np.sort(list(set([file[:3] for file in files])))\n",
"# first = pd.read_csv(os.path.join(path,'results/perms/temp/002_%s.csv' % model), index_col=0)\n",
"# main = pd.DataFrame(columns=[pt+var[3:] for pt in pts for var in first.keys() ])\n",
"# for file in files:\n",
"# if file[4:-4] == model:\n",
"# dat = pd.read_csv(os.path.join(path,'results/perms/temp/%s' % file), index_col=0)\n",
"# for col in dat.keys():\n",
"# main[col] = dat[col]\n",
"# main.to_csv(os.path.join(path,'results/perms/%s.csv' % model), index=True)\n",
"# main\n",
"\n",
"# ## STILL TO DO: [002-014] for indiv SV 4fts actfilter (now filled with 0.5's)\n",
"# main = pd.read_csv(os.path.join(path,'results/perms/indiv_SV_4fts_actfilter_5000perms.csv'), index_col=0)\n",
"# model = 'indiv_SV_4fts_actfilter_5000perms'\n",
"# pts = set([k[:3] for k in main.keys()])\n",
"# pts_todo = ['002','012','013','014']\n",
"# for pt in pts_todo:\n",
"# dat = pd.read_csv(os.path.join(path,'results/perms/temp/%s_%s.csv' % (pt,model)), index_col=0)\n",
"# for c in dat.keys():\n",
"# main[c] = dat[c]\n",
"# # for col in set([c[3:] for c in main.keys()]):\n",
"# # main[pt+col] = [0.5]*5000\n",
" \n",
"# main.to_csv(os.path.join(path,'results/perms/%s.csv' % model), index=True)\n"
]
}
],
Expand Down

0 comments on commit 7d14bbe

Please sign in to comment.