MCPcopy Index your code
hub / github.com/codialab/panacus

github.com/codialab/panacus @v0.5.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.5.0 ↗ · + Follow
3,890 symbols 11,686 edges 62 files 27 documented · 1%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Rust Build Anaconda-Server Badge Anaconda-Server Badge Anaconda-Server Badge

A Counting Tool for Pangenome Graphs

panacus is a counting tool for pangenome graphs

panacus is a tool for calculating statistics for pangenome files. It supports GFA files with P and W lines, but requires that the graph is blunt, i.e., nodes do not overlap and consequently, each link (L) points from the end of one segment (S) to the start of another. These GFA files can be sqz-ified (see sqz). Additionally, it also supports VCF files.

panacus supports the following calculations:

  • coverage histogram
  • pangenome growth statistics
  • path similarity
  • allele/non-reference features-plots
  • node plots resolved by length and coverage
  • ...

Quickstart

  1. Install panacus using conda/mamba:
mamba install -c conda-forge -c bioconda panacus
  1. Create a file report.yaml with the following content:
- !Gfa
  graph: ../graphs/test_graph.gfa    # Change this to a GFA file on your system
  analyses:
    - !Hist
      count_type: Bp
    - !Growth
      coverage: 1,1,2
      quorum: 0,0.9,0
  1. Run panacus:
panacus report report.yaml > report.html
  1. Take a look at the generated html file using your favorite browser!

For more info on what to write into report.yaml see the documentation.

Installation

From bioconda channel

Make sure you have conda/mamba installed!

mamba install -c conda-forge -c bioconda panacus

From binary release

Linux x86_64

wget --no-check-certificate -c https://github.com/codialab/panacus/releases/download/v0.5.0/panacus-0.5.0_x86_64-unknown-linux-musl.tar.gz
tar -xzvf panacus-0.5.0_x86_64-unknown-linux-musl.tar.gz

# install the Python libraries necessary for panacus-visualize
pip install --user matplotlib numpy pandas scikit-learn scipy seaborn

# suggestion: add tool to path in your ~/.bashrc
export PATH="$(readlink -f panacus-0.5.0_x86_64-unknown-linux-musl/bin)":$PATH

# you are ready to go!
panacus --help

Mac OSX arm64

wget --no-check-certificate -c https://github.com/codialab/panacus/releases/download/v0.5.0/panacus-0.5.0_aarch64-apple-darwin.tar.gz
tar -xzvf panacus-0.5.0_aarch64-apple-darwin.tar.gz

# install the Python libraries necessary for panacus-visualize
pip install --user matplotlib numpy pandas scikit-learn scipy seaborn

# suggestion: add tool to path in your ~/.bashrc
export PATH="$(readlink -f panacus-0.5.0_aarch64-apple-darwin/bin)":$PATH

# you are ready to go!
panacus --help

From repository

panacus requires a working RUST build system (version >= 1.74.1) to build from source. See here for more details.

git clone git@github.com:codialab/panacus.git

cd panacus
cargo build --release

mkdir bin
ln -s ../target/release/panacus bin/
ln -s ../scripts/panacus-visualize.py bin/panacus-visualize

# install the Python libraries necessary for panacus-visualize
pip install --user matplotlib numpy pandas scikit-learn scipy seaborn

# suggestion: add tool to path in your ~/.bashrc
export PATH="$(readlink -f bin)":$PATH

# you are ready to go!
panacus --help

Examples

Examples can be found in the examples directory. To get more information about how to use panacus check out the documentation.

Citation

Parmigiani, L., Garrison, E., Stoye, J., Marschall, T. & Doerr, D. Panacus: fast and exact pangenome growth and core size estimation. Bioinformatics, https://doi.org/10.1093/bioinformatics/btae720 (2024).

Extension points exported contracts — how you extend this code

MatrixBasedAnalysis (Interface)
(no doc) [10 implementers]
src/analyses.rs
FileFormatParser (Interface)
(no doc) [2 implementers]
src/file_formats.rs
HistBasedAnalysis (Interface)
(no doc) [2 implementers]
src/analyses.rs

Core symbols most depended-on inside this repo

iter
called by 218
src/util.rs
len
called by 166
src/file_formats/gfa_parser/grammar.rs
visit
called by 87
src/file_formats/gfa_parser/grammar.rs
keys
called by 64
src/util.rs
get
called by 55
src/util.rs
insert
called by 36
src/coverage_matrix.rs
insert
called by 33
src/file_formats/gfa_parser/grammar.rs
add_info
called by 31
src/analyses/info.rs

Shape

Function 2,399
Method 1,179
Class 293
Enum 16
Interface 3

Languages

TypeScript86%
Rust14%
Python1%

Modules by API surface

etc/vega@6.0.0.min.js1,717 symbols
etc/vega-lite@6.1.0.min.js1,063 symbols
etc/bootstrap.bundle.min.js390 symbols
etc/vega-embed@6.29.0.min.js99 symbols
src/file_formats/vcf_parser.rs40 symbols
src/file_formats/gfa_parser/abacus.rs40 symbols
src/util.rs39 symbols
src/coverage_matrix.rs38 symbols
src/file_formats/gfa_parser/graph.rs35 symbols
etc/lib.js34 symbols
etc/lib.min.js22 symbols
src/file_formats/gfa_parser/grammar.rs21 symbols

For agents

$ claude mcp add panacus \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact