Skip to main content

Creates self-contained html pages for visual variant review with IGV (igv.js).

Project description

igv-reports

Python application to generate self-contained igv.js pages that can be opened within a browser with "file" protocol.

Installation

Prerequisites

igv-reports requires Python 3.6 or greater and pip. As with all Python projects use of a virtual enviornment is recommended. Instructions for creating a virtual environment using conda are below

Installing igv-reports

pip install igv-reports

igv-reports requires the package pysam which should be installed automatically. However on OSX this sometimes fails due to missing dependent libraries. This can be fixed following the procedure below, from the pysam docs;
"The recommended way to install pysam is through conda/bioconda. This will install pysam from the bioconda channel and automatically makes sure that dependencies are installed. Also, compilation flags will be set automatically, which will potentially save a lot of trouble on OS X."

conda config --add channels r
conda config --add channels bioconda
conda install pysam

Creating a report

A report consists of a table of sites or regions and associated igv views for each sites. Reports are created with command line script create_report. Command line arguments are described below. Although --tracks is optional, a typical report will include at least an alignment track (BAM or CRAM) file from which the variants were called.

Arguments:

  • Required
    • sites vcf or bed file of genomic sites
    • fasta reference fasta file, must be indexed
  • Optional
    • --tracks space-delimited list of track files, see below for supported formats
    • --ideogram ideogram file in UCSC cytoIdeo format
    • --template html template file
    • --output output file name default="igvjs_viewer.html"
    • --info-columns space delimited list of VCF info field names to include in variant table
    • --sample-columns space delimited list of VCF sample/format field names to include in variant table
    • --flanking genomic region to include either side of variant, default=1000
    • --standalone embed all javascript referenced via <script> tags in the page

Track file formats:

Currently supported track file formats are BAM, CRAM, VCF, BED, GFF3, and GTF. FASTA. BAM, CRAM, and VCF files must be indexed. Tabix is supported for other file types and it is recommended that all large files be indexed.

Examples

Data for the examples are available for download.

Creating a variant report from a VCF file:

create_report examples/variants/variants.vcf.gz https://s3.amazonaws.com/igv.broadinstitute.org/genomes/seq/hg38/hg38.fa --ideogram examples/variants/cytoBandIdeo.txt --flanking 1000 --info-columns GENE TISSUE TUMOR COSMIC_ID GENE SOMATIC --tracks examples/variants/variants.vcf.gz examples/variants/recalibrated.bam examples/variants/refGene.sort.bed.gz --output igvjs_viewer.html

Converting genomic files to data URIs for use in igv.js

The script ```create_datauri`` converts the contents of a file to a data uri for use in igv.js. The datauri will be printed to stdout.

Convert a gzipped vcf file to a datauri.

create_datauri examples/variants/variants.vcf.gz

Convert a slice of a remote cram file to a datauri.

create_datauri \
--region 8:127,738,322-127,738,508 \
https://s3.amazonaws.com/1000genomes/data/HG00096/alignment/HG00096.alt_bwamem_GRCh38DH.20150718.GBR.low_coverage.cram 

Creating a virtual environment

Instructions for creating a virtual environment using conda follow.

1. Install Anaconda: https://docs.anaconda.com/anaconda/

2. Create a virtual environment

conda create -n myenv python=3.7.1
conda install -n myenv pip
conda activate
conda install pip

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

igv-reports-0.9.3.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

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

igv_reports-0.9.3-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file igv-reports-0.9.3.tar.gz.

File metadata

  • Download URL: igv-reports-0.9.3.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for igv-reports-0.9.3.tar.gz
Algorithm Hash digest
SHA256 b37692732d20564508facfb128098814fe67b6196f6f3e58b38dd12e7bfa82c6
MD5 94bd73e62bd354f5eda2f9d641a76d0d
BLAKE2b-256 bf1f190946c78c63937b6bba6b7af0702429acaa1416785b4f41afa03648ac6c

See more details on using hashes here.

File details

Details for the file igv_reports-0.9.3-py3-none-any.whl.

File metadata

  • Download URL: igv_reports-0.9.3-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for igv_reports-0.9.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d38bc999ec56f484f1f6cecf0c8e1e393b713816991aae3205b0b7fa5c36cc2c
MD5 10db62f287c50ff693731381685c9208
BLAKE2b-256 828465af5b73a9c9d30bd2c8f34042794b7ea864d94b8d5b1bbbd2eba4081ebd

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