pennbbl / bids-on-flywheel Goto Github PK
View Code? Open in Web Editor NEWA walkthrough on making sure your data is BIDS-compliant on flywheel
License: MIT License
A walkthrough on making sure your data is BIDS-compliant on flywheel
License: MIT License
Hi folks--I ran into the error below when trying to extract a csv of project info using query-bids. I'm using Python 2.7.15rc1 on Ubuntu 18.04.02. The output below says the 5 files in my test project directory have no BIDS information, although I did run the BIDS curation gear on them. Not sure whether this is a software issue or an issue with the project data themselves--I'm happy to provide additional info if helpful.
Thanks,
Jeff
$ query-bids -proj BOLD -out BOLD.csv
Connecting to flywheel server...
Querying server...
Processing acquisitions...
100%|██████████| 1/1 [00:00<00:00, 5.53it/s]
Extracting BIDS and MR Classifier information...
100%|██████████| 5/5 [00:00<00:00, 11.79it/s]
Tidying and returning the results...
0 acquisitions could not be processed.
5 acquisitions do not have BIDS information yet.
Traceback (most recent call last):
File "/home/jeff/.local/bin/query-bids", line 11, in
sys.exit(main())
File "/home/jeff/.local/lib/python2.7/site-packages/flywheel_bids_tools/query_bids.py", line 265, in main
query_result.loc[:, drop_downs] = query_result.loc[:, drop_downs].applymap(unlist_item)
File "/home/jeff/.local/lib/python2.7/site-packages/pandas/core/indexing.py", line 189, in setitem
indexer = self._get_setitem_indexer(key)
File "/home/jeff/.local/lib/python2.7/site-packages/pandas/core/indexing.py", line 167, in _get_setitem_indexer
return self._convert_tuple(key, is_setter=True)
File "/home/jeff/.local/lib/python2.7/site-packages/pandas/core/indexing.py", line 248, in _convert_tuple
idx = self._convert_to_indexer(k, axis=i, is_setter=is_setter)
File "/home/jeff/.local/lib/python2.7/site-packages/pandas/core/indexing.py", line 1354, in _convert_to_indexer
return self._get_listlike_indexer(obj, axis, **kwargs)[1]
File "/home/jeff/.local/lib/python2.7/site-packages/pandas/core/indexing.py", line 1161, in _get_listlike_indexer
raise_missing=raise_missing)
File "/home/jeff/.local/lib/python2.7/site-packages/pandas/core/indexing.py", line 1252, in _validate_read_indexer
raise KeyError("{} not in index".format(not_found))
KeyError: "['classification_Features'] not in index"
I'm trying to identify and fix metadata problems with our legacy data. When trying to upload changes using upload-bids, I get KeyErrors because the "session.label" and "subject.label" fields are not in my csv file. Example error follows.
If I manually add subject.label and session.label to both the original and modified csv files, I then get an exception regarding the info_BIDS_valid column--see the second traceback below. Not sure if this is a problem with my csv files or a code issue, but I'm attaching my modified csv file as a spreadsheet--feedback would be appreciated.
Thanks,
Jeff
##############################
Traceback #1:
$ upload-bids -orig BOLD_20190619.csv -mod BOLD_20190619_mod.csv
Traceback (most recent call last):
File "/usr/local/bin/upload-bids", line 11, in
load_entry_point('flywheel-bids-tools==0.0.11', 'console_scripts', 'upload-bids')()
File "/usr/local/lib/python2.7/site-packages/flywheel_bids_tools/upload_bids.py", line 284, in main
df_original = read_flywheel_csv(args.original)
File "/usr/local/lib/python2.7/site-packages/flywheel_bids_tools/utils.py", line 41, in read_flywheel_csv
df[col] = df[col].astype(str)
File "/usr/local/lib/python2.7/site-packages/pandas/core/frame.py", line 2927, in getitem
indexer = self.columns.get_loc(key)
File "/usr/local/lib/python2.7/site-packages/pandas/core/indexes/base.py", line 2659, in get_loc
return self._engine.get_loc(self._maybe_cast_indexer(key))
File "pandas/_libs/index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'session.label'
##############################
Traceback #2:
$ upload-bids -orig BOLD_20190619.csv -mod BOLD_20190619_mod.csv
Traceback (most recent call last):
File "/usr/local/bin/upload-bids", line 11, in
load_entry_point('flywheel-bids-tools==0.0.11', 'console_scripts', 'upload-bids')()
File "/usr/local/lib/python2.7/site-packages/flywheel_bids_tools/upload_bids.py", line 291, in main
res = validate_on_unequal_cells(unequal, df_modified)
File "/usr/local/lib/python2.7/site-packages/flywheel_bids_tools/upload_bids.py", line 165, in validate_on_unequal_cells
changed_df.columns[pair[1]]
File "/usr/local/lib/python2.7/site-packages/flywheel_bids_tools/upload_bids.py", line 147, in change_checker
raise Exception("Column {0} not recognised!".format(column))
Exception: Column info_BIDS_valid not recognised!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.