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

🚚 Replace integers suffixes with descriptive strings for regressor forks #1831

Merged
merged 12 commits into from
Nov 14, 2022

Conversation

shnizzedy
Copy link
Member

@shnizzedy shnizzedy commented Nov 9, 2022

Fixes

Related to #1808 by @shnizzedy
Includes #1823, #1825 & #1830 by @shnizzedy

Description

I interpreted

All non-standard file entities SHOULD conform to BIDS-style naming conventions, including alphabetic entities and suffixes and alphanumeric labels/indices.

Brain Imaging Data Structure v1.8.0: Common principles § Unspecified data

as allowing us to create a non-standard reg- entity here. If we decide to keep this info mashed into desc- we can just roll back to 02f93df.

Technical details

The main change here is

if num_variant:
if (
'regressors' in json_info.get('CpacVariant', {}) and
json_info['CpacVariant']['regressors']
):
reg_value = json_info['CpacVariant'][
'regressors'
][0].replace('nuisance_regressors_generation_', '')
out_dct['filename'] = insert_reg_entity(
out_dct['filename'], reg_value)
resource_idx = insert_reg_entity(resource, reg_value)
else:
for key in out_dct['filename'].split('_')[::-1]:
if key.startswith('desc-'): # final `desc` entity
out_dct['filename'] = out_dct[
'filename'].replace(key,
f'{key}-{num_variant}')
resource_idx = resource.replace(
key, f'{key}-{num_variant}')
break
suff = resource.split('_')[-1]
newdesc_suff = f'desc-{num_variant}_{suff}'
resource_idx = resource.replace(suff, newdesc_suff)
else:
resource_idx = resource
to get names like sub-NDARYX806FL1_ses-HBNsiteRU_task-rest_run-1_atlas-HOCPA_reg-aCompCor_desc-th25Mean_timeseries instead of sub-NDARYX806FL1_ses-HBNsiteRU_task-rest_run-1_atlas-HOCPA_desc-th25Mean1_timeseries

Since the atlas names and hyphen-to-camelCase changes are integral to this PR, I merged #1823 and #1825 into this branch and tested them together. We can just merge this one into develop and get all 3 unless we want to keep them separate.

Screenshots

tail of expectedOutputs

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the develop branch of the repository.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I updated the changelog.
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@shnizzedy
Copy link
Member Author

shnizzedy commented Nov 10, 2022

Question about this one: in #1808, I gave the examples

(e.g., desc-preproc-1, desc-preproc-2 becomes desc-preprocReg36Parameter, desc-preprocRegACompCor)

but here

(e.g., desc-preproc-1, desc-preproc-2 becomes desc-preproc36Parameter, desc-preprocACompCor)

I didn't add Reg.

How to we want these differentiations to be?

  • Just mashed on the end of desc like desc-preproc36Parameter?
  • Mashed on the end with a prefix (e.g., Reg) like desc-preprocReg36Parameter?
  • Add a nonstandard entity like reg-36Parameter_desc-preproc?
  • Something else?

@shnizzedy
Copy link
Member Author

shnizzedy commented Nov 10, 2022

Seems like we could add a reg- (or regr- or someothersuch) key

All non-standard file entities SHOULD conform to BIDS-style naming conventions, including alphabetic entities and suffixes and alphanumeric labels/indices.

Brain Imaging Data Structure v1.8.0: Common principles § Unspecified data

@shnizzedy shnizzedy added the RBC https://github.com/PennLINC/RBC label Nov 10, 2022
@shnizzedy shnizzedy requested a review from a team November 10, 2022 20:39
@shnizzedy shnizzedy self-assigned this Nov 10, 2022
@shnizzedy shnizzedy added this to the 1.8.5 release milestone Nov 10, 2022
I'm interpreting

> All non-standard file entities SHOULD conform to BIDS-style naming conventions, including alphabetic entities and suffixes and alphanumeric labels/indices.

― https://bids-specification.readthedocs.io/en/v1.8.0/02-common-principles.html#unspecified-data

as giving permission to add non-standard entities
commit 269ad93
Author: Jon Clucas <jon.clucas@childmind.org>
Date:   Thu Nov 10 18:52:38 2022 +0000

    :truck: Drop `space-` entities from from native-space filenames:

commit a528907
Author: Jon Clucas <jon.clucas@childmind.org>
Date:   Wed Nov 9 22:06:07 2022 +0000

    :recycle: Refactor expected outputs

commit 411e2dc
Author: Jon Clucas <jon.clucas@childmind.org>
Date:   Wed Nov 9 21:27:58 2022 +0000

    :bug: Path.glob generator is truthy when empty

commit acb6aed
Author: Jon Clucas <jon.clucas@childmind.org>
Date:   Wed Nov 9 19:43:38 2022 +0000

    fixup! :goal_net: Update expected outputs check to match updated derivatives structure

    Co-authored-by: Amy Gutierrez <amygutierrezbme@gmail.com>

commit fc90be1
Author: Jon Clucas <jon.clucas@childmind.org>
Date:   Tue Nov 8 16:43:26 2022 -0500

    :goal_net: Update expected outputs check to match updated derivatives structure

    Co-authored-by: Amy Gutierrez <amygutierrezbme@gmail.com>
    Co-authored-by: Greg Kiar <gkiar@users.noreply.github.com>
@shnizzedy shnizzedy force-pushed the RBC/regressor-fork-names branch from 8ac1d4a to af9738a Compare November 11, 2022 22:39
@sgiavasis sgiavasis merged commit b2a89b3 into develop Nov 14, 2022
@shnizzedy shnizzedy deleted the RBC/regressor-fork-names branch November 14, 2022 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RBC https://github.com/PennLINC/RBC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants