diff --git a/.Rbuildignore b/.Rbuildignore index 4a48b85..19383a2 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -6,3 +6,4 @@ ^\.github$ ^sample$ ^pkgdown$ +^codecov\.yml$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..ae72b87 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,53 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +name: R-CMD-check.yaml + +permissions: read-all + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: macos-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + RGL_USE_NULL: true + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..4bbce75 --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,50 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + release: + types: [published] + workflow_dispatch: + +name: pkgdown.yaml + +permissions: read-all + +jobs: + pkgdown: + runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.5.0 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 0000000..0aef238 --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,62 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +name: test-coverage.yaml + +permissions: read-all + +jobs: + test-coverage: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + RGL_USE_NULL: true + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::covr, any::xml2 + needs: coverage + + - name: Test coverage + run: | + cov <- covr::package_coverage( + quiet = FALSE, + clean = FALSE, + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") + ) + covr::to_cobertura(cov) + shell: Rscript {0} + + - uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }} + file: ./cobertura.xml + plugin: noop + disable_search: true + token: ${{ secrets.CODECOV_TOKEN }} + + - name: Show testthat output + if: always() + run: | + ## -------------------------------------------------------------------- + find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true + shell: bash + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v4 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package diff --git a/.gitignore b/.gitignore index 09a72cb..10c71b2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .Rhistory .RData inst/doc +docs diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index be5c2e4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -# see https://docs.travis-ci.com/user/languages/r/ -language: R -sudo: false -cache: packages -addons: - apt: - packages: - - libglu1-mesa-dev -env: - global: - - RGL_USE_NULL=TRUE -jobs: - include: - - stage: prepare cache - script: true - - stage: test -before_install: - - echo 'options(Ncpus = 2)' >> ~/.Rprofile diff --git a/DESCRIPTION b/DESCRIPTION index 2fb723f..0f780a0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -11,7 +11,7 @@ Authors@R: c( ) Description: Extends package 'nat' (NeuroAnatomy Toolbox) by providing a collection of NBLAST-related functions for neuronal morphology comparison (Costa et al. (2016) ). -URL: https://natverse.org/nat.nblast/ +URL: https://natverse.org/nat.nblast/, http://natverse.org/nat.nblast/ BugReports: https://github.com/natverse/nat.nblast/issues Depends: R (>= 2.15.1), @@ -33,6 +33,6 @@ Suggests: License: GPL-3 LazyData: yes VignetteBuilder: knitr -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.2 Language: en-GB Encoding: UTF-8 diff --git a/R/nat.nblast.r b/R/nat.nblast.r index b39813a..2481258 100644 --- a/R/nat.nblast.r +++ b/R/nat.nblast.r @@ -89,10 +89,9 @@ #' #' @name nat.nblast-package #' @aliases nat.nblast -#' @docType package #' @import methods #' @keywords package #' @seealso \code{\link{nblast}}, \code{\link{smat.fcwb}}, #' \code{\link{nhclust}}, \code{\link{sub_dist_mat}}, #' \code{\link{sub_score_mat}}, \code{\link{create_scoringmatrix}} -NULL +"_PACKAGE" diff --git a/README.md b/README.md index c57b3ca..faf19e4 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,10 @@ [![natverse](https://img.shields.io/badge/natverse-Part%20of%20the%20natverse-a241b6)](https://natverse.org/) [![Release Version](https://img.shields.io/github/release/natverse/nat.nblast.svg)](https://github.com/natverse/nat.nblast/releases/latest) [![CRAN status](https://www.r-pkg.org/badges/version/nat.nblast)](https://CRAN.R-project.org/package=nat.nblast) -[![Build Status](https://travis-ci.org/natverse/nat.nblast.svg?branch=master)](https://app.travis-ci.com/natverse/nat.nblast) [![Docs](https://img.shields.io/badge/docs-100%25-brightgreen.svg)](https://natverse.org/nat.nblast/reference/) +[![R-CMD-check](https://github.com/natverse/nat.nblast/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/natverse/nat.nblast/actions/workflows/R-CMD-check.yaml) +[![codecov](https://codecov.io/gh/natverse/nat.nblast/graph/badge.svg?token=VqX3HEdELo)](https://codecov.io/gh/natverse/nat.nblast) + **nat.nblast** is part of the [NeuroAnatomy Toolbox](https://jefferislab.github.io/) diff --git a/_pkgdown.yml b/_pkgdown.yml index 8838f16..2b5ca36 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,3 +1,6 @@ +url: https://natverse.org/nat.nblast/ +template: + bootstrap: 5 navbar: structure: left: @@ -80,4 +83,3 @@ reference: - '[' - fill_in_sparse_score_mat - fill_pairs_sparse_score_mat - diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..04c5585 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,14 @@ +comment: false + +coverage: + status: + project: + default: + target: auto + threshold: 1% + informational: true + patch: + default: + target: auto + threshold: 1% + informational: true diff --git a/docs/404.html b/docs/404.html deleted file mode 100644 index 332f455..0000000 --- a/docs/404.html +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - -Page not found (404) • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
-
- - -Content not found. Please use links in the navbar. - -
- - - -
- - - -
- - -
-

Site built with pkgdown 1.6.1.

-
- -
-
- - - - - - - - diff --git a/docs/SUPPORT.html b/docs/SUPPORT.html deleted file mode 100644 index d38f195..0000000 --- a/docs/SUPPORT.html +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - -Getting help with nat.nblast • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
-
- - -
- -

Thanks for using nat.nblast. We’re sorry if you’re having trouble, but don’t worry, we’re here to help! To get help as quickly as possible, please read the following:

- -
-

-Known Problems

-

If you need more help with a known problem:

-
    -
  • If you found a relevant thread on the nat-user google group: please reply to that.
  • -
  • If you found a GitHub issue: please reply to that with more details or just like it (click on the emoji button and add a thumbs up) to let us know you’re having trouble too. You’ll need to a GitHub login for this.
  • -
  • If you’re not sure: ask a new question on the nat-user google group linking to what you have found.
  • -
-
-
-

-New Problems

-

If it looks like a new problem then:

-
    -
  • If you just have a question: please ask the nat-user google group.
  • -
  • If you need to report a new bug: please file an issue.
  • -
  • If you’re not sure: please just ask the nat-user google group! If your problem is a bug or a feature request, you can easily return here and report it - and we may be able to point you to an existing report or workaround.
  • -
-
-
-

-Good Questions and Bug Reports

-
    -
  • Be specific
  • -
  • Include the code that triggered the problem
  • -
  • If at all possible, make a minimal reproducible example (a reprex)
  • -
-

It will be much easier for us to help if we can run a reprex on our own machine without your data. You might want to use sample data from a nat package to help, or refer to publicly available data online. You can use the reprex package to help prepare a reprex. Read the Get help! section of the tidyverse site for more information.

-

Thanks for your help!

-
-
- -
- - - -
- - - -
- - -
-

Site built with pkgdown 1.6.1.

-
- -
-
- - - - - - - - diff --git a/docs/apple-touch-icon-120x120.png b/docs/apple-touch-icon-120x120.png deleted file mode 100644 index a7c7bfb..0000000 Binary files a/docs/apple-touch-icon-120x120.png and /dev/null differ diff --git a/docs/apple-touch-icon-152x152.png b/docs/apple-touch-icon-152x152.png deleted file mode 100644 index 7db25d5..0000000 Binary files a/docs/apple-touch-icon-152x152.png and /dev/null differ diff --git a/docs/apple-touch-icon-180x180.png b/docs/apple-touch-icon-180x180.png deleted file mode 100644 index 00ef89d..0000000 Binary files a/docs/apple-touch-icon-180x180.png and /dev/null differ diff --git a/docs/apple-touch-icon-60x60.png b/docs/apple-touch-icon-60x60.png deleted file mode 100644 index cbb30b4..0000000 Binary files a/docs/apple-touch-icon-60x60.png and /dev/null differ diff --git a/docs/apple-touch-icon-76x76.png b/docs/apple-touch-icon-76x76.png deleted file mode 100644 index 1425e3b..0000000 Binary files a/docs/apple-touch-icon-76x76.png and /dev/null differ diff --git a/docs/apple-touch-icon.png b/docs/apple-touch-icon.png deleted file mode 100644 index 7a81e6d..0000000 Binary files a/docs/apple-touch-icon.png and /dev/null differ diff --git a/docs/articles/NBLAST-Clustering.html b/docs/articles/NBLAST-Clustering.html deleted file mode 100644 index a098dfe..0000000 --- a/docs/articles/NBLAST-Clustering.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - -NBLAST Clustering • nat.nblast - - - - - - - - - - - - - - - - - -
-
- - - - -
-
- - - - -
-

-Startup

-

Install the package if required

-
-install.packages('nat.nblast', dependencies = TRUE)
-

Load the package and set up for knitr / 3D snapshot figures

- -
-
-

-Clustering with NBLAST scores

-
-

-All by all scores

-

First we create a 20 x 20 NBLAST all by all score matrix for 20 Kenyon cells included with the nat package

-
-library(nat)
-kcscores <- nblast_allbyall(kcs20)
-
-
-

-Clustering

-

Hierarchically cluster the Kenyon scores and divide the clustering into 3 groups

-
-hckcs <- nhclust(scoremat=kcscores)
-
## The "ward" method has been renamed to "ward.D"; note new "ward.D2"
-
-library(dendroextras)
-dkcs <- colour_clusters(hckcs, k=3)
-

Plot a dendrogram of the clustering, with leaves labelled by true neuron type

-
-labels(dkcs) <- with(kcs20[labels(dkcs)], type)
-par(cex=.7) # so labels are legible
-plot(dkcs)
-

-
-
-

-3D plot

-

You can create interactive 3D plots using the rgl package where different subgroups of neurons are coloured according to the calculated clustering.

-
-plot3d(hckcs, k=3, db=kcs20, soma=T)
-par3d(userMatrix=diag(c(1,-1,-1,1), 4))
-plot3d(MBL.surf, alpha=.1)
-

-
-
-
- - - -
- - - -
- -
-

Site built with pkgdown 1.6.1.

-
- -
-
- - - - - - diff --git a/docs/articles/NBLAST-Clustering_files/figure-html/unnamed-chunk-4-1.png b/docs/articles/NBLAST-Clustering_files/figure-html/unnamed-chunk-4-1.png deleted file mode 100644 index a2a5df6..0000000 Binary files a/docs/articles/NBLAST-Clustering_files/figure-html/unnamed-chunk-4-1.png and /dev/null differ diff --git a/docs/articles/NBLAST-Clustering_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/NBLAST-Clustering_files/figure-html/unnamed-chunk-5-1.png deleted file mode 100644 index c7671ca..0000000 Binary files a/docs/articles/NBLAST-Clustering_files/figure-html/unnamed-chunk-5-1.png and /dev/null differ diff --git a/docs/articles/NBLAST-Clustering_files/header-attrs-2.8/header-attrs.js b/docs/articles/NBLAST-Clustering_files/header-attrs-2.8/header-attrs.js deleted file mode 100644 index dd57d92..0000000 --- a/docs/articles/NBLAST-Clustering_files/header-attrs-2.8/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/index.html b/docs/articles/index.html deleted file mode 100644 index 3c85b50..0000000 --- a/docs/articles/index.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - -Articles • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
-
- - -
-

All vignettes

-

- -
-
NBLAST Clustering
-
-
-
-
-
- - -
- - -
-

Site built with pkgdown 1.6.1.

-
- -
-
- - - - - - - - diff --git a/docs/authors.html b/docs/authors.html deleted file mode 100644 index 2eb3174..0000000 --- a/docs/authors.html +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - -Authors • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
-
- - -
    -
  • -

    Gregory Jefferis. Author. -

    -
  • -
  • -

    James Manton. Author, maintainer. -

    -
  • -
- -
- -
- - - -
- - -
-

Site built with pkgdown 1.6.1.

-
- -
-
- - - - - - - - diff --git a/docs/bootstrap-toc.css b/docs/bootstrap-toc.css deleted file mode 100644 index 5a85941..0000000 --- a/docs/bootstrap-toc.css +++ /dev/null @@ -1,60 +0,0 @@ -/*! - * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) - * Copyright 2015 Aidan Feldman - * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ - -/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ - -/* All levels of nav */ -nav[data-toggle='toc'] .nav > li > a { - display: block; - padding: 4px 20px; - font-size: 13px; - font-weight: 500; - color: #767676; -} -nav[data-toggle='toc'] .nav > li > a:hover, -nav[data-toggle='toc'] .nav > li > a:focus { - padding-left: 19px; - color: #563d7c; - text-decoration: none; - background-color: transparent; - border-left: 1px solid #563d7c; -} -nav[data-toggle='toc'] .nav > .active > a, -nav[data-toggle='toc'] .nav > .active:hover > a, -nav[data-toggle='toc'] .nav > .active:focus > a { - padding-left: 18px; - font-weight: bold; - color: #563d7c; - background-color: transparent; - border-left: 2px solid #563d7c; -} - -/* Nav: second level (shown on .active) */ -nav[data-toggle='toc'] .nav .nav { - display: none; /* Hide by default, but at >768px, show it */ - padding-bottom: 10px; -} -nav[data-toggle='toc'] .nav .nav > li > a { - padding-top: 1px; - padding-bottom: 1px; - padding-left: 30px; - font-size: 12px; - font-weight: normal; -} -nav[data-toggle='toc'] .nav .nav > li > a:hover, -nav[data-toggle='toc'] .nav .nav > li > a:focus { - padding-left: 29px; -} -nav[data-toggle='toc'] .nav .nav > .active > a, -nav[data-toggle='toc'] .nav .nav > .active:hover > a, -nav[data-toggle='toc'] .nav .nav > .active:focus > a { - padding-left: 28px; - font-weight: 500; -} - -/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ -nav[data-toggle='toc'] .nav > .active > ul { - display: block; -} diff --git a/docs/bootstrap-toc.js b/docs/bootstrap-toc.js deleted file mode 100644 index 1cdd573..0000000 --- a/docs/bootstrap-toc.js +++ /dev/null @@ -1,159 +0,0 @@ -/*! - * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) - * Copyright 2015 Aidan Feldman - * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ -(function() { - 'use strict'; - - window.Toc = { - helpers: { - // return all matching elements in the set, or their descendants - findOrFilter: function($el, selector) { - // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ - // http://stackoverflow.com/a/12731439/358804 - var $descendants = $el.find(selector); - return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); - }, - - generateUniqueIdBase: function(el) { - var text = $(el).text(); - var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); - return anchor || el.tagName.toLowerCase(); - }, - - generateUniqueId: function(el) { - var anchorBase = this.generateUniqueIdBase(el); - for (var i = 0; ; i++) { - var anchor = anchorBase; - if (i > 0) { - // add suffix - anchor += '-' + i; - } - // check if ID already exists - if (!document.getElementById(anchor)) { - return anchor; - } - } - }, - - generateAnchor: function(el) { - if (el.id) { - return el.id; - } else { - var anchor = this.generateUniqueId(el); - el.id = anchor; - return anchor; - } - }, - - createNavList: function() { - return $(''); - }, - - createChildNavList: function($parent) { - var $childList = this.createNavList(); - $parent.append($childList); - return $childList; - }, - - generateNavEl: function(anchor, text) { - var $a = $(''); - $a.attr('href', '#' + anchor); - $a.text(text); - var $li = $('
  • '); - $li.append($a); - return $li; - }, - - generateNavItem: function(headingEl) { - var anchor = this.generateAnchor(headingEl); - var $heading = $(headingEl); - var text = $heading.data('toc-text') || $heading.text(); - return this.generateNavEl(anchor, text); - }, - - // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). - getTopLevel: function($scope) { - for (var i = 1; i <= 6; i++) { - var $headings = this.findOrFilter($scope, 'h' + i); - if ($headings.length > 1) { - return i; - } - } - - return 1; - }, - - // returns the elements for the top level, and the next below it - getHeadings: function($scope, topLevel) { - var topSelector = 'h' + topLevel; - - var secondaryLevel = topLevel + 1; - var secondarySelector = 'h' + secondaryLevel; - - return this.findOrFilter($scope, topSelector + ',' + secondarySelector); - }, - - getNavLevel: function(el) { - return parseInt(el.tagName.charAt(1), 10); - }, - - populateNav: function($topContext, topLevel, $headings) { - var $context = $topContext; - var $prevNav; - - var helpers = this; - $headings.each(function(i, el) { - var $newNav = helpers.generateNavItem(el); - var navLevel = helpers.getNavLevel(el); - - // determine the proper $context - if (navLevel === topLevel) { - // use top level - $context = $topContext; - } else if ($prevNav && $context === $topContext) { - // create a new level of the tree and switch to it - $context = helpers.createChildNavList($prevNav); - } // else use the current $context - - $context.append($newNav); - - $prevNav = $newNav; - }); - }, - - parseOps: function(arg) { - var opts; - if (arg.jquery) { - opts = { - $nav: arg - }; - } else { - opts = arg; - } - opts.$scope = opts.$scope || $(document.body); - return opts; - } - }, - - // accepts a jQuery object, or an options object - init: function(opts) { - opts = this.helpers.parseOps(opts); - - // ensure that the data attribute is in place for styling - opts.$nav.attr('data-toggle', 'toc'); - - var $topContext = this.helpers.createChildNavList(opts.$nav); - var topLevel = this.helpers.getTopLevel(opts.$scope); - var $headings = this.helpers.getHeadings(opts.$scope, topLevel); - this.helpers.populateNav($topContext, topLevel, $headings); - } - }; - - $(function() { - $('nav[data-toggle="toc"]').each(function(i, el) { - var $nav = $(el); - Toc.init($nav); - }); - }); -})(); diff --git a/docs/docsearch.css b/docs/docsearch.css deleted file mode 100644 index e5f1fe1..0000000 --- a/docs/docsearch.css +++ /dev/null @@ -1,148 +0,0 @@ -/* Docsearch -------------------------------------------------------------- */ -/* - Source: https://github.com/algolia/docsearch/ - License: MIT -*/ - -.algolia-autocomplete { - display: block; - -webkit-box-flex: 1; - -ms-flex: 1; - flex: 1 -} - -.algolia-autocomplete .ds-dropdown-menu { - width: 100%; - min-width: none; - max-width: none; - padding: .75rem 0; - background-color: #fff; - background-clip: padding-box; - border: 1px solid rgba(0, 0, 0, .1); - box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); -} - -@media (min-width:768px) { - .algolia-autocomplete .ds-dropdown-menu { - width: 175% - } -} - -.algolia-autocomplete .ds-dropdown-menu::before { - display: none -} - -.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { - padding: 0; - background-color: rgb(255,255,255); - border: 0; - max-height: 80vh; -} - -.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { - margin-top: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion { - padding: 0; - overflow: visible -} - -.algolia-autocomplete .algolia-docsearch-suggestion--category-header { - padding: .125rem 1rem; - margin-top: 0; - font-size: 1.3em; - font-weight: 500; - color: #00008B; - border-bottom: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { - float: none; - padding-top: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { - float: none; - width: auto; - padding: 0; - text-align: left -} - -.algolia-autocomplete .algolia-docsearch-suggestion--content { - float: none; - width: auto; - padding: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--content::before { - display: none -} - -.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { - padding-top: .75rem; - margin-top: .75rem; - border-top: 1px solid rgba(0, 0, 0, .1) -} - -.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { - display: block; - padding: .1rem 1rem; - margin-bottom: 0.1; - font-size: 1.0em; - font-weight: 400 - /* display: none */ -} - -.algolia-autocomplete .algolia-docsearch-suggestion--title { - display: block; - padding: .25rem 1rem; - margin-bottom: 0; - font-size: 0.9em; - font-weight: 400 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--text { - padding: 0 1rem .5rem; - margin-top: -.25rem; - font-size: 0.8em; - font-weight: 400; - line-height: 1.25 -} - -.algolia-autocomplete .algolia-docsearch-footer { - width: 110px; - height: 20px; - z-index: 3; - margin-top: 10.66667px; - float: right; - font-size: 0; - line-height: 0; -} - -.algolia-autocomplete .algolia-docsearch-footer--logo { - background-image: url("data:image/svg+xml;utf8,"); - background-repeat: no-repeat; - background-position: 50%; - background-size: 100%; - overflow: hidden; - text-indent: -9000px; - width: 100%; - height: 100%; - display: block; - transform: translate(-8px); -} - -.algolia-autocomplete .algolia-docsearch-suggestion--highlight { - color: #FF8C00; - background: rgba(232, 189, 54, 0.1) -} - - -.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { - box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) -} - -.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { - background-color: rgba(192, 192, 192, .15) -} diff --git a/docs/docsearch.js b/docs/docsearch.js deleted file mode 100644 index b35504c..0000000 --- a/docs/docsearch.js +++ /dev/null @@ -1,85 +0,0 @@ -$(function() { - - // register a handler to move the focus to the search bar - // upon pressing shift + "/" (i.e. "?") - $(document).on('keydown', function(e) { - if (e.shiftKey && e.keyCode == 191) { - e.preventDefault(); - $("#search-input").focus(); - } - }); - - $(document).ready(function() { - // do keyword highlighting - /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ - var mark = function() { - - var referrer = document.URL ; - var paramKey = "q" ; - - if (referrer.indexOf("?") !== -1) { - var qs = referrer.substr(referrer.indexOf('?') + 1); - var qs_noanchor = qs.split('#')[0]; - var qsa = qs_noanchor.split('&'); - var keyword = ""; - - for (var i = 0; i < qsa.length; i++) { - var currentParam = qsa[i].split('='); - - if (currentParam.length !== 2) { - continue; - } - - if (currentParam[0] == paramKey) { - keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); - } - } - - if (keyword !== "") { - $(".contents").unmark({ - done: function() { - $(".contents").mark(keyword); - } - }); - } - } - }; - - mark(); - }); -}); - -/* Search term highlighting ------------------------------*/ - -function matchedWords(hit) { - var words = []; - - var hierarchy = hit._highlightResult.hierarchy; - // loop to fetch from lvl0, lvl1, etc. - for (var idx in hierarchy) { - words = words.concat(hierarchy[idx].matchedWords); - } - - var content = hit._highlightResult.content; - if (content) { - words = words.concat(content.matchedWords); - } - - // return unique words - var words_uniq = [...new Set(words)]; - return words_uniq; -} - -function updateHitURL(hit) { - - var words = matchedWords(hit); - var url = ""; - - if (hit.anchor) { - url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; - } else { - url = hit.url + '?q=' + escape(words.join(" ")); - } - - return url; -} diff --git a/docs/favicon-16x16.png b/docs/favicon-16x16.png deleted file mode 100644 index f2a16cf..0000000 Binary files a/docs/favicon-16x16.png and /dev/null differ diff --git a/docs/favicon-32x32.png b/docs/favicon-32x32.png deleted file mode 100644 index c487a78..0000000 Binary files a/docs/favicon-32x32.png and /dev/null differ diff --git a/docs/favicon.ico b/docs/favicon.ico deleted file mode 100644 index daec89c..0000000 Binary files a/docs/favicon.ico and /dev/null differ diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index a96295e..0000000 --- a/docs/index.html +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - -NeuroAnatomy Toolbox (nat) Extension for Assessing Neuron Similarity - and Clustering • nat.nblast - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    -
    -
    - - - -

    nat.nblast is part of the NeuroAnatomy Toolbox suite of R packages.

    -
    -

    -Quick Start

    -

    For the impatient …

    -
    -# install
    -if (!require("devtools")) install.packages("devtools")
    -devtools::install_github(c("natverse/nat", "natverse/nat.nblast"))
    -
    -# use
    -library(nat.nblast)
    -
    -# run examples for search
    -example("nblast")
    -
    -# run examples for clustering
    -example("nhclust")
    -
    -# get overview help for package
    -?nat.nblast
    -# help for functions
    -?nblast
    -?nhclust
    -
    -# run tests
    -library(testthat)
    -test_package("nat.nblast")
    -
    -
    -

    -Introduction

    -

    This R package implements the NBLAST neuron similarity algorithm described in

    -

    Costa M, Manton JD, Ostrovsky AD, Prohaska S, Jefferis GS. NBLAST: Rapid, Sensitive Comparison of Neuronal Structure and Construction of Neuron Family Databases.Neuron. 2016 Jul 20;91(2):293-311. doi: 10.1016/j.neuron.2016.06.012.

    -

    In addition to basic pairwise comparison, the package implements search of databases of neurons. There is also support for all x all comparison for a group of neurons. This can produce a distance matrix suitable for hierarchical clustering, which is also implemented in the package.

    -

    These tools are designed as an addon for the NeuroAnatomy Toolbox (nat) R package, which will be installed as dependency.

    -

    You will probably find the following online documentation helpful:

    - -
    -
    -

    -Installation

    -

    This package has been released to CRAN (since v1.5), but we generally recommend installing the development version from GitHub, especially if you notice a bug.

    -
    -

    -CRAN release

    -
    -install.packages("nat.nblast")
    -
    -
    -

    -Development version

    -

    Use devtools to install the development version:

    -
    -# install devtools if required
    -if (!require("devtools")) install.packages("devtools")
    -# then nat.nblast
    -devtools::install_github("natverse/nat.nblast")
    -

    Note that this will also update the nat package to the latest development version from github. Windows users need Rtools to install this way.

    -
    -
    -
    -
    - - -
    - - -
    - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - diff --git a/docs/link.svg b/docs/link.svg deleted file mode 100644 index 88ad827..0000000 --- a/docs/link.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/docs/logo.svg b/docs/logo.svg deleted file mode 100644 index 2ae91fb..0000000 --- a/docs/logo.svg +++ /dev/null @@ -1 +0,0 @@ -Asset 49 \ No newline at end of file diff --git a/docs/news/index.html b/docs/news/index.html deleted file mode 100644 index 488b93d..0000000 --- a/docs/news/index.html +++ /dev/null @@ -1,280 +0,0 @@ - - - - - - - - -Changelog • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    -nat.nblast 1.6.6 Unreleased -

    -
      -
    • Keep scale factor when normalising (#38)
    • -
    • Doc fixes
    • -
    -
    -
    -

    -nat.nblast 1.6.4 Unreleased -

    -
      -
    • pkgdown documentation
    • -
    • use development version of nat package when doing install_github of nat.nblast
    • -
    • spelling
    • -
    -
    -
    -

    -nat.nblast 1.6.3 Unreleased -

    -
      -
    • fixes/examples for show_similarity
    • -
    • allow score matrices to be passed as first param to nhclust (but issue a warning)
    • -
    • change vignette engine to rmarkdown
    • -
    -
    -
    -

    -nat.nblast 1.6.2 2016-04-26 -

    -
      -
    • minor fixes for 3.3
    • -
    • add vignette
    • -
    • simplify travis setup
    • -
    -
    -
    -

    -nat.nblast 1.6.1 Unreleased -

    -
      -
    • dev: fix test for different normalisation types
    • -
    -
    -
    -

    -nat.nblast 1.6 Unreleased -

    -
      -
    • fix handling of non-square matrices in sub_score_mat
    • -
    • minor doc fixes
    • -
    -
    -
    -

    -nat.nblast 1.5 2014-09-19 -

    -
      -
    • switch from importing nat to depending on it
    • -
    -
    -
    -

    -nat.nblast 1.4 Unreleased -

    -
      -
    • use nabor package, not RANN, for finding nearest neighbours
    • -
    • add functions for creating sparse score matrices, using spam package
    • -
    • speed up extraction of diagonal elements for on-disk score matrices
    • -
    • nblast now handles all combinations of neuron and dotprops objects
    • -
    -
    -
    -

    -nat.nblast 1.3 Unreleased -

    -
      -
    • functions to create scoring matrices; see create_scoringmatrix for details.
    • -
    • fix: really use nhclust’s distfun argument
    • -
    • new nblast_allbyall function
    • -
    • add plyr support (gives parallelisation and progress bar options)
    • -
    -
    -
    -

    -nat.nblast 1.2 Unreleased -

    -
      -
    • add nhclust, plot3d.hclust, subset.hclust to help cluster/plot based on nblast scores (all ported from flycircuit package).
    • -
    • rename showSimilarity -> show_similarity
    • -
    • dev: make sure tests run during check()
    • -
    • test: update baselines given score matrix changes in 1.1
    • -
    -
    -
    -

    -nat.nblast 1.1 Unreleased -

    -
      -
    • fix: make smat.fcwb the default scoring matrix (rather than smat_alpha) when nblast’s UseAlpha parameter is FALSE (the default) and smat_alpha.fcwb the default when UseAlpha=TRUE.
    • -
    • rename smat->smat.fcwb and smat_alpha->smat_alpha.fcwb to make it clear that these are defined in the FCWB template space (though they should work OK for other fly template brains that have an absolute physical scale)
    • -
    • don’t set options(“nat.nblast.defaultsmat”"), just query it.
    • -
    • doc: basic package documentations
    • -
    -
    -
    - - - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/pkgdown.css b/docs/pkgdown.css deleted file mode 100644 index 1273238..0000000 --- a/docs/pkgdown.css +++ /dev/null @@ -1,367 +0,0 @@ -/* Sticky footer */ - -/** - * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ - * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css - * - * .Site -> body > .container - * .Site-content -> body > .container .row - * .footer -> footer - * - * Key idea seems to be to ensure that .container and __all its parents__ - * have height set to 100% - * - */ - -html, body { - height: 100%; -} - -body { - position: relative; -} - -body > .container { - display: flex; - height: 100%; - flex-direction: column; -} - -body > .container .row { - flex: 1 0 auto; -} - -footer { - margin-top: 45px; - padding: 35px 0 36px; - border-top: 1px solid #e5e5e5; - color: #666; - display: flex; - flex-shrink: 0; -} -footer p { - margin-bottom: 0; -} -footer div { - flex: 1; -} -footer .pkgdown { - text-align: right; -} -footer p { - margin-bottom: 0; -} - -img.icon { - float: right; -} - -img { - max-width: 100%; -} - -/* Fix bug in bootstrap (only seen in firefox) */ -summary { - display: list-item; -} - -/* Typographic tweaking ---------------------------------*/ - -.contents .page-header { - margin-top: calc(-60px + 1em); -} - -dd { - margin-left: 3em; -} - -/* Section anchors ---------------------------------*/ - -a.anchor { - margin-left: -30px; - display:inline-block; - width: 30px; - height: 30px; - visibility: hidden; - - background-image: url(./link.svg); - background-repeat: no-repeat; - background-size: 20px 20px; - background-position: center center; -} - -.hasAnchor:hover a.anchor { - visibility: visible; -} - -@media (max-width: 767px) { - .hasAnchor:hover a.anchor { - visibility: hidden; - } -} - - -/* Fixes for fixed navbar --------------------------*/ - -.contents h1, .contents h2, .contents h3, .contents h4 { - padding-top: 60px; - margin-top: -40px; -} - -/* Navbar submenu --------------------------*/ - -.dropdown-submenu { - position: relative; -} - -.dropdown-submenu>.dropdown-menu { - top: 0; - left: 100%; - margin-top: -6px; - margin-left: -1px; - border-radius: 0 6px 6px 6px; -} - -.dropdown-submenu:hover>.dropdown-menu { - display: block; -} - -.dropdown-submenu>a:after { - display: block; - content: " "; - float: right; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; - border-width: 5px 0 5px 5px; - border-left-color: #cccccc; - margin-top: 5px; - margin-right: -10px; -} - -.dropdown-submenu:hover>a:after { - border-left-color: #ffffff; -} - -.dropdown-submenu.pull-left { - float: none; -} - -.dropdown-submenu.pull-left>.dropdown-menu { - left: -100%; - margin-left: 10px; - border-radius: 6px 0 6px 6px; -} - -/* Sidebar --------------------------*/ - -#pkgdown-sidebar { - margin-top: 30px; - position: -webkit-sticky; - position: sticky; - top: 70px; -} - -#pkgdown-sidebar h2 { - font-size: 1.5em; - margin-top: 1em; -} - -#pkgdown-sidebar h2:first-child { - margin-top: 0; -} - -#pkgdown-sidebar .list-unstyled li { - margin-bottom: 0.5em; -} - -/* bootstrap-toc tweaks ------------------------------------------------------*/ - -/* All levels of nav */ - -nav[data-toggle='toc'] .nav > li > a { - padding: 4px 20px 4px 6px; - font-size: 1.5rem; - font-weight: 400; - color: inherit; -} - -nav[data-toggle='toc'] .nav > li > a:hover, -nav[data-toggle='toc'] .nav > li > a:focus { - padding-left: 5px; - color: inherit; - border-left: 1px solid #878787; -} - -nav[data-toggle='toc'] .nav > .active > a, -nav[data-toggle='toc'] .nav > .active:hover > a, -nav[data-toggle='toc'] .nav > .active:focus > a { - padding-left: 5px; - font-size: 1.5rem; - font-weight: 400; - color: inherit; - border-left: 2px solid #878787; -} - -/* Nav: second level (shown on .active) */ - -nav[data-toggle='toc'] .nav .nav { - display: none; /* Hide by default, but at >768px, show it */ - padding-bottom: 10px; -} - -nav[data-toggle='toc'] .nav .nav > li > a { - padding-left: 16px; - font-size: 1.35rem; -} - -nav[data-toggle='toc'] .nav .nav > li > a:hover, -nav[data-toggle='toc'] .nav .nav > li > a:focus { - padding-left: 15px; -} - -nav[data-toggle='toc'] .nav .nav > .active > a, -nav[data-toggle='toc'] .nav .nav > .active:hover > a, -nav[data-toggle='toc'] .nav .nav > .active:focus > a { - padding-left: 15px; - font-weight: 500; - font-size: 1.35rem; -} - -/* orcid ------------------------------------------------------------------- */ - -.orcid { - font-size: 16px; - color: #A6CE39; - /* margins are required by official ORCID trademark and display guidelines */ - margin-left:4px; - margin-right:4px; - vertical-align: middle; -} - -/* Reference index & topics ----------------------------------------------- */ - -.ref-index th {font-weight: normal;} - -.ref-index td {vertical-align: top; min-width: 100px} -.ref-index .icon {width: 40px;} -.ref-index .alias {width: 40%;} -.ref-index-icons .alias {width: calc(40% - 40px);} -.ref-index .title {width: 60%;} - -.ref-arguments th {text-align: right; padding-right: 10px;} -.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px} -.ref-arguments .name {width: 20%;} -.ref-arguments .desc {width: 80%;} - -/* Nice scrolling for wide elements --------------------------------------- */ - -table { - display: block; - overflow: auto; -} - -/* Syntax highlighting ---------------------------------------------------- */ - -pre { - word-wrap: normal; - word-break: normal; - border: 1px solid #eee; -} - -pre, code { - background-color: #f8f8f8; - color: #333; -} - -pre code { - overflow: auto; - word-wrap: normal; - white-space: pre; -} - -pre .img { - margin: 5px 0; -} - -pre .img img { - background-color: #fff; - display: block; - height: auto; -} - -code a, pre a { - color: #375f84; -} - -a.sourceLine:hover { - text-decoration: none; -} - -.fl {color: #1514b5;} -.fu {color: #000000;} /* function */ -.ch,.st {color: #036a07;} /* string */ -.kw {color: #264D66;} /* keyword */ -.co {color: #888888;} /* comment */ - -.message { color: black; font-weight: bolder;} -.error { color: orange; font-weight: bolder;} -.warning { color: #6A0366; font-weight: bolder;} - -/* Clipboard --------------------------*/ - -.hasCopyButton { - position: relative; -} - -.btn-copy-ex { - position: absolute; - right: 0; - top: 0; - visibility: hidden; -} - -.hasCopyButton:hover button.btn-copy-ex { - visibility: visible; -} - -/* headroom.js ------------------------ */ - -.headroom { - will-change: transform; - transition: transform 200ms linear; -} -.headroom--pinned { - transform: translateY(0%); -} -.headroom--unpinned { - transform: translateY(-100%); -} - -/* mark.js ----------------------------*/ - -mark { - background-color: rgba(255, 255, 51, 0.5); - border-bottom: 2px solid rgba(255, 153, 51, 0.3); - padding: 1px; -} - -/* vertical spacing after htmlwidgets */ -.html-widget { - margin-bottom: 10px; -} - -/* fontawesome ------------------------ */ - -.fab { - font-family: "Font Awesome 5 Brands" !important; -} - -/* don't display links in code chunks when printing */ -/* source: https://stackoverflow.com/a/10781533 */ -@media print { - code a:link:after, code a:visited:after { - content: ""; - } -} diff --git a/docs/pkgdown.js b/docs/pkgdown.js deleted file mode 100644 index 7e7048f..0000000 --- a/docs/pkgdown.js +++ /dev/null @@ -1,108 +0,0 @@ -/* http://gregfranko.com/blog/jquery-best-practices/ */ -(function($) { - $(function() { - - $('.navbar-fixed-top').headroom(); - - $('body').css('padding-top', $('.navbar').height() + 10); - $(window).resize(function(){ - $('body').css('padding-top', $('.navbar').height() + 10); - }); - - $('[data-toggle="tooltip"]').tooltip(); - - var cur_path = paths(location.pathname); - var links = $("#navbar ul li a"); - var max_length = -1; - var pos = -1; - for (var i = 0; i < links.length; i++) { - if (links[i].getAttribute("href") === "#") - continue; - // Ignore external links - if (links[i].host !== location.host) - continue; - - var nav_path = paths(links[i].pathname); - - var length = prefix_length(nav_path, cur_path); - if (length > max_length) { - max_length = length; - pos = i; - } - } - - // Add class to parent
  • , and enclosing
  • if in dropdown - if (pos >= 0) { - var menu_anchor = $(links[pos]); - menu_anchor.parent().addClass("active"); - menu_anchor.closest("li.dropdown").addClass("active"); - } - }); - - function paths(pathname) { - var pieces = pathname.split("/"); - pieces.shift(); // always starts with / - - var end = pieces[pieces.length - 1]; - if (end === "index.html" || end === "") - pieces.pop(); - return(pieces); - } - - // Returns -1 if not found - function prefix_length(needle, haystack) { - if (needle.length > haystack.length) - return(-1); - - // Special case for length-0 haystack, since for loop won't run - if (haystack.length === 0) { - return(needle.length === 0 ? 0 : -1); - } - - for (var i = 0; i < haystack.length; i++) { - if (needle[i] != haystack[i]) - return(i); - } - - return(haystack.length); - } - - /* Clipboard --------------------------*/ - - function changeTooltipMessage(element, msg) { - var tooltipOriginalTitle=element.getAttribute('data-original-title'); - element.setAttribute('data-original-title', msg); - $(element).tooltip('show'); - element.setAttribute('data-original-title', tooltipOriginalTitle); - } - - if(ClipboardJS.isSupported()) { - $(document).ready(function() { - var copyButton = ""; - - $(".examples, div.sourceCode").addClass("hasCopyButton"); - - // Insert copy buttons: - $(copyButton).prependTo(".hasCopyButton"); - - // Initialize tooltips: - $('.btn-copy-ex').tooltip({container: 'body'}); - - // Initialize clipboard: - var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { - text: function(trigger) { - return trigger.parentNode.textContent; - } - }); - - clipboardBtnCopies.on('success', function(e) { - changeTooltipMessage(e.trigger, 'Copied!'); - e.clearSelection(); - }); - - clipboardBtnCopies.on('error', function() { - changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); - }); - }); - } -})(window.jQuery || window.$) diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml deleted file mode 100644 index d67253c..0000000 --- a/docs/pkgdown.yml +++ /dev/null @@ -1,7 +0,0 @@ -pandoc: 2.11.4 -pkgdown: 1.6.1 -pkgdown_sha: ~ -articles: - NBLAST-Clustering: NBLAST-Clustering.html -last_built: 2021-06-16T14:01Z - diff --git a/docs/reference/NeuriteBlast.html b/docs/reference/NeuriteBlast.html deleted file mode 100644 index 70584cf..0000000 --- a/docs/reference/NeuriteBlast.html +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - - - -Produce similarity score for neuron morphologies — NeuriteBlast • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    A low-level entry point to the NBLAST algorithm that compares the morphology -of a neuron with those of a list of other neurons. For most use cases, one -would probably wish to use nblast instead.

    -
    - -
    NeuriteBlast(
    -  query,
    -  target,
    -  targetBinds = NULL,
    -  normalised = FALSE,
    -  OmitFailures = NA,
    -  simplify = TRUE,
    -  ...
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    query

    either a single query neuron or a neuronlist

    target

    a neuronlist to compare neuron against.

    targetBinds

    numeric indices or names with which to subset -target.

    normalised

    whether to divide scores by the self-match score of the -query

    OmitFailures

    Whether to omit neurons for which FUN gives an -error. The default value (NA) will result in nblast stopping -with an error message the moment there is an error. For other values, see -details.

    simplify

    whether to simplify the scores from a list to a vector. -TRUE by default. The only time you might want to set this false is -if you are collecting something other than simple scores from the search -function. See simplify2array for further details.

    ...

    extra arguments to pass to the distance function.

    - -

    Value

    - -

    Named list of similarity scores.

    -

    Details

    - -

    For detailed description of the OmitFailures argument, see - the details section of nblast.

    -

    See also

    - - - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/Rplot001.png b/docs/reference/Rplot001.png deleted file mode 100644 index 17a3580..0000000 Binary files a/docs/reference/Rplot001.png and /dev/null differ diff --git a/docs/reference/Rplot002.png b/docs/reference/Rplot002.png deleted file mode 100644 index 3d26beb..0000000 Binary files a/docs/reference/Rplot002.png and /dev/null differ diff --git a/docs/reference/Rplot003.png b/docs/reference/Rplot003.png deleted file mode 100644 index be01a0c..0000000 Binary files a/docs/reference/Rplot003.png and /dev/null differ diff --git a/docs/reference/WeightedNNBasedLinesetMatching-1.png b/docs/reference/WeightedNNBasedLinesetMatching-1.png deleted file mode 100644 index 9b69816..0000000 Binary files a/docs/reference/WeightedNNBasedLinesetMatching-1.png and /dev/null differ diff --git a/docs/reference/WeightedNNBasedLinesetMatching.html b/docs/reference/WeightedNNBasedLinesetMatching.html deleted file mode 100644 index 02613ee..0000000 --- a/docs/reference/WeightedNNBasedLinesetMatching.html +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - - - -Compute point & tangent vector similarity score between two linesets — WeightedNNBasedLinesetMatching • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    WeightedNNBasedLinesetMatching is a low level function - that is called by nblast. Most end users will not usually - need to call it directly. It does allow the results of an NBLAST comparison - to be inspected in further detail (see examples).

    -
    - -
    WeightedNNBasedLinesetMatching(target, query, ...)
    -
    -# S3 method for dotprops
    -WeightedNNBasedLinesetMatching(target, query, UseAlpha = FALSE, ...)
    -
    -# S3 method for neuron
    -WeightedNNBasedLinesetMatching(
    -  target,
    -  query,
    -  UseAlpha = FALSE,
    -  OnlyClosestPoints = FALSE,
    -  ...
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    target, query

    dotprops or neuron objects to -compare (must be of the same class)

    ...

    extra arguments to pass to the distance function.

    UseAlpha

    Whether to scale dot product of tangent vectors (default=F)

    OnlyClosestPoints

    Whether to restrict searches to the closest points -in the target (default FALSE, only implemented for dotprops).

    - -

    Value

    - -

    Value of NNDistFun passed to - WeightedNNBasedLinesetMatching

    -

    Details

    - -

    WeightedNNBasedLinesetMatching will work with 2 objects of - class dotprops or neuron. The code to calculate scores - directly for neuron objects gives broadly comparable scores to that - for dotprops objects, but has been lightly tested. Furthermore only - objects in dotprops form were used in the construction of the - scoring matrices distributed in this package. It is therefore recommended - to convert neuron objects to dotprops objects using the - dotprops function.

    -

    UseAlpha determines whether the alpha values - (eig1-eig2)/sum(eig1:3) are passed on to - WeightedNNBasedLinesetMatching. These will be used to scale the dot - products of the direction vectors for nearest neighbour pairs.

    -

    See also

    - - - -

    Examples

    -
    # Retrieve per segment distances / absolute dot products -segvals=WeightedNNBasedLinesetMatching(kcs20[[1]], kcs20[[2]], NNDistFun=list) -names(segvals)=c("dist", "adotprod") -pairs(segvals) -
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/calc_dists_dotprods.html b/docs/reference/calc_dists_dotprods.html deleted file mode 100644 index 5da1b47..0000000 --- a/docs/reference/calc_dists_dotprods.html +++ /dev/null @@ -1,225 +0,0 @@ - - - - - - - - -Calculate distances and dot products between two sets of neurons — calc_dists_dotprods • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Calculate distances and dot products between two sets of neurons

    -
    - -
    calc_dists_dotprods(
    -  query_neurons,
    -  target_neurons,
    -  subset = NULL,
    -  ignoreSelf = TRUE,
    -  ...
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    query_neurons

    a neuronlist to use for calculating -distances and dot products.

    target_neurons

    a further neuronlist to use for -calculating distances and dot products.

    subset

    a data.frame specifying which neurons in -query_neurons and target_neurons should be compared, with -columns specifying query and target neurons by name, with one row for each -pair. If unspecified, this defaults to an all-by-all comparison.

    ignoreSelf

    a Boolean indicating whether to ignore comparisons of a -neuron against itself (default TRUE).

    ...

    extra arguments to pass to NeuriteBlast.

    - -

    Value

    - -

    A list, one element for for pair of neurons with a 2 column - data.frame containing one column of distances and another of absolute dot - products.

    -

    Details

    - -

    Distances and dot products are the raw inputs for constructing - scoring matrices for the NBLAST search algorithm.

    - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/calc_prob_mat.html b/docs/reference/calc_prob_mat.html deleted file mode 100644 index e7fb2f4..0000000 --- a/docs/reference/calc_prob_mat.html +++ /dev/null @@ -1,225 +0,0 @@ - - - - - - - - -Calculate probability matrix from distances and dot products between neuron -segments — calc_prob_mat • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Calculate probability matrix from distances and dot products between neuron -segments

    -
    - -
    calc_prob_mat(
    -  nndists,
    -  dotprods,
    -  distbreaks,
    -  dotprodbreaks = seq(0, 1, by = 0.1),
    -  ReturnCounts = FALSE
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    nndists

    a list of nearest-neighbour distances or a list of both -nearest-neighbour distances and dot products.

    dotprods

    a list of dot products.

    distbreaks

    a vector specifying the breaks for distances in the -probability matrix.

    dotprodbreaks

    a vector specifying the breaks for dot products in the -probability matrix.

    ReturnCounts

    a Boolean indicating that counts should be returned -instead of the default probabilities.

    - -

    Value

    - -

    A matrix with columns as specified by dotprodbreaks and rows - as specified by distbreaks, containing probabilities (for default - value of ReturnCounts=TRUE) or counts (if ReturnCounts=TRUE) - for finding neuron segments with the given distance and dot product.

    - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/calc_score_matrix.html b/docs/reference/calc_score_matrix.html deleted file mode 100644 index 0b869ec..0000000 --- a/docs/reference/calc_score_matrix.html +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - - - -Calculate scoring matrix from probability matrices for matching and -non-matching sets of neurons — calc_score_matrix • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Calculate scoring matrix from probability matrices for matching and -non-matching sets of neurons

    -
    - -
    calc_score_matrix(matchmat, randmat, logbase = 2, epsilon = 1e-06)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    matchmat

    a probability matrix given by considering 'matching' neurons.

    randmat

    a probability matrix given by considering 'non-matching' or -'random' neurons.

    logbase

    the base to which the logarithm should be taken to produce the -final scores.

    epsilon

    a pseudocount to prevent division by zero when constructing -the log odds ratio in the probability matrix.

    - -

    Value

    - -

    A matrix with with class=c("scoringmatrix", "table"), with - columns as specified by dotprodbreaks and rows as specified by - distbreaks, containing scores for neuron segments with the given - distance and dot product.

    - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/create_scoringmatrix-1.png b/docs/reference/create_scoringmatrix-1.png deleted file mode 100644 index 5a1dcb8..0000000 Binary files a/docs/reference/create_scoringmatrix-1.png and /dev/null differ diff --git a/docs/reference/create_scoringmatrix.html b/docs/reference/create_scoringmatrix.html deleted file mode 100644 index 7684d8e..0000000 --- a/docs/reference/create_scoringmatrix.html +++ /dev/null @@ -1,308 +0,0 @@ - - - - - - - - -Create a scoring matrix given matching and non-matching sets of neurons — create_scoringmatrix • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Calculate a scoring matrix embodying the logarithm of the odds - that a matching pair of neurite segments come from a structurally related - rather than random pair of neurons. This function embodies sensible default - behaviours and is recommended for end users. More control is available by - using the individual functions listed in See Also.

    -
    - -
    create_scoringmatrix(
    -  matching_neurons,
    -  nonmatching_neurons,
    -  matching_subset = NULL,
    -  non_matching_subset = NULL,
    -  ignoreSelf = TRUE,
    -  distbreaks,
    -  dotprodbreaks = seq(0, 1, by = 0.1),
    -  logbase = 2,
    -  epsilon = 1e-06,
    -  ...
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    matching_neurons

    a neuronlist of matching neurons.

    nonmatching_neurons

    a neuronlist of non-matching -neurons.

    matching_subset, non_matching_subset

    data.frames indicating which pairs -of neurons in the two input neuron lists should be used to generate the -matching and null distributions. See details for the default behaviour when -NULL.

    ignoreSelf

    a Boolean indicating whether to ignore comparisons of a -neuron against itself (default TRUE).

    distbreaks

    a vector specifying the breaks for distances in the -probability matrix.

    dotprodbreaks

    a vector specifying the breaks for dot products in the -probability matrix.

    logbase

    the base to which the logarithm should be taken to produce the -final scores.

    epsilon

    a pseudocount to prevent division by zero when constructing -the log odds ratio in the probability matrix.

    ...

    extra arguments to pass to NeuriteBlast or options -for the call to mlply call that actually iterates over -neuron pairs.

    - -

    Value

    - -

    A matrix with columns as specified by dotprodbreaks and rows - as specified by distbreaks, containing log odd scores for neuron - segments with the given distance and dot product.

    -

    Details

    - -

    By default create_scoringmatrix will use all neurons in - matching_neurons to create the matching distribution. This is - appropriate if all of these neurons are of a single type. If you wish to - use multiple types of neurons then you will need to specify a - matching_subset to indicate which pairs of neurons are of the same - type.

    -

    By default create_scoringmatrix will use a random set of pairs from - non_matching_neurons to create the null distribution. The number of - random pairs will be equal to the number of matching pairs defined by - matching_neurons This is appropriate if non_matching_neurons - contains a large collection of neurons of different types. You may wish to - set the random seed using set.seed if you want to ensure that - exactly the same (pseudo-)random pairs of neurons are used in subsequent - calls.

    -

    See also

    - - - -

    Examples

    -
    # \donttest{ -# calculate scoring matrix -# bring in some mushroom body neurons -library(nat) -data(kcs20) -# convert the (connected) tracings into dotprops (point and vector) -# representation, resampling at 1 micron intervals along neuron -fctraces20.dps=dotprops(fctraces20, resample=1) -# we will use both all kcs vs all fctraces20 and fctraces20 vs fctraces20 -# as random_pairs to make the null distribution -random_pairs=rbind(neuron_pairs(fctraces20), neuron_pairs(nat::kcs20, fctraces20)) -# you can add .progress='natprogress' if this looks like taking a while -smat=create_scoringmatrix(kcs20, c(kcs20, fctraces20.dps), - non_matching_subset=random_pairs) - -# now plot the scoring matrix -distbreaks=attr(smat,'distbreaks') -distbreaks=distbreaks[-length(distbreaks)] -dotprodbreaks=attr(smat,'dotprodbreaks')[-1] -# Create a function interpolating colors in the range of specified colors -jet.colors <- colorRampPalette( c("blue", "green", "yellow", "red") ) -# 2d filled contour plot of scoring matrix. Notice that the there is a region -# at small distances and large abs dot product with the highest log odds ratio -# i.e. most indicative of a match rather than non-match -filled.contour(x=distbreaks, y=dotprodbreaks, z=smat, col=jet.colors(20), - main='smat: log odds ratio', xlab='distance /um', ylab='abs dot product') -
    -# 3d perspective plot of the scoring matrix -persp3d(x=distbreaks, y=dotprodbreaks, z=smat, col=jet.colors(20)[cut(smat,20)], -xlab='distance /um', ylab='abs dot product', zlab='log odds ratio') -# } -
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/diagonal.html b/docs/reference/diagonal.html deleted file mode 100644 index 7844245..0000000 --- a/docs/reference/diagonal.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - - - -Extract diagonal terms from a variety of matrix types — diagonal • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Extract diagonal terms from a variety of matrix types

    -
    - -
    diagonal(x, indices = NULL)
    -
    -# S3 method for default
    -diagonal(x, indices = NULL)
    - -

    Arguments

    - - - - - - - - - - -
    x

    A square matrix

    indices

    specifies a subset of the diagonal using a character vector of -names, a logical vector or integer indices. The default (NULL) -implies all elements.

    - -

    Value

    - -

    a named vector containing the diagonal elements.

    -

    Details

    - -

    Insists that input matrix is square. Uses the 'diagonal' - attribute when available and has specialised handling of ff, - big.matrix, dgCMatrix matrices. Does not check that row and - column names are identical for those matrix classes (unlike the base - diag function, but always uses rownames.

    - -

    Examples

    -
    m=fill_in_sparse_score_mat(letters[1:5]) -diagonal(m) -
    #> a b c d e -#> 0 0 0 0 0
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/extract-methods.html b/docs/reference/extract-methods.html deleted file mode 100644 index 420f276..0000000 --- a/docs/reference/extract-methods.html +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - - - -Extract parts of a sparse spam matrix — [ • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Extract parts of a sparse spam matrix

    -
    - -
    # S4 method for spam,character,character,logical
    -[(x, i, j, ..., drop = TRUE)
    -
    -# S4 method for spam,character,character,missing
    -[(x, i, j, ..., drop = TRUE)
    -
    -# S4 method for spam,character,missing,logical
    -[(x, i, j, ..., drop = TRUE)
    -
    -# S4 method for spam,character,missing,missing
    -[(x, i, j, ..., drop = TRUE)
    -
    -# S4 method for spam,missing,character,logical
    -[(x, i, j, ..., drop = TRUE)
    -
    -# S4 method for spam,missing,character,missing
    -[(x, i, j, ..., drop = TRUE)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    x

    object to extract from.

    i

    row identifiers.

    j

    column identifiers.

    ...

    additional arguments.

    drop

    logical indicating that dimensions should be dropped.

    - - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/fctraces20.html b/docs/reference/fctraces20.html deleted file mode 100644 index 2545254..0000000 --- a/docs/reference/fctraces20.html +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - - - -20 traced Drosophila neurons from Chiang et al 2011 — fctraces20 • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    This R list (which has additional class neuronlist) contains 15 -skeletonized Drosophila neurons as dotprops objects. Original -data is due to Chiang et al. [1], who have generously shared their raw data -at http://flycircuit.tw. Automated tracing of neuron skeletons was -carried out by Lee et al [2]. Image registration and further processing was -carried out by Greg Jefferis, Marta Costa and James Manton[3].

    -
    - - - -

    References

    - -

    [1] Chiang A.S., Lin C.Y., Chuang C.C., Chang H.M., Hsieh C.H., - Yeh C.W., Shih C.T., Wu J.J., Wang G.T., Chen Y.C., Wu C.C., Chen G.Y., - Ching Y.T., Lee P.C., Lin C.Y., Lin H.H., Wu C.C., Hsu H.W., Huang Y.A., - Chen J.Y., et al. (2011). Three-dimensional reconstruction of brain-wide - wiring networks in Drosophila at single-cell resolution. Curr Biol 21 (1), - 1--11. doi: http://doi.org/10.1016/j.cub.2010.11.056

    -

    [2] P.-C. Lee, C.-C. Chuang, A.-S. Chiang, and Y.-T. Ching. (2012). - High-throughput computer method for 3d neuronal structure reconstruction - from the image stack of the Drosophila brain and its applications. PLoS - Comput Biol, 8(9):e1002658, Sep 2012. doi: - http://doi.org/10.1371/journal.pcbi.1002658.

    -

    [3] NBLAST: Rapid, sensitive comparison of neuronal structure and - construction of neuron family databases. Marta Costa, Aaron D. Ostrovsky, - James D. Manton, Steffen Prohaska, Gregory S.X.E. Jefferis. bioRxiv doi: - http://doi.org/10.1101/006346.

    - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/figures/logo.svg b/docs/reference/figures/logo.svg deleted file mode 100644 index 2ae91fb..0000000 --- a/docs/reference/figures/logo.svg +++ /dev/null @@ -1 +0,0 @@ -Asset 49 \ No newline at end of file diff --git a/docs/reference/fill_in_sparse_score_mat.html b/docs/reference/fill_in_sparse_score_mat.html deleted file mode 100644 index d500af9..0000000 --- a/docs/reference/fill_in_sparse_score_mat.html +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - -Add one or more submatrices to a sparse score matrix — fill_in_sparse_score_mat • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Add one or more submatrices to a sparse score matrix

    -
    - -
    fill_in_sparse_score_mat(sparse_matrix, ..., diag = NULL)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    sparse_matrix

    either an existing (square) sparse matrix or a character -vector of names that will be used to define an empty sparse matrix.

    ...

    Additional matrices to insert into sparse_matrix. Row and -column names must have matches in sparse_matrix.

    diag

    optional full diagonal for sparse matrix i.e. self-match scores.

    - -

    See also

    - -

    sparse_score_mat

    - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/fill_pairs_sparse_score_mat.html b/docs/reference/fill_pairs_sparse_score_mat.html deleted file mode 100644 index 80e9559..0000000 --- a/docs/reference/fill_pairs_sparse_score_mat.html +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - -Add forwards, reverse and self scores for a pair of neurons to a sparse score matrix — fill_pairs_sparse_score_mat • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Add forwards, reverse and self scores for a pair of neurons to a sparse score matrix

    -
    - -
    fill_pairs_sparse_score_mat(
    -  sparse_matrix,
    -  n1,
    -  n2,
    -  dense_matrix,
    -  reverse = TRUE,
    -  self = TRUE,
    -  reverse_self = (reverse && self)
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    sparse_matrix

    the sparse matrix to fill in.

    n1

    the name of the query neuron.

    n2

    the name of the target neuron.

    dense_matrix

    the score matrix from which to extract scores.

    reverse

    logical indicating that the reverse score should also be filled in (default TRUE).

    self

    logical indicating that the self-score of the query should also be filled in (used for normalised scores; default TRUE).

    reverse_self

    logical indicating that the self-score of the target should also be filled in (used for mean scores; default TRUE).

    - -

    Value

    - -

    A sparse matrix (of class spam) with the specified score entries filled.

    - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/index.html b/docs/reference/index.html deleted file mode 100644 index e8a6107..0000000 --- a/docs/reference/index.html +++ /dev/null @@ -1,412 +0,0 @@ - - - - - - - - -Function reference • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    Package Overview

    -

    Provides an overview of key functions and classes

    -
    -

    nat.nblast-package

    -

    Neuron similarity, search and clustering tools

    -

    Key functions

    -

    The main entry points to neuron search and clustering

    -
    -

    nblast()

    -

    Calculate similarity score for neuron morphologies

    -

    nblast_allbyall()

    -

    Wrapper function to compute all by all NBLAST scores for a set of neurons

    -

    nhclust()

    -

    Cluster a set of neurons

    -

    Plotting results

    -

    Visualise pairwise neuron search or clustering results

    -
    -

    plot3d(<hclust>)

    -

    Methods to identify and plot groups of neurons cut from an hclust -object

    -

    show_similarity()

    -

    Display two neurons with segments in the query coloured by similarity

    -

    subset(<hclust>)

    -

    Return the labels of items in 1 or more groups cut from hclust object

    -

    Scoring Matrices

    -

    Calculate the scoring matrices that define NBLAST similarity

    -
    -

    create_scoringmatrix()

    -

    Create a scoring matrix given matching and non-matching sets of neurons

    -

    calc_score_matrix()

    -

    Calculate scoring matrix from probability matrices for matching and -non-matching sets of neurons

    -

    calc_prob_mat()

    -

    Calculate probability matrix from distances and dot products between neuron -segments

    -

    calc_dists_dotprods()

    -

    Calculate distances and dot products between two sets of neurons

    -

    smat.fcwb

    -

    Scoring matrices for neuron similarities in FCWB template brain

    -

    Mid level functions for result matrices

    -

    Functions that you might use to manipulate matrices containing all by all NBLAST results for use with other clustering strategies (besides nhclust)

    -
    -

    sub_score_mat()

    -

    Return scores (or distances) for given query and target neurons

    -

    sub_dist_mat()

    -

    Convert (a subset of) a raw score matrix to a distance matrix

    -

    sparse_score_mat()

    -

    Convert a subset of a square score matrix to a sparse representation

    -

    Low level search functions

    -

    Intended for developer use

    -
    -

    NeuriteBlast()

    -

    Produce similarity score for neuron morphologies

    -

    neuron_pairs()

    -

    Utility function to generate all or random pairs of neurons

    -

    WeightedNNBasedLinesetMatching()

    -

    Compute point & tangent vector similarity score between two linesets

    -

    fctraces20

    -

    20 traced Drosophila neurons from Chiang et al 2011

    -

    Matrix utility functions

    -

    Intended for developer use

    -
    -

    diagonal()

    -

    Extract diagonal terms from a variety of matrix types

    -

    `[`(<spam>,<character>,<character>,<logical>) `[`(<spam>,<character>,<character>,<missing>) `[`(<spam>,<character>,<missing>,<logical>) `[`(<spam>,<character>,<missing>,<missing>) `[`(<spam>,<missing>,<character>,<logical>) `[`(<spam>,<missing>,<character>,<missing>)

    -

    Extract parts of a sparse spam matrix

    -

    fill_in_sparse_score_mat()

    -

    Add one or more submatrices to a sparse score matrix

    -

    fill_pairs_sparse_score_mat()

    -

    Add forwards, reverse and self scores for a pair of neurons to a sparse score matrix

    -
    - - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/nat.nblast-package.html b/docs/reference/nat.nblast-package.html deleted file mode 100644 index 07f9835..0000000 --- a/docs/reference/nat.nblast-package.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - - - - - -Neuron similarity, search and clustering tools — nat.nblast-package • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -
    - - - - - - - - -

    The main entry point for similarity and search functions is - nblast. Traced neurons will normally be converted to the - dotprops format for search. When multiple neurons are - compared they should be in a neuronlist object.

    -

    The current NBLAST version (2) depends on a scoring matrix. Default - matrices trained using Drosophila neurons in the FCWB template brain - space are distributed with this package (see smat.fcwb); see - Scoring Matrices section below for creating new scoring matrices.

    -

    nblast makes use of a more flexible but more complicated function - NeuriteBlast which includes several additional options. The function - WeightedNNBasedLinesetMatching provides the primitive functionality - of finding the nearest neighbour distances and absolute dot products for - two sets of segments. Neither of these functions are intended for end use.

    -

    Calculating all by all similarity scores is facilitated by the - nblast_allbyall function which can take either a - neuronlist as input or a character vector naming (a subset) - of neurons in a (large) neuronlist. The - neuronlist containing the input neurons should be resident in - memory i.e. not the neuronlistfh.

    -

    Clustering

    - - - - -

    Once an all by all similarity score matrix is available it can be used as - the input to a variety of clustering algorithms. nhclust - provides a convenient wrapper for R's hierarchical clustering function - hclust. If you wish to use another clustering function, then - you can use the sub_dist_mat to convert a raw similarity - score matrix into a normalised distance matrix (or R dist - object) suitable for clustering. If you need a similarity matrix or want to - modify the normalisation then you can use sub_score_mat.

    -

    Note that raw NBLAST scores are not symmetric (i.e. S(A,B) is not equal to - S(B,A)) so before clustering we construct a symmetric similarity/distance - matrix 1/2 * ( S(A,B)/S(A,A) + S(B,A)/S(B,B) ). See - sub_score_mat's documentation for details.

    -

    Cached scores

    - - - - -

    Although NBLAST is fast and can be parallelised, it makes sense to cache to - disk all by all similarity scores for a group of neurons that will be - subject to repeated clustering or other analysis. The matrix can simply be - saved to disk and then reloaded using base R functions like - save and load. sub_score_mat and - sub_dist_mat can be used to extract a subset of scores from - this raw score matrix. For large matrices, the bigmemory or - ff packages allow matrices to be stored on disk and portions loaded - into memory on demand. sub_score_mat and - sub_dist_mat work equally well for regular in-memory matrices - and these disk-backed matrices.

    -

    To give an example, for 16,129 neurons from the flycircuit.tw dataset, the - 260,144,641 comparisons took about 250 hours of compute time (half a day on - ~20 cores). When saved to disk as single precision (i.e. 4 bytes per score) - ff matrix they occupy just over 1Gb.

    -

    Calculating scoring matrices

    - - - - -

    The NBLAST algorithm depends on appropriately calibrated scoring matrices. - These encapsulate the log odds ratio that a pair of segments come from two - structurally related neurons rather than two unrelated neurons, given the - observed distance and absolute dot product of the two segments. Scoring - matrices can be constructed using the create_scoringmatrix - function, supplying a set of matching neurons and a set of non-matching - neurons. See the create_scoringmatrix documentation for links to - lower-level functions that provide finer control over construction of the - scoring matrix.

    -

    Package Options

    - - - - -

    There is one package option nat.nblast.defaultsmat which is - NULL by default, but could for example be set to one of the scoring - matrices included with the package such as "smat.fcwb" or to a new - user-constructed matrix.

    -

    References

    - -

    Costa, M., Ostrovsky, A.D., Manton, J.D., Prohaska, S., and - Jefferis, G.S.X.E. (2014). NBLAST: Rapid, sensitive comparison of neuronal - structure and construction of neuron family databases. bioRxiv preprint. - doi: 10.1101/006346.

    -

    See also

    - - - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/nblast-1.png b/docs/reference/nblast-1.png deleted file mode 100644 index 9176016..0000000 Binary files a/docs/reference/nblast-1.png and /dev/null differ diff --git a/docs/reference/nblast-2.png b/docs/reference/nblast-2.png deleted file mode 100644 index 0abda26..0000000 Binary files a/docs/reference/nblast-2.png and /dev/null differ diff --git a/docs/reference/nblast-3.png b/docs/reference/nblast-3.png deleted file mode 100644 index 96afbaf..0000000 Binary files a/docs/reference/nblast-3.png and /dev/null differ diff --git a/docs/reference/nblast.html b/docs/reference/nblast.html deleted file mode 100644 index b45e359..0000000 --- a/docs/reference/nblast.html +++ /dev/null @@ -1,387 +0,0 @@ - - - - - - - - -Calculate similarity score for neuron morphologies — nblast • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Uses the NBLAST algorithm that compares the morphology of two neurons. For -more control over the parameters of the algorithm, see the arguments of -NeuriteBlast.

    -
    - -
    nblast(
    -  query,
    -  target = getOption("nat.default.neuronlist"),
    -  smat = NULL,
    -  sd = 3,
    -  version = c(2, 1),
    -  normalised = FALSE,
    -  UseAlpha = FALSE,
    -  OmitFailures = NA,
    -  ...
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    query

    the query neuron.

    target

    a neuronlist to compare neuron against. -Defaults to options("nat.default.neuronlist"). See -nat-package.

    smat

    the scoring matrix to use (see details)

    sd

    Standard deviation to use in distance dependence of NBLAST v1 -algorithm. Ignored when version=2.

    version

    the version of the algorithm to use (the default, 2, is the -latest).

    normalised

    whether to divide scores by the self-match score of the -query

    UseAlpha

    whether to weight the similarity score for each matched -segment to emphasise long range neurites rather then arbours (default: -FALSE, see UseAlpha section for details).

    OmitFailures

    Whether to omit neurons for which FUN gives an -error. The default value (NA) will result in nblast stopping -with an error message the moment there is an error. For other values, see -details.

    ...

    Additional arguments passed to NeuriteBlast or the -function used to compute scores from distances/dot products. (expert use -only).

    - -

    Value

    - -

    Named list of similarity scores.

    -

    Details

    - -

    when smat=NULL options("nat.nblast.defaultsmat") will - be checked and if NULL, then smat.fcwb or - smat_alpha.fcwb will be used depending on the value of - UseAlpha.

    -

    When OmitFailures is not NA, individual nblast calls will be - wrapped in try to ensure that failure for any single neuron does not - abort the whole nblast call. When OmitFailures=FALSE, missing - values will be left as NA. OmitFailures=TRUE is not (yet) - implemented. If you want to drop scores for neurons that failed you will - need to set OmitFailures=FALSE and then use na.omit or - similar to post-process the scores.

    -

    Note that when OmitFailures=FALSE error messages will not be printed - because the call is wrapped as try(expr, silent=TRUE).

    -

    Internally, the plyr package is used to provide options for - parallelising NBLAST and displaying progress. To display a progress bar as - the scores are computed, add .progress="natprogress" to the - arguments (non-text progress bars are available -- see - create_progress_bar). To parallelise, add - .parallel=TRUE to the arguments. In order to make use of parallel - calculation, you must register a parallel backend that will distribute the - computations. There are several possible backends, the simplest of which is - the multicore option made available by doMC, which spreads the load - across cores of the same machine. Before using this, the backend must be - registered using registerDoMC (see example below).

    -

    NBLAST Versions

    - -

    The nblast version argument presently - exposes two versions of the algorithm; both use the same core procedure of - aligning two vector clouds, segment by segment, and then computing the - distance and absolute dot product between the nearest segment in the target - neuron for every segment in the query neuron. However they differ - significantly in the procedure used to calculate a score using this set of - distances and absolute dot products.

    -

    Version 1 of the algorithm uses a standard deviation (argument - sd) as a user-supplied parameter for a negative exponential - weighting function that determines the relationship between score and the - distance between segments. This corresponds to the parameter \(\sigma\) - in the weighting function:

    -

    \(f=\sqrt{|\vec{u_{i}}\cdot\vec{v_{i}}|\exp\left(-d_{i}^{2}/2\sigma^{2}\right)}\)

    -

    This is the same approach described in Kohl et al 2013 and the similarity - scores in the interval (0,1) described in that paper can exactly - recapitulated by setting version=1 and normalised=TRUE.

    -

    Version 2 of the algorithm is described in Costa et al 2014. This - uses a more sophisticated and principled scoring approach based on a - log-odds ratio defined by the distribution of matches and non-matches in - sample data. This information is passed to the nblast function in - the form of a scoring matrix (which can be computed by - create_scoringmatrix); a default scoring matrix - smat.fcwb has been constructed for Drosophila neurons.

    -

    Which version should I use? You should use version 2 if you are - working with Drosophila neurons or you have sufficient training data - (in the form of validated matching and random neuron pairs to construct a - scoring matrix). If this is not the case, you can always fall back to - version 1, setting the free parameter (sd or \(\sigma\)) to a value that - encapsulates your understanding of the location precision of neurons in - your species/brain region of interest. In the fly brain we have used - \(\sigma=3\) microns, since previous estimates of the localisation of - identifiable features of neurons (Jefferis, Potter et al 2007) are of this - order.

    -

    UseAlpha

    - -

    In NBLAST v2, the alpha factor for a segment - indicates whether neighbouring segments are aligned in a similar direction - (as typical for e.g. a long range axonal projection) or randomly aligned - (as typical for dendritic arbours). See Costa et al. for details. Setting - UseAlpha=TRUE will emphasise the axon, primary neurite etc. of a - neuron. This can be a particularly useful option e.g. when you are - searching by a traced fragment that you know or suspect to follow an axon - tract.

    -

    References

    - -

    Kohl, J. Ostrovsky, A.D., Frechter, S., and Jefferis, G.S.X.E - (2013). A bidirectional circuit switch reroutes pheromone signals in male - and female brains. Cell 155 (7), 1610--23 - doi: - 10.1016/j.cell.2013.11.025.

    -

    Costa, M., Ostrovsky, A.D., Manton, J.D., Prohaska, S., and Jefferis, - G.S.X.E. (2014). NBLAST: Rapid, sensitive comparison of neuronal structure - and construction of neuron family databases. bioRxiv preprint. - doi: 10.1101/006346.

    -

    Jefferis G.S.X.E., Potter C.J., Chan A.M., Marin E.C., Rohlfing T., Maurer - C.R.J., and Luo L. (2007). Comprehensive maps of Drosophila higher - olfactory centers: spatially segregated fruit and pheromone representation. - Cell 128 (6), 1187--1203. - doi:10.1016/j.cell.2007.01.040

    -

    See also

    - - - -

    Examples

    -
    # load sample Kenyon cell data from nat package -data(kcs20, package='nat') -# search one neuron against all neurons -scores=nblast(kcs20[['GadMARCM-F000142_seg002']], kcs20) -# scores from best to worst, top hit is of course same neuron -sort(scores, decreasing = TRUE) -
    #> GadMARCM-F000142_seg002 ChaMARCM-F000586_seg002 GadMARCM-F000423_seg001 -#> 4043.1766 1914.8224 1772.8506 -#> GadMARCM-F000442_seg002 FruMARCM-M000115_seg001 FruMARCM-F000085_seg001 -#> 1007.4565 853.8108 713.2106 -#> FruMARCM-F001929_seg001 FruMARCM-F001494_seg002 GadMARCM-F000050_seg001 -#> 604.4071 481.4737 480.4146 -#> GadMARCM-F000071_seg001 FruMARCM-M001339_seg001 FruMARCM-F000188_seg001 -#> 448.1516 433.9340 404.0470 -#> GadMARCM-F000476_seg001 FruMARCM-F000270_seg001 FruMARCM-F000706_seg001 -#> 313.2021 254.7516 204.2116 -#> FruMARCM-M000842_seg002 FruMARCM-M001051_seg002 FruMARCM-M001205_seg002 -#> 196.4543 140.8164 -251.4999 -#> GadMARCM-F000122_seg001 FruMARCM-F001115_seg002 -#> -262.2352 -520.2581
    hist(scores, breaks=25, col='grey') -
    abline(v=1500, col='red') -
    -# plot query neuron -open3d() -
    #> glX -#> 2
    # plot top 3 hits (including self match with thicker lines) -plot3d(kcs20[which(sort(scores, decreasing = TRUE)>1500)], lwd=c(3,1,1)) -rest=names(which(scores<1500)) -plot3d(rest, db=kcs20, col='grey', lwd=0.5) - -# normalised scores (i.e. self match = 1) of all neurons vs each other -# note use of progress bar -scores.norm=nblast(kcs20, kcs20, normalised = TRUE, .progress="natprogress") -hist(scores.norm, breaks=25, col='grey') -
    # produce a heatmap from normalised scores -jet.colors <- colorRampPalette( c("blue", "green", "yellow", "red") ) -heatmap(scores.norm, labCol = with(kcs20,type), col=jet.colors(20), symm = TRUE) -
    -if (FALSE) { -# Parallelise NBLASTing across 4 cores using doMC package -library(doMC) -registerDoMC(4) -scores.norm2=nblast(kcs20, kcs20, normalised=TRUE, .parallel=TRUE) -stopifnot(all.equal(scores.norm2, scores.norm)) -} -
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/nblast_allbyall-1.png b/docs/reference/nblast_allbyall-1.png deleted file mode 100644 index fa33f5c..0000000 Binary files a/docs/reference/nblast_allbyall-1.png and /dev/null differ diff --git a/docs/reference/nblast_allbyall.html b/docs/reference/nblast_allbyall.html deleted file mode 100644 index f61dd20..0000000 --- a/docs/reference/nblast_allbyall.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - -Wrapper function to compute all by all NBLAST scores for a set of neurons — nblast_allbyall • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Calls nblast to compute the actual scores. Can accept - either a neuronlist or neuron names as a character vector. This is a thin - wrapper around nblast and its main advantage is the option of "mean" - normalisation for forward and reverse scores, which is the most sensible - input to give to a clustering algorithm as well as the choice of returning - a distance matrix.

    -
    - -
    nblast_allbyall(x, ...)
    -
    -# S3 method for character
    -nblast_allbyall(x, smat = NULL, db = getOption("nat.default.neuronlist"), ...)
    -
    -# S3 method for neuronlist
    -nblast_allbyall(
    -  x,
    -  smat = NULL,
    -  distance = FALSE,
    -  normalisation = c("raw", "normalised", "mean"),
    -  ...
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    x

    Input neurons (neuronlist or character vector)

    ...

    Additional arguments for methods or nblast

    smat

    the scoring matrix to use (see details of nblast -for meaning of default NULL value)

    db

    A neuronlist or a character vector naming one. -Defaults to value of options("nat.default.neuronlist")

    distance

    logical indicating whether to return distances or scores.

    normalisation

    the type of normalisation procedure that should be -carried out, selected from 'raw', 'normalised' or -'mean' (i.e. the average of normalised scores in both directions). -If distance=TRUE then this cannot be raw.

    - -

    Details

    - -

    Note that nat already provides a function - nhclust for clustering, which is a wrapper for R's - hclust function. nhclust actually expects raw scores - as input.

    -

    TODO

    - -

    It would be a good idea in the future to implement a parallel - version of this function.

    -

    See also

    - - - -

    Examples

    -
    library(nat) -kcs20.scoremat=nblast_allbyall(kcs20) -kcs20.hclust=nhclust(scoremat=kcs20.scoremat) -
    #> The "ward" method has been renamed to "ward.D"; note new "ward.D2"
    plot(kcs20.hclust) -
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/neuron_pairs.html b/docs/reference/neuron_pairs.html deleted file mode 100644 index 99cdb6f..0000000 --- a/docs/reference/neuron_pairs.html +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - - -Utility function to generate all or random pairs of neurons — neuron_pairs • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Utility function to generate all or random pairs of neurons

    -
    - -
    neuron_pairs(query, target, n = NA, ignoreSelf = TRUE)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    query, target

    either neuronlists or character vectors of -names. If target is missing, query will be used as both query and target.

    n

    number of random pairs to draw. When NA, the default, uses -expand.grid to draw all pairs.

    ignoreSelf

    Logical indicating whether to omit pairs consisting of the -same neuron (default TRUE).

    - -

    Value

    - -

    a data.frame with two character vector columns, query and target.

    -

    See also

    - - - -

    Examples

    -
    neuron_pairs(nat::kcs20, n=20) -
    #> query target -#> 1 FruMARCM-F000706_seg001 GadMARCM-F000142_seg002 -#> 2 FruMARCM-F000085_seg001 GadMARCM-F000071_seg001 -#> 3 FruMARCM-F000270_seg001 GadMARCM-F000122_seg001 -#> 4 FruMARCM-F001115_seg002 GadMARCM-F000050_seg001 -#> 5 FruMARCM-F001494_seg002 GadMARCM-F000476_seg001 -#> 6 FruMARCM-F001494_seg002 FruMARCM-M001051_seg002 -#> 7 GadMARCM-F000142_seg002 FruMARCM-M001051_seg002 -#> 8 FruMARCM-F001115_seg002 FruMARCM-M001339_seg001 -#> 9 ChaMARCM-F000586_seg002 GadMARCM-F000476_seg001 -#> 10 FruMARCM-F000270_seg001 GadMARCM-F000122_seg001 -#> 11 FruMARCM-F000270_seg001 FruMARCM-M000115_seg001 -#> 12 FruMARCM-F001494_seg002 FruMARCM-M001205_seg002 -#> 13 FruMARCM-F000706_seg001 FruMARCM-F001115_seg002 -#> 14 GadMARCM-F000122_seg001 GadMARCM-F000050_seg001 -#> 15 GadMARCM-F000476_seg001 FruMARCM-F001929_seg001 -#> 16 GadMARCM-F000476_seg001 FruMARCM-F001494_seg002 -#> 17 FruMARCM-F000270_seg001 FruMARCM-M001205_seg002 -#> 18 FruMARCM-F000085_seg001 FruMARCM-F000188_seg001 -#> 19 GadMARCM-F000122_seg001 GadMARCM-F000442_seg002 -#> 20 FruMARCM-F001115_seg002 FruMARCM-F000270_seg001
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/nhclust-1.png b/docs/reference/nhclust-1.png deleted file mode 100644 index f12b116..0000000 Binary files a/docs/reference/nhclust-1.png and /dev/null differ diff --git a/docs/reference/nhclust.html b/docs/reference/nhclust.html deleted file mode 100644 index 7984356..0000000 --- a/docs/reference/nhclust.html +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - - - -Cluster a set of neurons — nhclust • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Given an NBLAST all by all score matrix (which may be specified by a package -default) and/or a vector of neuron identifiers use hclust to -carry out a hierarchical clustering. The default value of the distfun -argument will handle square distance matrices and R dist objects.

    -
    - -
    nhclust(
    -  neuron_names,
    -  method = "ward",
    -  scoremat = NULL,
    -  distfun = as.dist,
    -  ...,
    -  maxneurons = 4000
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    neuron_names

    character vector of neuron identifiers.

    method

    clustering method (default Ward's).

    scoremat

    score matrix to use (see sub_score_mat for details of -default).

    distfun

    function to convert distance matrix returned by -sub_dist_mat into R dist object (default= -as.dist).

    ...

    additional parameters passed to hclust.

    maxneurons

    set this to a sensible value to avoid loading huge (order -N^2) distances directly into memory.

    - -

    Value

    - -

    An object of class hclust which describes the tree - produced by the clustering process.

    -

    See also

    - -

    hclust, dist

    -

    Other scoremats: -sub_dist_mat()

    - -

    Examples

    -
    library(nat) -kcscores=nblast_allbyall(kcs20) -hckcs=nhclust(scoremat=kcscores) -
    #> The "ward" method has been renamed to "ward.D"; note new "ward.D2"
    # divide hclust object into 3 groups -library(dendroextras) -dkcs=colour_clusters(hckcs, k=3) -# change dendrogram labels to neuron type, extracting this information -# from type column in the metadata data.frame attached to kcs20 neuronlist -labels(dkcs)=with(kcs20[labels(dkcs)], type) -plot(dkcs) -
    # 3d plot of neurons in those clusters (with matching colours) -open3d() -
    #> glX -#> 3
    plot3d(hckcs, k=3, db=kcs20) -# names of neurons in 3 groups -subset(hckcs, k=3) -
    #> [1] "FruMARCM-F000706_seg001" "FruMARCM-M000842_seg002" -#> [3] "GadMARCM-F000050_seg001" "FruMARCM-M001339_seg001" -#> [5] "FruMARCM-F001115_seg002" "FruMARCM-M001051_seg002" -#> [7] "FruMARCM-F001494_seg002" "FruMARCM-F000188_seg001" -#> [9] "FruMARCM-F000270_seg001" "FruMARCM-F001929_seg001" -#> [11] "GadMARCM-F000423_seg001" "GadMARCM-F000142_seg002" -#> [13] "ChaMARCM-F000586_seg002" "FruMARCM-M001205_seg002" -#> [15] "GadMARCM-F000122_seg001" "GadMARCM-F000476_seg001" -#> [17] "FruMARCM-F000085_seg001" "GadMARCM-F000071_seg001" -#> [19] "FruMARCM-M000115_seg001" "GadMARCM-F000442_seg002"
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/plot3d.hclust-1.png b/docs/reference/plot3d.hclust-1.png deleted file mode 100644 index fa33f5c..0000000 Binary files a/docs/reference/plot3d.hclust-1.png and /dev/null differ diff --git a/docs/reference/plot3d.hclust.html b/docs/reference/plot3d.hclust.html deleted file mode 100644 index 551c7e6..0000000 --- a/docs/reference/plot3d.hclust.html +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - - - -Methods to identify and plot groups of neurons cut from an hclust -object — plot3d.hclust • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    plot3d.hclust uses plot3d to plot neurons from - each group, cut from the hclust object, by colour.

    -
    - -
    # S3 method for hclust
    -plot3d(
    -  x,
    -  k = NULL,
    -  h = NULL,
    -  groups = NULL,
    -  col = rainbow,
    -  colour.selected = FALSE,
    -  ...
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    x

    an hclust object generated by nhclust.

    k

    number of clusters to cut from hclust object.

    h

    height to cut hclust object.

    groups

    numeric vector of groups to plot.

    col

    colours for groups (directly specified or a function).

    colour.selected

    When set to TRUE the colour palette only -applies to the displayed cluster groups (default FALSE).

    ...

    additional arguments for plot3d

    - -

    Value

    - -

    A list of rgl IDs for plotted objects (see - plot3d).

    -

    Details

    - -

    Note that the colours are in the order of the dendrogram as assigned - by colour_clusters.

    -

    See also

    - - - -

    Examples

    -
    # 20 Kenyon cells -data(kcs20, package='nat') -# calculate mean, normalised NBLAST scores -kcs20.aba=nblast_allbyall(kcs20) -kcs20.hc=nhclust(scoremat = kcs20.aba) -
    #> The "ward" method has been renamed to "ward.D"; note new "ward.D2"
    # plot the resultant dendrogram -plot(kcs20.hc) -
    -# now plot the neurons in 3D coloured by cluster group -# note that specifying db explicitly could be avoided by use of the -# \code{nat.default.neuronlist} option. -plot3d(kcs20.hc, k=3, db=kcs20) - -# only plot first two groups -# (will plot in same colours as when all groups are plotted) -plot3d(kcs20.hc, k=3, db=kcs20, groups=1:2) -# only plot first two groups -# (will be coloured with a two-tone palette) -plot3d(kcs20.hc, k=3, db=kcs20, groups=1:2, colour.selected=TRUE) -
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/show_similarity.html b/docs/reference/show_similarity.html deleted file mode 100644 index c6f20d9..0000000 --- a/docs/reference/show_similarity.html +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - - - -Display two neurons with segments in the query coloured by similarity — show_similarity • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    By default, the query neuron will be drawn with its segments shaded from red -to blue, with red indicating a poor match to the target segments, and blue a -good match.

    -
    - -
    show_similarity(
    -  query,
    -  target,
    -  smat = NULL,
    -  cols = colorRampPalette(c("red", "yellow", "cyan", "navy")),
    -  col = "black",
    -  AbsoluteScale = FALSE,
    -  PlotVectors = TRUE,
    -  ...
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    query

    a neuron to compare and colour.

    target

    the neuron to compare against.

    smat

    a score matrix (if NULL, defaults to smat.fcwb).

    cols

    the function to use to colour the segments (e.g. -heat.colors).

    col

    the colour with which to draw the target neuron.

    AbsoluteScale

    logical indicating whether the colours should be -calculated based on the minimum and maximum similarities for the neuron -(AbsoluteScale = FALSE) or on the minimum and maximum possible for -all neurons.

    PlotVectors

    logical indicating whether the vectors of the -dotprops representation should be plotted. If FALSE, only the -points are plotted.

    ...

    extra arguments to pass to plot3d.

    - -

    Value

    - -

    show_similarity is called for the side effect of drawing the - plot; a vector of object IDs is returned.

    -

    See also

    - -

    The low level function WeightedNNBasedLinesetMatching - is used to retrieve the scores.

    - -

    Examples

    -
    if (FALSE) { -library(nat) - -# Pull out gamma and alpha-beta neurons -gamma_neurons <- subset(kcs20, type=='gamma') -ab_neurons <- subset(kcs20, type=='ab') - -# Compare two alpha-beta neurons with similar branching, but dissimilar arborisation -clear3d() -show_similarity(ab_neurons[[1]], ab_neurons[[2]]) - -# Compare an alpha-beta and a gamma neuron with some similarities and differences -clear3d() -show_similarity(ab_neurons[[1]], gamma_neurons[[3]]) -} -
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/smat.fcwb.html b/docs/reference/smat.fcwb.html deleted file mode 100644 index 2440e06..0000000 --- a/docs/reference/smat.fcwb.html +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - -Scoring matrices for neuron similarities in FCWB template brain — smat.fcwb • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Scoring matrices quantify the log2 odds ratio that a segment pair with a -given distance and absolute dot product come from a pair of neurons of the -same type, rather than unrelated neurons.

    -
    - - - -

    Details

    - -

    These scoring matrices were generated using all by all pairs from 150 DL2 -antennal lobe projection neurons from the http://flycircuit.tw dataset -and 5000 random pairs from the same dataset.

    -
      -
    • smat.fcwb was trained using nearest-neighbour distance and the -tangent vector defined by the first eigen vector of the k=5 nearest -neighbours.

    • -
    • smat_alpha.fcwb was defined as for smat.fcwb but weighted -by the factor alpha defined as (l1-l2)/(l1+l2+l3) where l1,l2,l3 are -the three eigen values.

    • -
    - -

    Most work on the flycircuit dataset has been carried out using the -smat.fcwb scoring matrix although the smat_alpha.fcwb matrix -which emphasises the significance of matches between linear regions of the -neuron (such as axons) may have some advantages.

    - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/sparse_score_mat.html b/docs/reference/sparse_score_mat.html deleted file mode 100644 index b8eb41c..0000000 --- a/docs/reference/sparse_score_mat.html +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - - - -Convert a subset of a square score matrix to a sparse representation — sparse_score_mat • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    This can be useful for storing raw forwards and reverse NBLAST scores for a -set of neurons without having to store all the uncomputed elements in the -full score matrix.

    -
    - -
    sparse_score_mat(neuron_names, dense_matrix)
    - -

    Arguments

    - - - - - - - - - - -
    neuron_names

    a character vector of neuron names to save scores for.

    dense_matrix

    the original, dense version of the full score matrix.

    - -

    Value

    - -

    A spare matrix, in compressed, column-oriented form, as an R object - inheriting from both CsparseMatrix-class and - generalMatrix-class.

    -

    See also

    - -

    fill_in_sparse_score_mat

    - -

    Examples

    -
    data(kcs20, package = "nat") -scores=nblast_allbyall(kcs20) -scores.3.sparse=sparse_score_mat(names(kcs20)[3], scores) -scores.3.sparse -
    #> [1] 3234.54125 -935.33772 3382.60124 -515.53376 125.68989 244.92594 -#> [7] 4259.57193 480.41458 2048.01759 2068.51808 1278.68688 1359.49507 -#> [13] -15.28677 3403.75462 -313.24728 73.74186 3277.87783 3122.69555 -#> [19] 2656.70773 1487.45673 301.63902 360.64137 23.53454 2849.13647 -#> [25] 309.92651 4043.17656 1962.12743 4202.62578 91.73056 4567.08113 -#> [31] 1259.18024 4703.75189 1075.50543 4726.53035 62.48739 4760.69804 -#> [37] 2889.29188 4965.70417 -410.27503 5159.32108 -377.93391 5204.87800 -#> [43] 2751.04667 5227.65646 2847.10004 5204.87800 1635.40240 5478.21951 -#> [49] 1731.55066 5512.38720 -514.09460 5637.66873 -204.79399 5432.66259 -#> [55] -393.66139 5762.95025 1968.02090 5580.72258 -#> Class 'spam' (32-bit)
    # can also add additional submatrices -fill_in_sparse_score_mat(scores.3.sparse,scores[3:6,3:4]) -
    #> [1] 3234.54125 -935.33772 3382.60124 -515.53376 125.68989 244.92594 -#> [7] 4259.57193 480.41458 2048.01759 2068.51808 1278.68688 1359.49507 -#> [13] -15.28677 3403.75462 -313.24728 73.74186 3277.87783 3122.69555 -#> [19] 2656.70773 1487.45673 301.63902 360.64137 23.53454 2849.13647 -#> [25] 309.92651 4043.17656 1962.12743 254.75164 4202.62578 91.73056 -#> [31] -520.25810 4567.08113 1259.18024 4703.75189 1075.50543 4726.53035 -#> [37] 62.48739 4760.69804 2889.29188 4965.70417 -410.27503 5159.32108 -#> [43] -377.93391 5204.87800 2751.04667 5227.65646 2847.10004 5204.87800 -#> [49] 1635.40240 5478.21951 1731.55066 5512.38720 -514.09460 5637.66873 -#> [55] -204.79399 5432.66259 -393.66139 5762.95025 1968.02090 5580.72258 -#> Class 'spam' (32-bit)
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/sub_dist_mat.html b/docs/reference/sub_dist_mat.html deleted file mode 100644 index cbef628..0000000 --- a/docs/reference/sub_dist_mat.html +++ /dev/null @@ -1,226 +0,0 @@ - - - - - - - - -Convert (a subset of) a raw score matrix to a distance matrix — sub_dist_mat • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    This function can convert a raw score matrix returned by - nblast into a square distance matrix or dist object. It can - be used with file-backed matrices as well as regular R matrices resident in - memory.

    -
    - -
    sub_dist_mat(
    -  neuron_names,
    -  scoremat = NULL,
    -  form = c("matrix", "dist"),
    -  maxneurons = NA
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    neuron_names

    character vector of neuron identifiers.

    scoremat

    score matrix to use (see sub_score_mat for details of -default).

    form

    the type of object to return.

    maxneurons

    set this to a sensible value to avoid loading huge (order -N^2) distances directly into memory.

    - -

    Value

    - -

    return An object of class matrix or dist (as determined by the form - argument), corresponding to a subset of the distance matrix

    -

    Details

    - -

    Note that if neuron_names is missing then the rownames of - scoremat will be used i.e. every neuron in scoremat will be - used.

    -

    See also

    - -

    Other scoremats: -nhclust()

    - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/sub_score_mat.html b/docs/reference/sub_score_mat.html deleted file mode 100644 index 19977b3..0000000 --- a/docs/reference/sub_score_mat.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - - - -Return scores (or distances) for given query and target neurons — sub_score_mat • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Scores can either be returned as raw numbers, normalised such that a self-hit -has score 1, or as the average of the normalised scores in both the forwards -& reverse directions (i.e. |query->target| + |target->query| / 2). -Distances are returned as either 1 - normscore in the forwards -direction, or as 1 - normscorebar, where normscorebar is -normscore averaged across both directions.

    -
    - -
    sub_score_mat(
    -  query,
    -  target,
    -  scoremat = NULL,
    -  distance = FALSE,
    -  normalisation = c("raw", "normalised", "mean")
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    query, target

    character vectors of neuron identifiers.

    scoremat

    a matrix, ff matrix, bigmatrix or a character vector -specifying the name of an ff matrix containing the all by all score -matrix.

    distance

    logical indicating whether to return distances or scores.

    normalisation

    the type of normalisation procedure that should be -carried out, selected from 'raw', 'normalised' or -'mean' (i.e. the average of normalised scores in both directions). -If distance=TRUE then this cannot be raw.

    - -

    See also

    - - - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/subset.hclust.html b/docs/reference/subset.hclust.html deleted file mode 100644 index e19bd6e..0000000 --- a/docs/reference/subset.hclust.html +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - - -Return the labels of items in 1 or more groups cut from hclust object — subset.hclust • nat.nblast - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Return the labels of items in 1 or more groups cut from hclust object

    -
    - -
    # S3 method for hclust
    -subset(x, k = NULL, h = NULL, groups = NULL, ...)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    x

    tree like object

    k

    an integer scalar with the desired number of groups

    h

    numeric scalar with height where the tree should be cut

    groups

    a vector of which groups to inspect.

    ...

    Additional parameters passed to methods

    - -

    Value

    - -

    A character vector of labels of selected items

    -

    Details

    - -

    Only one of h and k should be supplied.

    - -
    - -
    - - - -
    - - - - - - - - diff --git a/man/nat.nblast-package.Rd b/man/nat.nblast-package.Rd index 0de827a..c7cb07b 100644 --- a/man/nat.nblast-package.Rd +++ b/man/nat.nblast-package.Rd @@ -108,5 +108,14 @@ Costa, M., Ostrovsky, A.D., Manton, J.D., Prohaska, S., and \code{\link{nblast}}, \code{\link{smat.fcwb}}, \code{\link{nhclust}}, \code{\link{sub_dist_mat}}, \code{\link{sub_score_mat}}, \code{\link{create_scoringmatrix}} +} +\author{ +\strong{Maintainer}: Gregory Jefferis \email{jefferis@gmail.com} (\href{https://orcid.org/0000-0002-0587-9355}{ORCID}) + +Authors: +\itemize{ + \item James Manton \email{ajd.manton@googlemail.com} (\href{https://orcid.org/0000-0001-9260-3156}{ORCID}) +} + } \keyword{package}