diff --git a/R/cloudvolume.R b/R/cloudvolume.R index 48f4470..9ec65c7 100644 --- a/R/cloudvolume.R +++ b/R/cloudvolume.R @@ -43,7 +43,7 @@ banc_token_available <- function() { !inherits(try(banc_token(), silent = TRUE), 'try-error') } -#' Print information about your banc setup including tokens and python modules +#' Print information about your BANC setup including tokens and python modules #' #' @export #' @seealso \code{\link{dr_fafbseg}} @@ -61,13 +61,13 @@ dr_banc <- function() { } # hidden -banc_api_report <- function() { - message("BANC Neuroglancer / CAVE API access\n----") +banc_api_report <- function(with_dataset = bancr::with_banc) { + message("Neuroglancer / CAVE API access\n----") token=try(banc_token(cached = F), silent = FALSE) if(inherits(token, "try-error")) { FUN=if(requireNamespace('usethis', quietly = T)) usethis::ui_todo else message FUN(paste('No valid banc API token found. Set your token by doing:\n', - "{ui_code('banc_set_token()')}")) + "{ui_code('*_set_token()')}")) } else{ cat("Valid banc API ChunkedGraph token is set!\n") } @@ -77,7 +77,7 @@ banc_api_report <- function() { fafbseg:::cv_secretdir(),"\n") print(ff) } - u=with_banc(fafbseg:::check_cloudvolume_url(set = F)) + u=with_dataset(fafbseg:::check_cloudvolume_url(set = F)) cat("\nZetta cloudvolume URL:", u) } diff --git a/R/ggplot2.R b/R/ggplot2.R index 240f95f..e0fbd6a 100644 --- a/R/ggplot2.R +++ b/R/ggplot2.R @@ -41,9 +41,9 @@ #' #' # Get some neurons to plot #' banc.meta.dnao1 <- subset(banc.meta, cell_type=="DNa01") -#' dna01 <- banc_read_neuron_meshes(banc.meta.dnao1$root_id) +#' dna01 <- banc_read_neuron_meshes(unique(banc.meta.dnao1$root_id)) #' banc.meta.dnao2 <- subset(banc.meta, cell_type=="DNa02") -#' dna02 <- banc_read_neuron_meshes(banc.meta.dnao2$root_id) +#' dna02 <- banc_read_neuron_meshes(unique(banc.meta.dnao2$root_id)) #' #' # Simplify neurons to make them easier to plot #' dna01 <- nat::nlapply(dna01,Rvcg::vcgQEdecim,percent = 0.1) @@ -136,7 +136,7 @@ banc_neuron_comparison_plot <- function(neuron1 = NULL, # Work out colours if(length(neuron1)==1){ - cols1 <- c("blue", "navy") + cols1 <- c("darkblue", "navy") }else{ cols1 <- grDevices::colorRampPalette(c("#00008B","#0000CD","#4169E1","#1E90FF","#87CEEB", "#B0E0E6"))(length(neuron1)) } diff --git a/R/ids.R b/R/ids.R index 2084244..fd91fc0 100644 --- a/R/ids.R +++ b/R/ids.R @@ -144,7 +144,7 @@ banc_supervoxels <- function(x, voxdims=c(4,4,45)) { #' @export #' @family banc-ids #' @examples -#' banc_islatest("648518346473954669") +#' banc_islatest("720575941520182775") banc_islatest <- function(x, timestamp=NULL, ...) { with_banc(flywire_islatest(x=x, timestamp = timestamp, ...)) } @@ -163,7 +163,7 @@ banc_islatest <- function(x, timestamp=NULL, ...) { #' @family banc-ids #' @examples #' \dontrun{ -#' banc_latestid("648518346473954669") +#' banc_latestid("720575941520182775") #' } banc_latestid <- function(rootid, sample=1000L, cloudvolume.url=NULL, Verbose=FALSE, ...) { with_banc(fafbseg::flywire_latestid(rootid=rootid, sample = sample, Verbose=Verbose, ...)) @@ -387,3 +387,13 @@ banc_cellid_table <- memoise::memoise(function(fac=banc_cave_client()) { seltable=rev(sort(grep("^cell_info", tablenames, value = T)))[1] return(seltable) }) + +# hideen +banc_nucelus_id_to_rootid <- function(nucleus_ids){ + nuclei <- banc_nuclei() + nuclei$root_id <- as.character(nuclei$root_id) + nuclei$nucleus_id <- as.character(nuclei$nucleus_id) + ids <- nuclei$root_id[match(nucleus_ids, nuclei$nucleus_id)] + ids[is.na(ids)] <- "0" + ids +} diff --git a/R/urls.R b/R/urls.R index ba22f9a..9690748 100644 --- a/R/urls.R +++ b/R/urls.R @@ -1,4 +1,4 @@ -#' Return a sample Neuroglancer scene URL for banc dataset +#' Return a sample Neuroglancer scene URL for BANC dataset #' #' @details See #' \href{https://banc-reconstruction.slack.com/archives/C01RZP5JH9C/p1616522511001900}{banc diff --git a/R/utils.R b/R/utils.R index 0f4df9b..3305801 100644 --- a/R/utils.R +++ b/R/utils.R @@ -18,7 +18,7 @@ euclidean_distances <- function(A, B) { } # Helper -express_lane <- function(base_dir) { +express_lane <- function(base_dir, symlink = TRUE) { todo_dir <- base_dir #fs::path(base_dir, "todo") if (fs::dir_exists(todo_dir)) { express_dir <- fs::path(base_dir, "express") @@ -48,7 +48,11 @@ express_lane <- function(base_dir) { } # Create symlink - fs::link_create(file, symlink_path) + if(symlink){ + fs::link_create(file, symlink_path) + }else{ + fs::file_copy(file,symlink_path) + } cat("Created symlink:", symlink_path, "->", file, "\n") }) remove_empty_dirs(base_dir) diff --git a/man/banc.surf.Rd b/man/banc.surf.Rd index 3dbc842..e8e6a63 100644 --- a/man/banc.surf.Rd +++ b/man/banc.surf.Rd @@ -38,7 +38,7 @@ An object of class \code{hxsurf} (inherits from \code{list}) of length 4. An object of class \code{hxsurf} (inherits from \code{list}) of length 4. -An object of class \code{data.frame} with 310 rows and 3 columns. +An object of class \code{data.frame} with 311 rows and 3 columns. } \usage{ banc.surf diff --git a/man/banc_islatest.Rd b/man/banc_islatest.Rd index 17103a9..62ce2e3 100644 --- a/man/banc_islatest.Rd +++ b/man/banc_islatest.Rd @@ -19,7 +19,7 @@ time will be ignored (see details).} Check if a banc root id is up to date } \examples{ -banc_islatest("648518346473954669") +banc_islatest("720575941520182775") } \seealso{ Other banc-ids: diff --git a/man/banc_latestid.Rd b/man/banc_latestid.Rd index cfb76cc..efcb89d 100644 --- a/man/banc_latestid.Rd +++ b/man/banc_latestid.Rd @@ -49,7 +49,7 @@ Find the latest id for a banc root id } \examples{ \dontrun{ -banc_latestid("648518346473954669") +banc_latestid("720575941520182775") } } \seealso{ diff --git a/man/banc_scene.Rd b/man/banc_scene.Rd index 4f2d8fb..e2ede35 100644 --- a/man/banc_scene.Rd +++ b/man/banc_scene.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/urls.R \name{banc_scene} \alias{banc_scene} -\title{Return a sample Neuroglancer scene URL for banc dataset} +\title{Return a sample Neuroglancer scene URL for BANC dataset} \usage{ banc_scene( ids = NULL, @@ -29,7 +29,7 @@ A character vector containing a single Neuroglancer URL (invisibly when \code{open=TRUE}). } \description{ -Return a sample Neuroglancer scene URL for banc dataset +Return a sample Neuroglancer scene URL for BANC dataset } \details{ See diff --git a/man/dr_banc.Rd b/man/dr_banc.Rd index 468e447..022bc6a 100644 --- a/man/dr_banc.Rd +++ b/man/dr_banc.Rd @@ -2,12 +2,12 @@ % Please edit documentation in R/cloudvolume.R \name{dr_banc} \alias{dr_banc} -\title{Print information about your banc setup including tokens and python modules} +\title{Print information about your BANC setup including tokens and python modules} \usage{ dr_banc() } \description{ -Print information about your banc setup including tokens and python modules +Print information about your BANC setup including tokens and python modules } \examples{ \dontrun{