From e054d5554457ac7d10358c54b952dc1df3e64e68 Mon Sep 17 00:00:00 2001 From: Romain Franconville Date: Tue, 14 Jan 2020 11:15:13 -0500 Subject: [PATCH] Switch to neuprint_read_neuron_simple --- R/neurons.R | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/R/neurons.R b/R/neurons.R index bd4798b7..2084640d 100644 --- a/R/neurons.R +++ b/R/neurons.R @@ -61,21 +61,7 @@ neuprint_read_neuron <- function(bodyid, nat = TRUE, drvid = FALSE, flow.central n = drvid::read.neuron.dvid(bodyid) d = n$d }else{ - cypher = sprintf("MATCH (:`%s` {bodyId:%s})-[:Contains]->(:Skeleton)-[:Contains]->(root :SkelNode) WHERE NOT (root)<-[:LinksTo]-() RETURN root.rowNumber AS rowId, root.location.x AS x, root.location.y AS y, root.location.z AS z, root.radius AS radius, -1 AS link ORDER BY root.rowNumber UNION match (:`%s` {bodyId:%s})-[:Contains]->(:Skeleton)-[:Contains]->(s :SkelNode)<-[:LinksTo]-(ss :SkelNode) RETURN s.rowNumber AS rowId, s.location.x AS x, s.location.y AS y, s.location.z AS z, s.radius AS radius, ss.rowNumber AS link ORDER BY s.rowNumber", - paste0(dp, all_segments_json), - as.numeric(bodyid), - paste0(dp, all_segments_json), - as.numeric(bodyid)) - nc = neuprint_fetch_custom(cypher=cypher, conn = conn, ...) - if(!length(nc$data)){ - warning("bodyid ", bodyid, " could not be read from ", unlist(getenvoroption("server"))) - return(NULL) - } - d = data.frame(do.call(rbind,nc$data)) - d = as.data.frame(t(apply(d,1,function(r) unlist(r)))) - colnames(d) = c("PointNo","X","Y","Z","W","Parent") - d$Label = 0 - n = nat::as.neuron(d) + n = neuprint_read_neuron_simple(as.numeric(bodyid),dataset=dataset,conn = conn,heal = F,...) } if(heal|flow.centrality){ n = heal_skeleton(x = n)