Closed TheChymera closed 3 months ago
yes, ATM you would need to sanitize any non-alphanumeric to some alphanumeric to become BIDS-compliant.
In DANDI's organize
we also sanitize but allow for -
and +
, which isn't BIDS compliant ATM.
back refs on related efforts
right away -- if identical there should be no sessions.json
per each sub-
folder - just place on top level. Moreover
sessions.tsv
? AFAIK it is optional and thus if just a list of session ids, do not bother genearatingsub-
prefix.@yarikoptic
In DANDI's organize we also sanitize but allow for - and +, which isn't BIDS compliant ATM.
but the string I got contains an underscore. I know how to fix it, but it seems to contradict the statement about what's already sanitized in DANDI.
If I only need to replace -
and +
that would best be done with replace, if I can expect literally anything from _
to ¯
it would be done via a whitelist of what characters to keep as they are. Might be safest to do that aynway since the NWB files don't need to come from DANDI 🤔
Let me repeat
ATM you would need to sanitize any non-alphanumeric to some alphanumeric to become BIDS-compliant.
so it means that you need to replace underscore as well... and whitelist is just "alphanumeric" characters.
I don't see what contradicts here... there were no statement that we replace only -
and +
.
Fixed as of 0034ce4c4d58ae2523e6b9a89b60a2d62139be63
Relevant snippet:
I'm pretty sure this is what the metadata looks like in the DANDI archive, and it's read here → https://github.com/con/nwb2bids/blob/6faed97d1bdb39b0b6cd07c5c58a42657b1cb383/nwb2bids/base.py#L178
@yarikoptic I can sanitize as you suggested, replace all manner of special characters with
X
, just that you said in the meeting today DANDI already sanitizes them, but I don't think it did here.