Skip to content

Commit

Permalink
BUG: remove invalid trials
Browse files Browse the repository at this point in the history
  • Loading branch information
jungheejung committed Aug 26, 2024
1 parent 7cd3107 commit 6bfcd4b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spacetop_prep/events/bidsify_social_factorize_ENH.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,13 @@ def process_behavioral_data(cue, expect, stim, outcome, beh_df, traj_df, trigger




events = pd.concat([cue, expect, stim, outcome], ignore_index=True)
events_sorted = events.sort_values(by='onset')
events_sorted.fillna('n/a', inplace=True)
if task_name == 'pain':
events_sorted = events_sorted[events_sorted['pain_stimulus_delivery_success'].notna()]

if os.path.exists(beh_savedir) and os.path.isdir(beh_savedir):
events_sorted.to_csv(join(beh_savedir, f"{sub_bids}_{ses_bids}_task-social_acq-mb8_{run_bids}_events.tsv"), sep='\t', index=False)
else:
Expand Down

0 comments on commit 6bfcd4b

Please sign in to comment.