-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
80 lines (59 loc) · 2.39 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
<!-- devtools::build_readme() -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
<!-- badges: start -->
[![R-CMD-check](https://github.com/natverse/coconat/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/natverse/coconat/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/natverse/coconat/branch/master/graph/badge.svg)](https://app.codecov.io/gh/natverse/coconat?branch=master)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
<!-- badges: end -->
The goal of *coconat* is to provide dataset agnostic support for connectome analysis.
It is intended to have a mix of end-user functionality and functions that are
principally intended as building blocks for more specialised packages such as
https://natverse.org/neuprintr/ or https://natverse.org/fafbseg/.
It is also a key building block for the https://natverse.org/coconat package,
which provides a small number of powerful functions for comparative connectomics
analysis of multiple dense reconstructions of drosophila brain and VNC data.
## Installation
You can install the development version of coconat from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("natverse/coconat")
```
## Example
This is a basic example which shows you how to solve a common problem:
```{r example}
library(coconat)
# da2ds=neuprintr::neuprint_connection_table('DA2_lPN', details=TRUE, partners='out', conn = hbconn)
da2ds=readRDS(system.file('sampledata/da2ds.rds', package = 'coconat'))
head(da2ds)
```
```{r}
library(Matrix)
am=partner_summary2adjacency_matrix(da2ds, inputcol = 'bodyid', outputcol = 'partner')
image(am)
```
```{r}
am2=partner_summary2adjacency_matrix(subset(da2ds, weight>=15),
inputcol = 'bodyid', outputcol = 'partner')
image(am2)
```
Now we can also cosine cluster
We can do this for the inputs (the 5 PNs should look much the same)
```{r}
heatmap(cosine_sim(am, transpose = T))
```
Or the outputs
```{r}
heatmap(cosine_sim(am))
```
But it would of course be more useful if we did this based on a richer set of inputs