Skip to content

Commit

Permalink
nvertices.igraph fixes vcount mode
Browse files Browse the repository at this point in the history
* used to be an int, now numeric with igraph 2.0
  • Loading branch information
jefferis committed Jan 31, 2024
1 parent a98ced2 commit ee4a57b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ S3method(ndigest,neuron)
S3method(ndigest,neuronlistfh)
S3method(nvertices,default)
S3method(nvertices,dotprops)
S3method(nvertices,igraph)
S3method(nvertices,neuron)
S3method(nvertices,neuronlist)
S3method(nvertices,shapelist3d)
Expand Down
2 changes: 1 addition & 1 deletion R/neuron.R
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ as.neuron.ngraph<-function(x, vertexData=NULL, origin=NULL, Verbose=FALSE, ...){

d=seglist2swc(x=subtrees,d=d)
d=normalise_swc(d)
n=list(d=d,NumPoints=igraph::vcount(masterg),
n=list(d=d,NumPoints=nvertices(masterg),
StartPoint=StartPoint,
BranchPoints=branchpoints(masterg, original.ids='vid'),
EndPoints=endpoints(masterg, original.ids='vid'),
Expand Down
7 changes: 7 additions & 0 deletions R/xform.R
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,13 @@ xform.neuronlist<-function(x, reg, subset=NULL, ..., OmitFailures=NA,
}


#' @rdname nvertices
#' @export
nvertices.igraph <- function(x, ...) {
# as of igraph 2.0 this is numeric
as.integer(igraph::vcount(x))
}

#' Mirror 3D object about a given axis, optionally using a warping registration
#'
#' @description mirroring with a warping registration can be used to account
Expand Down
7 changes: 5 additions & 2 deletions man/nvertices.Rd

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

0 comments on commit ee4a57b

Please sign in to comment.