Skip to content

Commit

Permalink
Corrected example root IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbates committed Oct 6, 2024
1 parent a93c2fa commit 8b267d9
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 20 deletions.
10 changes: 5 additions & 5 deletions R/cloudvolume.R
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand All @@ -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")
}
Expand All @@ -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)
}

6 changes: 3 additions & 3 deletions R/ggplot2.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
}
Expand Down
14 changes: 12 additions & 2 deletions R/ids.R
Original file line number Diff line number Diff line change
Expand Up @@ -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, ...))
}
Expand All @@ -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, ...))
Expand Down Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion R/urls.R
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 6 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion man/banc.surf.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/banc_islatest.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/banc_latestid.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/banc_scene.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/dr_banc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8b267d9

Please sign in to comment.