Skip to content

Commit

Permalink
Merge commit 'b3dd4e4d946b9c55232a2fa0c198f40902409ac1'
Browse files Browse the repository at this point in the history
Conflicts:
	NEWS.md
  • Loading branch information
jefferis committed May 30, 2021
2 parents 8a67600 + b3dd4e4 commit c203a26
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Authors@R: c(
person("Gregory","Jefferis", email="jefferis@gmail.com",
role = c("aut", "cre"), comment = c(ORCID = "0000-0002-0587-9355")),
person("James", "Manton", role = c("aut"), comment = c(ORCID = "0000-0001-9260-3156")),
person("Sridhar", "Jagannathan", role = c("aut"), comment = c(ORCID = "0000-0002-2078-1145"))
person("Sridhar", "Jagannathan", role = c("aut"), comment = c(ORCID = "0000-0002-2078-1145")),
person("Dominik", "Krzeminski", role = c("ctb"), comment = c(ORCID = "0000-0003-4568-0583"))
)
URL: https://github.com/natverse/nat, https://natverse.github.io
BugReports: https://github.com/natverse/nat/issues
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Some new features and bug fixes. Thanks to @PostPreAndCleft and @artxz for repor
"Bad triangle numbers" error in `read.hxsurf()` (#445)
* Add `xform()` and `xyzmatrix<-()` methods for `mesh3d` objects
* Don't clean `mesh3d` objects read from ply files by default
* `summary.neuron` now prints number of subtrees (#462, @dokato)

# nat 1.10.2

Expand Down
4 changes: 2 additions & 2 deletions R/dotprops.R
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ dotprops.neuronlist<-function(x, ..., OmitFailures=NA) {
#' @param resample When finite, a new length to which all segmented edges will
#' be resampled. See \code{\link{resample.neuron}}.
#' @param topo flag that says whether or not to add topological features
#' (inverted Strahler's Order and distance from soma)
#' (reversed Strahler Order and distance from soma)
#' @rdname dotprops
dotprops.neuron<-function(x, Labels=NULL, resample=NA, topo=FALSE, ...) {
if(is.finite(resample)) x=resample(x, stepsize = resample)
Expand Down Expand Up @@ -212,7 +212,7 @@ get_distance_to_soma <- function(n) {
#' behaviour for different classes of input object, \code{TRUE} always uses
#' labels when an incoming object has them and \code{FALSE} never uses labels.
#' @param na.rm Whether to remove \code{NA} points (default FALSE)
#' @param topo_features topological features of each dotprop
#' @param topo_features topological features of each dotprops
#' @importFrom nabor knn
#' @references The dotprops format is essentially identical to that developed
#' in:
Expand Down
5 changes: 4 additions & 1 deletion R/summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ summary.neuronlist<-function(object, ..., include.attached.dataframe=FALSE) {
#'
#' \item{cable.length}
#'
#' \item{nTrees}
#'
#' }
#' @export
#' @examples
Expand All @@ -50,7 +52,8 @@ summary.neuron<-function(object, ...) {
segments=object$NumSegs,
branchpoints=length(object$BranchPoints),
endpoints=length(object$EndPoints),
cable.length=total_cable(object))
cable.length=total_cable(object),
nTrees=ifelse("nTrees" %in% names(object), object$nTrees, 1))
}

#' @export
Expand Down
4 changes: 2 additions & 2 deletions man/dotprops.Rd

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

2 changes: 2 additions & 0 deletions man/summary.neuron.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ context("summary")

test_that("summary.neuronlist behaves", {
expect_is(s <- summary(Cell07PNs), 'data.frame')
expect_equal_to_reference(s, file = 'testdata/summary_cell07pns.rda', tolerance=1e-3)
expect_equal_to_reference(s, file = 'testdata/summary_cell07pns.rds', tolerance=1e-3)
expect_is(summary(kcs20, veclength=1.2), 'data.frame')
})

Expand Down
Binary file removed tests/testthat/testdata/summary_cell07pns.rda
Binary file not shown.
Binary file added tests/testthat/testdata/summary_cell07pns.rds
Binary file not shown.

0 comments on commit c203a26

Please sign in to comment.