Skip to content

Commit e0c613d

Browse files
authored
Merge pull request #41 from fmlove/dev
Improvements to find_glomeruli for better mPN handling
2 parents cbb956e + 0ed1dbe commit e0c613d

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: tracerutils
22
Type: Package
33
Title: Utilities for EM Neuron Tracers
4-
Version: 0.6.1
4+
Version: 0.7.0
55
Authors@R: person("Fiona", "Love", email = "fl299@cam.ac.uk", role = c("aut", "cre"))
66
Description: Helpful functions for handling neurons traced from EM volumes.
77
Interacts with CATMAID and NBLAST.

R/3D_plots.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ plot_catmaid <- function(skid, volumes = NULL, ncol = NULL, vcol = NULL, valpha
2424
if (!is.null(volumes)){
2525
plotVolumes(volumes, vcol, valpha)
2626
}
27-
2827
invisible(neurons)#returned in case you want to do anything else with them, but not printed to console
2928
}
3029

@@ -68,7 +67,7 @@ plotVolumes <- function(volumes, vcol, valpha, pid = 1){#plot multiple neuropil
6867
if (length(valpha) < length(volumes)) valpha = rep(valpha, length.out = length(volumes))
6968
}
7069
else{
71-
valpha = rep(0.5, length(volumes))
70+
valpha = rep(0.1, length(volumes))
7271
}
7372

7473

R/utils.R

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,23 @@ simple_catmaid_url <- function(dfrow, skid, sid0 = 5, zoom = 0, conn = FALSE, tr
118118
#' Note that annotations of the form \bold{glomerulus \emph{X} right|left} are not considered.
119119
#'
120120
#' @param skids Required; an \code{integer} or \code{character} vector of skeleton IDs
121+
#' @param exclude Optional; a vector of glomeruli to exclude (in the format \bold{\emph{X}} for \bold{glomerulus \emph{X}}, or the full annotation for \bold{unknown glomerulus \emph{N}})
121122
#' @return A \code{character} vector of glomeruli names
122123
#'
123124
#' @export
124125
#'
125-
find_glomeruli <- function(skids){
126+
find_glomeruli <- function(skids, exclude = NULL){
126127
annotations = catmaid::catmaid_get_annotations_for_skeletons(unique(skids))
127128
annotations.glom = annotations[grepl("^glomerulus [A-Za-z0-9]+$", annotations$annotation),]
128129
annotations.glom$glom = sapply(annotations.glom$annotation, function(a){ sub("glomerulus ", "", a) })
129130
annotations.unknown_glom = annotations[grepl("^unknown glomerulus \\d+$", annotations$annotation),]
131+
132+
annotations.glom = annotations.glom[!annotations.glom$glom %in% exclude,]
133+
annotations.unknown_glom = annotations.unknown_glom[!annotations.unknown_glom$annotation %in% exclude,]
134+
130135
glomeruli = sapply(skids, function(s){
131-
s.glom = paste(annotations.glom[annotations.glom$skid == s, "glom"], sep = "", collapse = "/")
132-
s.unknown_glom = paste(annotations.unknown_glom[annotations.unknown_glom$skid == s, "annotation"], sep = "", collapse = "/")
136+
s.glom = paste(sort(unlist(annotations.glom[annotations.glom$skid == s, "glom"])), sep = "", collapse = "/")
137+
s.unknown_glom = paste(sort(unlist(annotations.unknown_glom[annotations.unknown_glom$skid == s, "annotation"])), sep = "", collapse = "/")
133138
if(nchar(s.glom) > 0){
134139
s.glom
135140
}

man/find_glomeruli.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)