New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function for rerooting neuron #463
Conversation
Here I decided to be more flexible and rather than point belonging to neuron I provide an option to reroot to a node that is closest to |
@jefferis I'd appreciate advice on how to go around this point:
It was tempting to just use a function from catmaid: #' @export
reroot.catmaidneuron<-function(object, ...) {
n = NextMethod()
copy_tags_connectors(n, object)
} But this should go to catmaid then? Here it'd introduce a dependency loop. |
Thanks @dokato! Yes, that was exactly what I was expecting the method should look like; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not run pkgdown as part of the PR. Could you remove those changes under docs
. I've now started running pkgdown on github for new packages, but for now, prefer to run it periodically on master after changes have gone in.
Thanks @jefferis for useful comments, I added support for matrices, node ids and removed pkgdown build. PTAL now. |
BTW while on that I gave it a go and added But for some reason I'm getting such error: > conn=catmaid_login(server="https://l1em.catmaid.virtualflybrain.org")
> orns=read.neurons.catmaid("name:ORN right", .progress='text')
> class(orns[[1]])
[1] "catmaidneuron" "neuron"
> reroot.catmaidneuron(orns[[1]])
Error in NextMethod() : generic function not specified I'm using |
Maybe you need to import the generic from nat?
…Sent from my iPhone
On 3 Jun 2021, at 12:15, dokato ***@***.***> wrote:
BTW while on that I gave it a go and added reroot.catmaidneuron to https://github.com/natverse/rcatmaid
But for some reason I'm getting such error:
> conn=catmaid_login(server="https://l1em.catmaid.virtualflybrain.org")
> orns=read.neurons.catmaid("name:ORN right", .progress='text')
> class(orns[[1]])
[1] "catmaidneuron" "neuron"
> reroot.catmaidneuron(orns[[1]])
Error in NextMethod() : generic function not specified
I'm using nat version with the reroot changes ofkz. Maybe I miss something about generics, but I believe that I found some relevant example where the "next" method came from a different package - similar to our case. Any ideas what's wrong here?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Oh also you shouldn’t call the method directly. Use the generic ie plain reroot.
…Sent from my iPhone
On 3 Jun 2021, at 12:15, dokato ***@***.***> wrote:
BTW while on that I gave it a go and added reroot.catmaidneuron to https://github.com/natverse/rcatmaid
But for some reason I'm getting such error:
> conn=catmaid_login(server="https://l1em.catmaid.virtualflybrain.org")
> orns=read.neurons.catmaid("name:ORN right", .progress='text')
> class(orns[[1]])
[1] "catmaidneuron" "neuron"
> reroot.catmaidneuron(orns[[1]])
Error in NextMethod() : generic function not specified
I'm using nat version with the reroot changes ofkz. Maybe I miss something about generics, but I believe that I found some relevant example where the "next" method came from a different package - similar to our case. Any ideas what's wrong here?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
ah damn, of course, that was it :P I'll send PR soon. |
Actually @dokato the generic should have signature (x, ...) and the method should have ... in addition to the named arguments. Generics should pretty much always have ... so that you can handle any subsequent methods that need other arguments. |
@dokato I added some details to the docs. I'll merge when the checks complete. |
getting foot in the door.
TODO:
nat::distal_to
for ideas."reroot(x,...)
idx
andpointno
for bothcatmaidneuron
method that ensures that additional metadata (synaptic connectors etc) is copied over when the neuron is remade_pkgdown.yml