Closed hjmh closed 4 years ago
This might be a bit more work for the experts of the "neuron" objects. :Skeleton seems to have disappeared from the data model as far as I can tell, but are accessible through the api as:
/api/skeletons/skeleton/{dataset}/{id}
@romainFr you should be able to replace https://github.com/natverse/neuprintr/blob/fd4c8dff1f793dc87713723aeb76417cd04f1809/R/neurons.R#L64-78
With a call to a private function I already implemented neuprint_read_neuron_simple
Something like:
n=neuprint_read_neuron_simple(x=as.numeric(bodyid), dataset=dataset, conn=conn, heal=F)
Did just that in #12 , thanks!
Even with neuprint_read_neuron_simple
it will return an error if the skeletonisation generates isolated nodes.
n5901222731 = neuprintr:::neuprint_read_neuron_simple(5901222731)
Error in as.neuron.ngraph(as.ngraph(x), vertexData = x, ...) :
Invalid neuron! Must contain at least one segment with 2 points
From Greg: "@Sri had been working on an approach to heal skeletons that would improve on previous ones and work directly on the ngraph representation. Right now, it would be necessary to drop any singleton nodes – and that requires a code change."
Actually if you do
n5901222731 = neuprintr:::neuprint_read_neuron_simple(5901222731, heal=FALSE)
you will get a valid neuron albeit one with some isolated nodes. If we replace the code dealing with the healing with @SridharJagannathan's version we should be able to have healed neurons with just one tree.
Should be functional after merging #12 although healing could still be improved.
Closing as #32 deals with healing issues
"Error: none of the given bodyids have skeletons that could be fetched"
This does not appear to be simply an issue of bodyids being characters instead of numeric.