From 10a19bab70ac1a41487f2d8e7564f243e049a224 Mon Sep 17 00:00:00 2001 From: alexanderbates Date: Sun, 24 Nov 2024 15:02:59 -0500 Subject: [PATCH] fixes to ggneuron to see split neurons --- R/ggplot2.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/ggplot2.R b/R/ggplot2.R index ae7e5af..1a9fc4f 100644 --- a/R/ggplot2.R +++ b/R/ggplot2.R @@ -617,8 +617,8 @@ geom_neuron.synapticneuron <- function(x = NULL, inherit.aes = inherit.aes, ...) if(!is.null(x$connectors)){ - syns.in <- nat::xyzmatrix(subset(x$connectors, x$connectors$prepost==1)) - syns.out <- nat::xyzmatrix(subset(x$connectors, x$connectors$prepost==0)) + syns.in <- nat::xyzmatrix(x$connectors[x$connectors$prepost == 1,]) + syns.out <- nat::xyzmatrix(x$connectors[x$connectors$prepost == 0,]) if(!is.null(rotation_matrix)){ syns.in <- as.data.frame(t(rotation_matrix[,1:3] %*% t(syns.in))) syns.in <- syns.in[,-4] @@ -765,8 +765,8 @@ geom_neuron.splitneuron <- function(x = NULL, # And synapses? if(!is.null(x$connectors)){ - syns.in <- nat::xyzmatrix(subset(x$connectors, x$connectors$prepost==1)) - syns.out <- nat::xyzmatrix(subset(x$connectors, x$connectors$prepost==0)) + syns.in <- nat::xyzmatrix(x$connectors[x$connectors$prepost == 1,]) + syns.out <- nat::xyzmatrix(x$connectors[x$connectors$prepost == 0,]) if(!is.null(rotation_matrix)){ syns.in <- as.data.frame(t(rotation_matrix[,1:3] %*% t(syns.in))) syns.in <- syns.in[,-4]