bedapub / designit

Blocking and randomization for experimental design
https://bedapub.github.io/designit/
Other
7 stars 1 forks source link

New function to extract excluded locations #50

Closed banfai closed 2 months ago

banfai commented 2 months ago

$get_locations() omits the excluded locations, it would be useful to be able to get these

idavydov commented 2 months ago

hi @banfai .

in the current version we only use excluded upon creation of a BatchContainer. we call the non-exported function locations_table_from_dimensions() to create a new tibble(). so in the current design there is no way to recover excluded locations after the batch-container was created.

idavydov commented 2 months ago

I will close it for now, but if you think it it worth rewriting the internals to store excluded locations in order handle this, please feel free to reopen.

banfai commented 2 months ago

I'm using exclusions to leave out some wells on a plate for fixed controls (it's easier this way than shuffling with constraints). After the optimization I need to fill up the excluded wells with the controls, so it would be nice to get them again.

I'll look into it if it would be possible to solve this easily.

banfai commented 2 months ago

I was also thinking about a function to manually "unexclude" locations and assign some value (so excluded locations are untouchable by the optimization, but allowed to be manipulated manually). I'm not sure yet if this is a good idea.

idavydov commented 2 months ago

I think the possibilities you have already:

I'm currently not convinced that a separate function is needed.

banfai commented 2 months ago
  • just bind rows
bc$get_samples() |>
  bind_rows(control_locations)

this is what I'm doing now, but I felt it would be more robust to get these from the BatchContainer...

banfai commented 2 months ago

After discussing it with @julianesiebourg a different approach might be better:

For this we probably need an extra column in the internal samples table (maybe .fixed), and an argument in $get_samples().

idavydov commented 2 months ago

Wouldn't we achieve the same with shuffle_with_constraints(src=!fixed, dst=!fixed)? Without the need to increase complexity of BatchContainer.