-
Notifications
You must be signed in to change notification settings - Fork 3
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
neuprint_get_shortest_paths returns empty tibble if one of the cells has NULL as name or type #164
Comments
ah that's annoying. code looks pretty crufty |
maybe it's not that bad with indentation? data.frame(from=as.character(d[[2]][[i]][[1]]),
to=as.character(d[[2]][[i+1]][[1]]),
weight=d[[3]][[i]],
depth=i,
name.from=I(list(d[[2]][[i]][[2]])), name.to=I(list(d[[2]][[i+1]][[2]])),
type.from=I(list(d[[2]][[i]][[3]])), type.to=I(list(d[[2]][[i+1]][[3]])),
stringsAsFactors = FALSE) Another possibility
|
also suggest add an ordinal number for each path, maybe something like this
|
Hi I am wondering whether there is a fix or work around on this issue? Thanks! |
@artxz’s suggestion was good but I didn’t get to implement. Will take a day or two to get to unless someone wants to offer a PR. |
Sounds great! It would be super helpful if it is solved. Thanks! |
for example, this works
neuprint_get_shortest_paths(1633411652, 1663767674)
but this does not
neuprint_get_shortest_paths(1850310331, 1663767674)
the returned queries look ok but the second one bodyid = 1850310331 has no name or type. It seems to cause a problem when building the returned dataframe
connTable <- dplyr::bind_rows(lapply(nc$data, function(d){ l <- d[[1]] tryCatch( dplyr::bind_rows(lapply(1:l, function(i){ data.frame(from=as.character(d[[2]][[i]][[1]]), to=as.character(d[[2]][[i+1]][[1]]), weight=d[[3]][[i]], depth=i, name.from=d[[2]][[i]][[2]],name.to=d[[2]][[i+1]][[2]], type.from=d[[2]][[i]][[3]],type.to=d[[2]][[i+1]][[3]], stringsAsFactors = FALSE) })), error = function(e) NULL) }))
One possible solution is to use, eg.,
I(list(d[[2]][[i]][[2]]))
instead ofd[[2]][[i]][[2]]
Similar problem with
neuprint_get_paths
The text was updated successfully, but these errors were encountered: