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

[FIX] ADNI-to-BIDS : incorporate the fix for KeyError "APGEN" #1342

Merged
merged 4 commits into from
Oct 24, 2024
Merged
Changes from 1 commit
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
11 changes: 11 additions & 0 deletions clinica/iotools/bids_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,17 @@ def create_participants_df(
file_to_read = load_clinical_csv(
clinical_data_dir, location.split(".")[0]
)
if location == "APOERES.csv":
AliceJoubert marked this conversation as resolved.
Show resolved Hide resolved
if (
AliceJoubert marked this conversation as resolved.
Show resolved Hide resolved
"APGEN1" not in file_to_read.columns
and "GENOTYPE" in file_to_read.columns
):
# Split the 'GENOTYPE' column into 'APGEN1' and 'APGEN2'
genotype = file_to_read["GENOTYPE"].str.split(
"/", expand=True
)
file_to_read.assign(APGEN1=genotype[0], APGEN2=genotype[1])

prev_location = location
prev_sheet = sheet

Expand Down
Loading