Skip to content

Conversation

@stemangiola
Copy link

@stemangiola stemangiola commented Jan 5, 2025

I happen to have this parameter ethnicity_groupsNativeAmerican&PacificIslander, for a series of fits (30K genes, with 5K samples each, in a biological study) that take ~ 2 weeks, to run.

The character & would normally cause an error.

Instead of rerunning everything, I have enabled hypothesis() to allow for backquotes, such as

hypothesis(
          c(
            "Europeans" = "(ethnicity_groupsAfrican
    + ethnicity_groupsEastAsian
    + ethnicity_groupsHispanicDLatinAmerican
    + ethnicity_groupsSouthAsian
    + `ethnicity_groupsNativeAmerican&PacificIslander`) / 5 = 0"

If this is side-effect-free, I think it would be a great addition to give more flexibility to users. Afterall the modelling worked with atypical names, it would make sense the whole pipeline would.

If you are interested I could design a unit test.

Note: This PR is based on a ChatGPT suggestion that I cleaned up.

escape backquoted parameters from find_vars regexp
@paul-buerkner
Copy link
Owner

I think this would be good feature. Thank you!

Adding some unit tests for this would be good. I suggest to add some in local tests (in tests/local/tests.models-5.R) would be great.

Can you also slightly edit the style to fit with the general code style of brms. That is, use <- instead of = for assignments. Use function(...) instead of function (...). Space before {.

@paul-buerkner
Copy link
Owner

Would you still be motivated to finish this PR?

@stemangiola
Copy link
Author

I will try to complete it in the following 2 weeks.

@paul-buerkner
Copy link
Owner

paul-buerkner commented Apr 16, 2025 via email

@paul-buerkner
Copy link
Owner

Is this PR still something you would like to work on?

@stemangiola
Copy link
Author

Hello Paul, yes, but I need to find some quiet time. If keeping it open for a long time is uncomfortable, feel free to close it, and I will reopen it when the opportunity arises.

@paul-buerkner
Copy link
Owner

No worries, thank you for your response. I will keep it open for the time being.

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

Successfully merging this pull request may close these issues.

2 participants