The misha package is a toolkit for analysis of genomic data. it implements an efficient data structure for storing genomic data, and provides a set of functions for data extraction, manipulation and analysis.
You can install the released version of misha from CRAN with:
install.packages("misha")Or from conda:
And the development version from GitHub with:
remotes::install_github("tanaylab/misha")See the Genomes vignette for instructions on how to create a misha database for common genomes.
See the user manual for more usage details.
For agents (Claude Code, Copilot, Cursor, etc.) writing misha analysis code in a downstream project, point them at the maintained agent guides in this repo:
agent-guides/misha-core.md
agent-guides/misha-advanced.md
agent-guides/misha-anti-patterns.md
agent-guides/skills/
importing-tracks (format chooser across all gtrack.*import* variants + pre/post-import validation). Load when the task specifically calls for one of these.The core guide is ~4k words and targets a system-prompt-sized context. For Claude Code-style setups, dropping misha-core.md (or all three) into the project’s CLAUDE.md / AGENTS.md is the intended use.
Drop-in prompt (no clone needed). Paste the block below into your agent at the start of a misha task. It points the agent at the raw files on GitHub, so it works without a local checkout:
Before writing any misha code, fetch and read:
- https://raw.githubusercontent.com/tanaylab/misha/master/agent-guides/misha-core.md (mandatory: concepts + everyday recipes)
- https://raw.githubusercontent.com/tanaylab/misha/master/agent-guides/misha-anti-patterns.md (silent footguns; cross-referenced from core)
- https://raw.githubusercontent.com/tanaylab/misha/master/agent-guides/misha-advanced.md (consult on demand: 2D / Hi-C, PWM, import/export, new genomes)
Follow the conventions in those files. When you hit a recipe with an
"Avoid:" block, treat it as a hard rule.
Pin to a release tag for stability by replacing master with any tag that contains agent-guides/ (the directory landed in v5.7.0, so v5.7.0 or later; v5.7.3 for the current guide content).
Starting in misha 4.2.0, the package no longer stores global variables such as ALLGENOME or GROOT. Instead, these variables are stored in a special environment called .misha. This means that scripts written for older versions of misha will no longer work. To run such scripts, either add a prefix of .misha$ to all those variables (.misha$ALLGENOME instead of ALLGENOME), or run the following command before running the script:
ALLGENOME <<- .misha$ALLGENOME
GROOT <<- .misha$GROOT
ALLGENOME <<- .misha$ALLGENOME
GINTERVID <<- .misha$GINTERVID
GITERATOR.INTERVALS <<- .misha$GITERATOR.INTERVALS
GROOT <<- .misha$GROOT
GWD <<- .misha$GWD
GTRACKS <<- .misha$GTRACKS