Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNT] Update session column in BIC symlink script #3

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions helper_scripts/symlink_neurobagel_results_on_bic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

# USAGE: ./symlink_neurobagel_results_on_bic.sh <PATH TO NEUROBAGEL QUERY RESULTS TSV> <DESTINATION DIRECTORY FOR SYMLINKS>

# USAGE EXAMPLE: ./symlink_neurobagel_results_on_bic.sh cohort-participant-machine-results.tsv /home/new_neurobagel_cohort
# USAGE EXAMPLE: ./symlink_neurobagel_results_on_bic.sh neurobagel-query-results.tsv /home/new_neurobagel_cohort

RESULTS_TSV=$1
TARGET_DIR=$2

SESSION_PATH_COL="SessionFilePath"
SESSION_PATH_COL_IDX=5
SESSION_PATH_COL="ImagingSessionPath"
SESSION_PATH_COL_IDX=6

# Extract session path column and remove i) the column header, ii) any empty lines, iii) any "protected" lines, and iv) duplicates (just in case)
session_paths=$(cut -d $'\t' -f $SESSION_PATH_COL_IDX $RESULTS_TSV | grep -v "${SESSION_PATH_COL}" | grep -v "^$" | grep -v "protected" | sort | uniq)
Expand Down