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

csv2nidm: read tsvs by default #259

Closed
jdkent opened this issue Nov 13, 2020 · 1 comment
Closed

csv2nidm: read tsvs by default #259

jdkent opened this issue Nov 13, 2020 · 1 comment

Comments

@jdkent
Copy link

jdkent commented Nov 13, 2020

I tried running csv2nidm on this tsv file and got the following output:

Variable participant_id age     sex     handedness automatically mapped to participant/subject idenfier
Label: participant_id   age     sex     handedness
Description: subject/participant identifier
Source Variable: participant_id age     sex     handedness
---------------------------------------------------------------------------------------
Creating NIDM file...
1: participant_id       age     sex     handedness
Please select the subject ID field from the list above:

which is not what I want (it's representing all column headers as a single column), but when I converted the file to a csv, csv2nidm worked as expected.
According to the bids specification, phenotypic data should be represented as a tsv, so I think the default behavior of csv2nidm should handle a tsv.

To change this behavior, I believe all that is needed is changing this line

df = pd.read_csv(args.csv_file)

to:

 df = pd.read_csv(args.csv_file, sep='\t')

or maybe some additional logic to try to guess the appropriate separator (or add a command-line option),
Depending on how important it is to not make backward-incompatible changes.

@dbkeator
Copy link
Contributor

This is fixed in release v3.7.4. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants