cna

Covarying neighborhood analysis (CNA) is a method for finding structure in- and conducting association analysis with multi-sample single-cell datasets.

https://github.com/immunogenomics/cna

Science Score: 54.0%

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

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: nature.com
  • Committers with academic emails
    2 of 12 committers (16.7%) from academic institutions
  • Institutional organization owner
    Organization immunogenomics has institutional domain (immunogenomics.hms.harvard.edu)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.1%) to scientific vocabulary

Keywords

python single-cell
Last synced: 6 months ago · JSON representation

Repository

Covarying neighborhood analysis (CNA) is a method for finding structure in- and conducting association analysis with multi-sample single-cell datasets.

Basic Info
  • Host: GitHub
  • Owner: immunogenomics
  • License: gpl-3.0
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 18.5 MB
Statistics
  • Stars: 55
  • Watchers: 3
  • Forks: 5
  • Open Issues: 0
  • Releases: 0
Topics
python single-cell
Created almost 6 years ago · Last pushed 9 months ago
Metadata Files
Readme License

README.md

cna

Covarying neighborhood analysis is a method for finding structure in- and conducting association analysis with multi-sample single-cell datasets. cna does not require a pre-specified transcriptional structure such as a clustering of the cells in the dataset. It aims instead to flexibly identify differences of all kinds between samples. cna is fast, does not require parameter tuning, produces measures of statistical significance for its association analyses, and allows for covariate correction.

cna is built on top of scanpy and offers a scanpy-like interface for ease of use.

If you prefer R, there is an R implementation maintained separately by Ilya Korsunsky. (Though the R implementation may occasionally lag behind this implementation as updates are made.)

installation

To use cna, you can either install it directly from the Python Package Index by running, e.g.,

pip install cna

or if you'd like to manipulate the source code you can clone this repository and add it to your PYTHONPATH.

demo

Take a look at our tutorial to see how to get started with a small synthetic data set.

talk

You can learn more about cna by watching our talk at the Broad Institute's Models, Inference, and Algorithms seminar, which is preceded by a primer by Dylan Kotliar on nearest-neighbor graphs.

notices

  • April 29, 2025: We have made substantial changes to the cna API and are releasing a new package version 0.2.0. The main changes are that i) cna no longer will cache the NAM, and ii) cna will no longer use the MultiAnnData structure and will instead only use the standard scanpy AnnData structure. Code built for prior versions will likely not work for this new version, but should be easily adaptible by following the new demo.
  • October 19, 2023: We have found a source of miscalibration in cna’s local association testing of individual neighborhoods that applies to unusual datasets, typically with limited sample size and very low complexity. This issue does not affect cna’s global test, which tests for aggregate association between single-cell profiles and a case-control phenotype; it only affects cna’s identification of which individual neighborhoods explain an aggregate association. The miscalibration appears mild on real datasets. However, in simulated datasets we observed miscalibration when i) the case-control phenotype was extremely highly correlated with the first principal component of the neighborhood abundance matrix, and ii) there were many neighborhoods lacking true associations to this phenotype. This issue has been fixed in cna version 0.1.6, which uses the full-rank rather than the rank-k* neighborhood abundance matrix to compute neighborhood coefficients. We re-ran the primary analyses from the index cna paper with this new version of cna and found that the results were broadly unchanged. Although cna found fewer FDR-significant neighborhoods in each dataset, it still found large numbers of neighborhoods corresponding to the key associated cell populations (albeit at FDR 10% rather than 5% for the dataset with the smallest sample size [N=12]). Additionally, the prior and updated neighborhood coefficients remain very similar (R>0.9 in all datasets). We did not modify CNA’s global test, which determines whether there is any association between the single cell profiles and the case-control phenotype, as that portion of the method is unaffected.
  • January 20, 2022: It has come to our attention that a bug introduced on July 16, 2021 caused cna to behave incorrectly for users with anndata version 0.7.2 or later, possibly resulting in false positive or false negative results. This bug was fixed in cna version 0.1.4. We strongly recommend that any users with anndata version 0.7.2 or later either re-clone cna or run pip install --upgrade cna and re-run all analyses that may have been affected.

citation

If you use cna, please cite

[Reshef, Rumker], et al., Co-varying neighborhood analysis identifies cell populations associated with phenotypes of interest from single-cell transcriptomics. [...] contributed equally

Owner

  • Name: Raychaudhuri Lab
  • Login: immunogenomics
  • Kind: organization
  • Email: raychaudhuri.lab@gmail.com
  • Location: Boston, MA, USA

GitHub Events

Total
  • Issues event: 8
  • Watch event: 6
  • Issue comment event: 18
  • Push event: 12
  • Create event: 1
Last Year
  • Issues event: 8
  • Watch event: 6
  • Issue comment event: 18
  • Push event: 12
  • Create event: 1

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 183
  • Total Committers: 12
  • Avg Commits per committer: 15.25
  • Development Distribution Score (DDS): 0.443
Past Year
  • Commits: 19
  • Committers: 2
  • Avg Commits per committer: 9.5
  • Development Distribution Score (DDS): 0.053
Top Committers
Name Email Commits
Yakir Reshef y****3@c****g 102
yakirr y****r@g****m 27
yakirr y****f@b****g 18
Yakir Reshef y****3@c****g 11
Yakir Reshef y****3@c****g 7
rumker l****4@c****g 6
Miles Smith m****h@o****g 4
rumker l****r@g****m 3
rumker l****4@c****g 2
Yakir Reshef y****3@c****g 1
Yakir Reshef y****r@y****l 1
Reshef y****2@l****u 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 21
  • Total pull requests: 4
  • Average time to close issues: 12 days
  • Average time to close pull requests: about 2 months
  • Total issue authors: 19
  • Total pull request authors: 1
  • Average comments per issue: 2.76
  • Average comments per pull request: 1.75
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 6
  • Pull requests: 0
  • Average time to close issues: 9 days
  • Average time to close pull requests: N/A
  • Issue authors: 6
  • Pull request authors: 0
  • Average comments per issue: 3.5
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • altairwei (2)
  • olabylinska (2)
  • JBreunig (1)
  • serjisa (1)
  • jamesnemesh (1)
  • france-hub (1)
  • Byronxy (1)
  • ttab963 (1)
  • noranekonobokkusu (1)
  • repeatpipettor (1)
  • hmbaghdassarian (1)
  • yingxuexiao (1)
  • mturchin20 (1)
  • QiangShiPKU (1)
  • huwenboshi (1)
Pull Request Authors
  • milescsmith (4)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 424 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 3
  • Total versions: 21
  • Total maintainers: 1
pypi.org: cna

covarying neighborhood analysis

  • Versions: 21
  • Dependent Packages: 0
  • Dependent Repositories: 3
  • Downloads: 424 Last month
Rankings
Dependent repos count: 9.0%
Dependent packages count: 10.0%
Stargazers count: 10.4%
Average: 12.6%
Forks count: 15.3%
Downloads: 18.2%
Maintainers (1)
Last synced: 6 months ago

Dependencies

pyproject.toml pypi