natverse / neuprintr

R client utilities for interacting with the neuPrint connectome analysis service
http://natverse.org/neuprintr
3 stars 3 forks source link

neuprint_read_neurons() broken #9

Closed hjmh closed 4 years ago

hjmh commented 4 years ago

"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.

romainFr commented 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}

jefferis commented 4 years ago

@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)
romainFr commented 4 years ago

Did just that in #12 , thanks!

mmc46 commented 4 years ago

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."

jefferis commented 4 years ago

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.

jefferis commented 4 years ago

Should be functional after merging #12 although healing could still be improved.

romainFr commented 4 years ago

Closing as #32 deals with healing issues