Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

cavar logo

CaVar

Check status of CRISPR-Cas9 off-targets from genomic variants

GitHub Release PyPI Release License Python versions PyPI Downloads Repo Size

Introduction

CaVar (pronounced as ka-vee-a) is a CLI tool to check status of CRISPR-Cas off-target sites (OTs) from genomic variants. It utilizes output from an upstream OT finding tool, for example, Cas-Offinder and a VCF file to infer status of the OT sites. The following scoring scheme (Table 1) is used to report the status of the PAM (pm). To calculate the protospacer score (ps), a hamming-distance-based metric is used. If the number of mismatches between the supplied gRNA and the variant protospacer sequence of an off-target site is less than the maximum allowed value, the protospacer score (ps) is set to unity; otherwise, it is set to zero. Finally, the off-target score is calculated as: os := (ps × 10) + pm.

old PAM new PAM Score (pm)
valid valid 0
valid valid (same) 1
invalid valid 2
valid invalid 3
invalid invalid 4

Table 1. Off-target PAM scoring scheme

Dependencies

Cavar requires Python >= 3.9 and depends on the following external libraries

  • cyvcf2 == 0.31.4
  • pysam == 0.23.3

Installation

From PyPI

To install with pip use

pip install cavar

From source

For installation from the source use the following

git clone https://github.com/dasprosad/cavar.git
cd cavar
pip install .

Usage and options

Prerequisites

  • Usage of reference genome

The reference genome must be the same which was used for variant calling. VCF specification states that CHROM field must not contain any white space so, the FASTA headers must be reformated to contain only the FASTA ID and not any other description.

  • Finding off-target sites with Cas-Offinder

Cas-Offinder usage is listed on its GitHub project page. Use the header-reformatted reference genome for quering with Cas-Offinder. Set the maximum number tolerated mismatches according to your Cas system of choice leaving the PAM as "NNN". An example input file for Cas-Offinder with a maximum of 4 mismatches looks like the following.

/home/user/path/to/ref/hg38.fa
NNNNNNNNNNNNNNNNNNNNNN
ATGTTGATGATAGGATGATNNN 4

Run Cas-Offinder with

cas-offinder input.txt C casoffinder_out.tab
  • Converting Cas-Offinder result to BED

There are many ways of converting it to a BED file, but I have used the following awk oneliner

First add a BED header (optional)

echo -e "#BED3\n#CHROM\tSTART\tEND\tNAME\tSCORE\tSTRAND" >casoffinder_out.bed

Then use awk to format to BED

awk '$1 !~ /^#/ {print $1, $4, $5}' OFS='\t' casoffinder_out.tab >>casoffinder_out.bed

Cavar usage

  • For help use cavar --help

Options

usage:  cavar [OPTIONS] <grna> <bed file> <vcf file>
        cavar --help

Check status of CRISPR-Cas9 off-targets from genomic variants

positional arguments:
  grna (STR)           grna without the pam sequence
  bedfile (PATH)       path of bedfile
  vcffile (PATH)       path of vcffile

options:
  -h, --help           show this help message and exit
  -v, --version        show program's version number and exit
  -p, --pam-regex STR  pam as regex (default: [ATCG]GG)
  -d, --distance INT   maximum number of mismatches in crRNA (default: 4)
  -o, --outfile PATH   name of outfile (default: outfile.bed)

Examples

  1. Find off-target status of a gRNA with a given Cas9
  • Find OTs of the gRNA with Cas9 across the reference genome
cas-offinder input.txt C casoffinder_ots.tab
  • Convert the casoffinder_ots.tab to BED

  • Check status of those OTs with genomic variants

cavar --outfile p1_ots.bed ATGTTGATGATAGGATGAT casoffinder_ots.bed p1.vcf.gz

Release

  • 1.0b1 First beta release.

Issues

If you have found any bugs or would like to request any new features please report it on CAVAR.

License

CaVar is distributed under the GNU Public License v3 (GPL3). You should have received a copy of the license with CaVar.

Metadata

Release files for cavar 1.0b1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cavar 1.0b1
File Size Uploaded
cavar-1.0b1.tar.gz 22.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cavar 1.0b1
File Interpreter ABI Platform
cavar-1.0b1-py3-none-any.whl Python 3 none any Details

Total release size: 44.4 kB

Release files / cavar-1.0b1.tar.gz

Download URL cavar-1.0b1.tar.gz
Size 22.8 kB
Tags Source
SHA-256 checksum
How to use checksums
bcb9516b22d177027dd452ef1fd4123c5d35c9e965abe740fdd230f38a2d7ef6
BLAKE2b-256 checksum
How to use checksums
f7d60ba900d9baf7bcfb2f70a9598dece5da9d0931b485df07a74a189780f18f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / cavar-1.0b1-py3-none-any.whl

Download URL cavar-1.0b1-py3-none-any.whl
Size 21.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d4b38e7ffcaa5ff62f83bb063f431be800c73f7387132ffa346284471722bc7f
BLAKE2b-256 checksum
How to use checksums
e0485117151d442774af8b76d5005a428c7729cec84eb67d85ff81c24918d001
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release history Release notifications | RSS feed

This release

1.0b1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page