Skip to main content

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

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cavar-1.0b1.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cavar-1.0b1-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file cavar-1.0b1.tar.gz.

File metadata

  • Download URL: cavar-1.0b1.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for cavar-1.0b1.tar.gz
Algorithm Hash digest
SHA256 bcb9516b22d177027dd452ef1fd4123c5d35c9e965abe740fdd230f38a2d7ef6
MD5 1a489d0bd3055960d5f83f316c18684a
BLAKE2b-256 f7d60ba900d9baf7bcfb2f70a9598dece5da9d0931b485df07a74a189780f18f

See more details on using hashes here.

File details

Details for the file cavar-1.0b1-py3-none-any.whl.

File metadata

  • Download URL: cavar-1.0b1-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for cavar-1.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 d4b38e7ffcaa5ff62f83bb063f431be800c73f7387132ffa346284471722bc7f
MD5 536bb88115167d3cfd1a81d52c2f3d74
BLAKE2b-256 e0485117151d442774af8b76d5005a428c7729cec84eb67d85ff81c24918d001

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page