From 3d7fafba7e041ebf6cdd1600d645cffbad828001 Mon Sep 17 00:00:00 2001 From: jungheejung Date: Sun, 25 Aug 2024 17:44:40 -0400 Subject: [PATCH] BUG: wrong columns for reponse angles --- spacetop_prep/events/bidsify_social_ENH.py | 50 ++++------------------ 1 file changed, 9 insertions(+), 41 deletions(-) diff --git a/spacetop_prep/events/bidsify_social_ENH.py b/spacetop_prep/events/bidsify_social_ENH.py index d6b44c4..7c88d62 100644 --- a/spacetop_prep/events/bidsify_social_ENH.py +++ b/spacetop_prep/events/bidsify_social_ENH.py @@ -490,12 +490,8 @@ def parse_args(): expect['trial_type'] = 'expectrating' expect['trial_index'] = beh_df.index +1 expect['rating_value'] = beh_df['event02_expect_angle'].round(2) - expect['rating_glmslabel'] = expect['rating_value'].apply(categorize_rating) - # expect['rating_glmslabel'] = pd.cut(expect['rating_value'], - # bins=bins, labels=labels, right=True) expect['rating_value_fillna'] = (beh_df['event02_expect_fillna']).round(2) - # expect['rating_glmslabel_fillna'] = pd.cut(expect['rating_value_fillna'], - # bins=bins, labels=labels, right=True) + expect['rating_glmslabel'] = expect['rating_value'].apply(categorize_rating) expect['rating_glmslabel_fillna'] = expect['rating_value_fillna'].apply(categorize_rating) expect['rating_mouseonset'] = (traj_df['expect_motiononset']).round(2) expect['rating_mousedur'] = (traj_df['expect_motiondur']).round(2) @@ -547,13 +543,9 @@ def parse_args(): outcome['trial_type'] = 'outcomerating' outcome['trial_index'] = beh_df.index +1 outcome['rating_value'] = (beh_df['event04_actual_angle']).round(2) - # outcome['rating_glmslabel'] = pd.cut(outcome['rating_value'], - # bins=bins, labels=labels, right=True) - outcome['rating_glmslabel'] = outcome['rating_value'].apply(categorize_rating) outcome['rating_value_fillna'] = beh_df['event04_outcome_fillna'] outcome['rating_glmslabel'] = outcome['rating_value'].apply(categorize_rating) - # outcome['rating_glmslabel_fillna'] = pd.cut(outcome['rating_value_fillna'], - # bins=bins, labels=labels, right=True) + outcome['rating_glmslabel_fillna'] = outcome['rating_value_fillna'].apply(categorize_rating) outcome['rating_mouseonset'] = (traj_df['outcome_motiononset']).round(2) outcome['rating_mousedur'] = (traj_df['outcome_motiondur']).round(2) outcome['cue'] = beh_df['event01_cue_type'] @@ -785,17 +777,10 @@ def parse_args(): expect['run_type'] = task_name expect['trial_type'] = 'expectrating' expect['trial_index'] = beh_df.index +1 - expect['rating_value'] = beh_df['event02_expect_angle'].round(2) - # expect['rating_glmslabel'] = pd.cut(expect['rating_value'], - # bins=bins, labels=labels, right=True) - expect['rating_value_fillna'] = (beh_df['event02_expect_fillna']).round(2) - # expect['rating_glmslabel_fillna'] = pd.cut(expect['rating_value_fillna'], - # bins=bins, labels=labels, right=True) - expect['rating_glmslabel'] = expect['rating_value'].apply(categorize_rating) - # outcome['rating_value_fillna'] = beh_df['event04_outcome_fillna'] expect['rating_glmslabel'] = expect['rating_value'].apply(categorize_rating) + expect['rating_glmslabel_fillna'] = expect['rating_value_fillna'].apply(categorize_rating) expect['rating_mouseonset'] = (traj_df['expect_motiononset']).round(2) expect['rating_mousedur'] = (traj_df['expect_motiondur']).round(2) expect['cue'] = beh_df['event01_cue_type'] # if same as param_cue_type @@ -879,16 +864,10 @@ def parse_args(): outcome['run_type'] = task_name outcome['trial_type'] = 'outcomerating' outcome['trial_index'] = beh_df.index +1 - outcome['rating_value'] = (beh_df['event04_actual_angle']).round(2) - # outcome['rating_glmslabel'] = pd.cut(outcome['rating_value'], - # bins=bins, labels=labels, right=True) - outcome['rating_value_fillna'] = beh_df['event04_outcome_fillna'] - # outcome['rating_glmslabel_fillna'] = pd.cut(outcome['rating_value_fillna'], - # bins=bins, labels=labels, right=True) - - outcome['rating_glmslabel'] = outcome['rating_value'].apply(categorize_rating) - # outcome['rating_value_fillna'] = beh_df['event04_outcome_fillna'] + outcome['rating_value'] = beh_df['event04_actual_angle'].round(2) + outcome['rating_value_fillna'] = (beh_df['event04_outcome_fillna']).round(2) outcome['rating_glmslabel'] = outcome['rating_value'].apply(categorize_rating) + outcome['rating_glmslabel_fillna'] = outcome['rating_value_fillna'].apply(categorize_rating) outcome['rating_mouseonset'] = (traj_df['outcome_motiononset']).round(2) outcome['rating_mousedur'] = (traj_df['outcome_motiondur']).round(2) @@ -1107,15 +1086,10 @@ def parse_args(): expect['trial_index'] = beh_df.index +1 expect['rating_value'] = beh_df['event02_expect_angle'].round(2) - # expect['rating_glmslabel'] = pd.cut(expect['rating_value'], - # bins=bins, labels=labels, right=True) expect['rating_value_fillna'] = (beh_df['event02_expect_fillna']).round(2) - # expect['rating_glmslabel_fillna'] = pd.cut(expect['rating_value_fillna'], - # bins=bins, labels=labels, right=True) - - expect['rating_glmslabel'] = expect['rating_value'].apply(categorize_rating) - # outcome['rating_value_fillna'] = beh_df['event04_outcome_fillna'] expect['rating_glmslabel'] = expect['rating_value'].apply(categorize_rating) + expect['rating_glmslabel_fillna'] = expect['rating_value_fillna'].apply(categorize_rating) + expect['rating_mouseonset'] = (traj_df['expect_motiononset']).round(2) expect['rating_mousedur'] = (traj_df['expect_motiondur']).round(2) expect['cue'] = beh_df['event01_cue_type'] # if same as param_cue_type @@ -1163,15 +1137,9 @@ def parse_args(): outcome['trial_type'] = 'outcomerating' outcome['trial_index'] = beh_df.index +1 outcome['rating_value'] = (beh_df['event04_actual_angle']).round(2) - # outcome['rating_glmslabel'] = pd.cut(outcome['rating_value'], - # bins=bins, labels=labels, right=True) outcome['rating_value_fillna'] = beh_df['event04_outcome_fillna'] - # outcome['rating_glmslabel_fillna'] = pd.cut(outcome['rating_value_fillna'], - # bins=bins, labels=labels, right=True) - - outcome['rating_glmslabel'] = outcome['rating_value'].apply(categorize_rating) - # outcome['rating_value_fillna'] = beh_df['event04_outcome_fillna'] outcome['rating_glmslabel'] = outcome['rating_value'].apply(categorize_rating) + outcome['rating_glmslabel_fillna'] = outcome['rating_value_fillna'].apply(categorize_rating) outcome['rating_mouseonset'] = (traj_df['outcome_motiononset']).round(2) outcome['rating_mousedur'] = (traj_df['outcome_motiondur']).round(2) outcome['cue'] = beh_df['event01_cue_type']