Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

alexanderbates
Copy link
Contributor

  • Use the code annotation cave table + cell info, with option to use seatable
  • cache the banc_meta result and use in banc data grabs, until re-made
  • use bancr package directly

* Use the code annotation cave table + cell info, with option to use seatable
* cache the banc_meta result and use in banc data grabs, until re-made
* user bancr package
@jefferis
Copy link
Contributor

jefferis commented Aug 14, 2025

Hi @alexanderbates, thanks so much for this update.

It seems important to switch to the codex annotations released with the BANC paper and I'm keen to get that functionality supported. However, there is a lot of detailed logic here for your dataset which begins to feel like it really belongs in the external package not in coconatfly. I am also hesitant about depending on complex external data source packages – in the case of bancr, this introduces dependencies such as the development version of ggplot2 + ggpubr etc which I would prefer to avoid.

Finally, there are a few changes in here that are only partially related to your patch or not at all – changes in the handling of ... in cf_cosine_plot, updating the Rstudio project file because you're using an older version of Rstudio etc.

I now have a relatively simple mechanism to register user-supplied metadata/id/partner functions. This could be used from bancr either by the end user calling a function explicitly or via a startup function. For example:

#zzz.R
.onAttach<-function(libname, pkgname) {
  register_banc_coconatfly(showerror=FALSE)
}
# banc_coconatfly.R
my_banc_meta <- function(ids, ...) {
  
}
my_banc_ids <-  function(ids, ...) {
  
}

# minimal version of this function
my_banc_partners <- function(ids, partners, threshold, ...) {
  ids=my_banc_ids(ids)
  # coconatfly adds partner metadata by default
  bancr::banc_partner_summary(ids,
                              partners = partners,
                              threshold = threshold-1L, ...))
}

# this function could be user visible if desired, in which case you might
# also give it arguments to switch the metadata source
register_banc_coconatfly(showerror=TRUE) {
  if(requireNamespace('coconatfly', quietly = !showerror))
    coconat::register_dataset(
      name = 'banc',
      shortname = 'bc',
      namespace = 'coconatfly',
      metafun = my_banc_meta,
      idfun = my_banc_ids,
      partnerfun = my_banc_partners
    )
}

@alexanderbates
Copy link
Contributor Author

alexanderbates commented Aug 15, 2025

Thanks Greg,

I didn't know you could register a dataset the way you've shown, that's an elegant solution. I have made the necessary updates to bancr here: flyconnectome/bancr@c140f75

But it does not seem like coconatfly@main will make use of it (as opposed to coconat)?

Do you want to make changes you think coconatfly might need, also decommissioning the other BANC code? We could then kill this branch. A few people are using it already (it's a feature I have frequently been asked to add).

I have also been asked to add CRANTb, and so I have made a start here: flyconnectome/crantr@f0983f7

I feel like we would want something like this to work?

library(coconatfly)
library(bancr)
crant_meta_create_cache(use_seatable=TRUE)
banc_meta_create_cache(use_seatable=TRUE)
register_crant_coconat()
register_banc_coconat()
cf_cosine_plot(cf_ids('/type:.*NSC.*', datasets = c("crant", "banc","flywire")))

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