jefferislab / catnat Goto Github PK
View Code? Open in Web Editor NEWneuroanatomy toolbox – CATMAID extension functions
Home Page: https://jefferislab.github.io/catnat
neuroanatomy toolbox – CATMAID extension functions
Home Page: https://jefferislab.github.io/catnat
Problem is that
apply(df, 1, connector_URL)
turns each row of df into a character matrix.
primary.neurite.neuronlist<-function (someneuronlist, ...)
{
nlapply(someneuronlist, primary.neurite.neuron, OmitFailures = T, ...)
}
If anyone is going to use this package, we should try to improve the documentation a bit. I have added a pkgdown online documentation site. See e.g. https://pkgdown.r-lib.org/articles/pkgdown.html for config details.
You will see there are currently lots of duplicate doc errors (some functions are defined 3x) and also a bunch if incorrectly documented args. it would be good to fix.
the generic primary.neurite
function should look like this
primary.neurite<-function(x, ...) UseMethod("primary.neurite")
this picks the appropriate specialised method according to the type of x
You can also have a catch all
primary.neurite.default
function which may be what you intended for:
primary.neurite<-function (someneuron, k = 100)
{
som = soma.neuron(someneuron)
if (is.na(som[1])) {
if (length(someneuron[[1]]$tags$soma[[1]]) > 0) {
som = matrix(xyzmatrix(someneuron)[someneuron[[1]]$d$PointNo %in%
someneuron[[1]]$tags$soma, ], ncol = 3)
}
else {
som = matrix(xyzmatrix(someneuron)[someneuron[[1]]$StartPoint,
], ncol = 3)
}
}
p = nat::xyzmatrix(someneuron)
n = nabor::knn(p, som, ifelse(nrow(p) > k, k, nrow(p)))
m = p[c(n$nn.idx), ]
}
Seba encountered this: get_connected_skeletons
appears to return incomplete list of partners.
Minimal example:
> av1a1Neurons = read.neurons.catmaid(c(2659704, 2684792))
> cn = get_connected_skeletons(av1a1Neurons, min_synapses = 10)
> names(cn)
[1] "2101395" "4947032" "6180224" "6189928" "6199308" "6199551" "11545803"
cn
should contain order 50 neurons given a 10 synapse threshold.
> asc_92902213 = read.neurons.fafbseg(92902213)
> asc_92902213.resampled1 = resample(asc_92902213, stepsize = 10)
Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), :
'data' must be of a vector type, was 'NULL'
> asc_92902213.resampled2 = nlapply(asc_92902213, resample, OmitFailures = FALSE, stepsize = 10)
> plot3d(asc_92902213.resampled2)
Warning message:
In xyz.coords(x, y, z, xlab = xlabel, ylab = ylabel, zlab = zlabel, :
NAs introduced by coercion
> examples = primary.neurite.tracts = nlapply(pnts,function(z) average.tracts(subset(most.lhns.pnts,pnt==z),mode=1))
|=================================================================| 100%
|=================================================================| 100%
Show Traceback
Rerun with Debug
Error in get(smat) : object 'smat.fcwb' not found
This is a subtle namespace that @Ajdm2 and greg never solved.
This won't be a very common problem at this point but you might want to consider switching the google sheets related functions to use googlesheets4
instead of googlesheets
, which is archived: https://github.com/jennybc/googlesheets
Right now the dependency on googlesheets
makes installing catnat
a bit inconvenient.
i.e. one has to get googlesheets
from the CRAN archive:
install.packages("https://cran.r-project.org/src/contrib/Archive/googlesheets/googlesheets_0.3.0.tar.gz", repos = NULL, type = "source")
> examples = primary.neurite.tracts = nlapply(pnts,function(z) average.tracts(subset(most.lhns.pnts,pnt==z),mode=1))
|=================================================================| 100%
|=================================================================| 100%
Show Traceback
Rerun with Debug
Error in loadNamespace(name) : there is no package called ‘nat.blast’
In particular point out that it just finds the first segment from the root – even if it's terminated by a tiny one segment branch. Could cross-reference elmr::simplify_neuron
and give an eaxample of using that.
skeleton_connectivity_matrix
I assume it was intended to work like this, but it would be nice to have the option to use skids only without the need to fetch neurons, alternatively add
if (!(is.neuronlist(pre))) {
stop("Neuronlist expected")
}
connectivity_matrix:
always returns NULL, m is missing from the end of the function
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.