Giter Site home page Giter Site logo

catnat's People

Contributors

alexanderbates avatar istvantaisz avatar jefferis avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

jefferis a-r-j

catnat's Issues

Documentation improvements

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.

primary.neurite.neuronlist is not called for neuron lists

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), ]
}

get_connected_skeletons behaves unexpectedly

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.

Bug in resample.catmaidneuron for neurons without connectors

> 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

nat.nblast must be a dependency

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

googlesheets dependency is archived

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

nat.nblast not nat.blast in average tracts

> 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’ 

Improve docs for catnat:::primary.neurite.neuron

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.