adjclust

Adjacency-constrained hierarchical clustering of a similarity matrix

https://github.com/pneuvial/adjclust

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 10 committers (20.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.7%) to scientific vocabulary

Keywords

gwas hi-c hierarchical-clustering linkage-disequilibrium
Last synced: 10 months ago · JSON representation

Repository

Adjacency-constrained hierarchical clustering of a similarity matrix

Basic Info
Statistics
  • Stars: 16
  • Watchers: 5
  • Forks: 8
  • Open Issues: 4
  • Releases: 2
Topics
gwas hi-c hierarchical-clustering linkage-disequilibrium
Created about 10 years ago · Last pushed almost 2 years ago
Metadata Files
Readme

README.Rmd

---
output: 
  github_document: default
  html_document:
    self_contained: no
---

```{r, echo = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-"
)
```

# adjclust: Adjacency-constrained clustering

[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/adjclust)](https://cran.r-project.org/package=adjclust)
[![R build status](https://github.com/pneuvial/adjclust/workflows/R-CMD-check/badge.svg)](https://github.com/pneuvial/adjclust/actions)
[![Coverage Status](https://img.shields.io/codecov/c/github/pneuvial/adjclust/develop.svg)](https://app.codecov.io/github/pneuvial/adjclust/branch/develop)

`adjclust` is a package that provides methods to perform adjacency-constrained hierarchical agglomerative clustering. Adjacency-constrained hierarchical agglomerative clustering is hierarchical agglomerative clustering (HAC) in which each observation is associated to a position, and the clustering is constrained so as only adjacent clusters are merged. It is useful in bioinformatics (e.g. Genome Wide Association Studies or Hi-C data analysis).

`adjclust` provides three user level functions: `adjClust`, `snpClust` and `hicClust`, which are briefly explained below.

## Installation

You can install adjclust from github with:

```{r gh-installation, eval = FALSE}
# install.packages("devtools")
devtools::install_github("pneuvial/adjclust")
```


## `adjClust` 

`adjClust` performs adjacency-constrained HAC for standard and sparse, similarity and dissimilarity matrices and `dist` objects. `Matrix::dgCMatrix` and `Matrix::dsCMatrix` are the supported sparse matrix classes. Let's look at a basic example

```{r adjClust}
library("adjclust")

sim <- matrix(c(1.0, 0.5, 0.2, 0.1,
                0.5, 1.0, 0.1, 0.2,
                0.2, 0.1, 1.0, 0.6,
                0.1, 0.2 ,0.6 ,1.0), nrow=4)
h <- 3
fit <- adjClust(sim, "similarity", h)
plot(fit)
```

The result is of class `chac`. It can be plotted as a dendrogram (as shown above). Successive merge and heights of clustering can be obtained by `fit$merge` and `fit$height` respectively.

## `snpClust` 

`snpClust` performs adjacency-constrained HAC for specific application of Genome Wide Association Studies (GWAS). A minimal example is given below. See [GWAS Vignette](vignettes/snpClust.Rmd) for details.

```{r snpClust}
library("snpStats")
data("ld.example", package = "snpStats")
geno <- ceph.1mb[, -316]  ## drop one SNP leading to one missing LD value
h <- 100
ld.ceph <- ld(geno, stats = "R.squared", depth = h)
image(ld.ceph, lwd = 0)

fit <- snpClust(geno, stats = "R.squared", h = h)
plot(fit)
sel_clust <- select(fit, "bs")
plotSim(as.matrix(ld.ceph), clustering = sel_clust, dendro = fit)
```

## `hicClust` 

 `hicClust` performs adjacency-constrained HAC for specific application of Hi-C data analysis. A minimal example is given below. See [Hi-C Vignette](vignettes/hicClust.Rmd) for details.

```{r HiTC, message=FALSE}
library("HiTC")
```

```{r hicClust}
load(system.file("extdata", "hic_imr90_40_XX.rda", package = "adjclust"))
binned <- binningC(hic_imr90_40_XX, binsize = 5e5)
mapC(binned)

fitB <- hicClust(binned)
plot(fitB)
plotSim(intdata(binned), dendro = fitB) # default: log scale for colors
```


## Credits 

Version 0.4.0 of this package was completed by Shubham Chaturvedi as a part of the [Google Summer of Code 2017](https://summerofcode.withgoogle.com/projects/#4961904920363008) program.

Owner

  • Name: Pierre Neuvial
  • Login: pneuvial
  • Kind: user
  • Location: Toulouse, France
  • Company: CNRS

GitHub Events

Total
Last Year

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 667
  • Total Committers: 10
  • Avg Commits per committer: 66.7
  • Development Distribution Score (DDS): 0.498
Past Year
  • Commits: 44
  • Committers: 4
  • Avg Commits per committer: 11.0
  • Development Distribution Score (DDS): 0.5
Top Committers
Name Email Commits
Shubham Chaturvedi s****k@g****m 335
Pierre Neuvial p****l@g****m 120
Nathalie Villa-Vialaneix n****x@i****r 81
Nathalie Vialaneix n****x@i****r 50
Pierre Neuvial p****l@m****r 42
Nathalie Vialaneix n****x@i****r 22
Pierre Neuvial p****l 12
N.Randria n****n@g****m 2
Nathalie Vialaneix t****e@c****f 2
Gabriel Hoffman g****n@m****u 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 64
  • Total pull requests: 18
  • Average time to close issues: about 1 year
  • Average time to close pull requests: 8 days
  • Total issue authors: 7
  • Total pull request authors: 5
  • Average comments per issue: 1.95
  • Average comments per pull request: 1.17
  • Merged pull requests: 18
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: 2 months
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 3.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • tuxette (37)
  • pneuvial (22)
  • lisiarend (1)
  • barracuda156 (1)
  • Ledolter (1)
  • ghost (1)
  • GabrielHoffman (1)
Pull Request Authors
  • tuxette (13)
  • pneuvial (6)
  • rewee (1)
  • ghost (1)
  • GabrielHoffman (1)
Top Labels
Issue Labels
enhancement (33) question (11) bug (9) wontfix (1)
Pull Request Labels
enhancement (1)

Packages

  • Total packages: 1
  • Total downloads:
    • cran 460 last-month
  • Total dependent packages: 2
  • Total dependent repositories: 1
  • Total versions: 13
  • Total maintainers: 1
cran.r-project.org: adjclust

Adjacency-Constrained Clustering of a Block-Diagonal Similarity Matrix

  • Versions: 13
  • Dependent Packages: 2
  • Dependent Repositories: 1
  • Downloads: 460 Last month
Rankings
Forks count: 7.9%
Stargazers count: 13.3%
Dependent packages count: 13.7%
Average: 16.3%
Downloads: 22.7%
Dependent repos count: 23.9%
Last synced: 11 months ago

Dependencies

DESCRIPTION cran
  • R >= 4.0.0 depends
  • Matrix * imports
  • Rcpp >= 1.0.6 imports
  • capushe * imports
  • grDevices * imports
  • graphics * imports
  • methods * imports
  • sparseMatrixStats * imports
  • stats * imports
  • utils * imports
  • BiocGenerics * suggests
  • HiTC * suggests
  • knitr * suggests
  • rioja * suggests
  • rmarkdown * suggests
  • snpStats * suggests
  • testthat * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite