Giter Club home page Giter Club logo

jigv's Introduction

igv.js is a great way to view aligments and other genomic data. It requires that the files are hosted on a server with access to the original data. javascript.

jigv encodes all variants, alignments, and annotations into a single HTML page (or as separate javascript file for each variant) that you can send to collaborators who don't have access to the cluster where your data is stored.

The resulting file is very fast to navigate; the left/right arrow keys advance to next/previous variants of interest.

Usage looks like:

jigv \
    --sample HG01053 \     # the sample of interest drawn in top panel
    --ped trio.ped \       # jigv will use this to also show parents and sibs of --sample
    --sites dn.vcf.gz \    # e.g. candidate de novo varants
    --fasta $reference_fasta \
    --annotation hg38.refGene.bed.gz \ # see: https://github.com/brentp/jigv/wiki/bed12
    --annotation LCR-hs38.bed.gz \     # specify as many of these as needed.
    /path/to/*.cram > denovos.html

With that, denovos.html will contain all genomic data around variants of interest embedded within it.

With this, we are able to encode 924 candidate de novo variants into a 31MB html file that includes alignments for the proband, mom, and dad.

See Examples for more

installation

grab a static linux binary from releases

notes and features

navigation

jigv supports navigation along variants in a VCF file using the left and right arrow keys. it uses the --sites VCF track as the one to navigate through.

automated screenshots

given an html file at e.g. denovos.html, a PNG screenshot for region=chr5:1410040-1412784 can be created with

google-chrome --window-size=1200,1200  --virtual-time-budget=10000 \
   --headless --run-all-compositor-stages-before-draw \
   --screenshot=${region/:/-}.png "denovos.html#$region"

This can be scripted with your favorite language for a set of regions.

options

  jigv [options] [xams ...]

Arguments:
  [xams ...]       indexed bam or cram files for relevant samples. read-groups must match samples in vcf.

Options:
  --sample=SAMPLE            sample-id for proband or sample of interest (default is first vcf sample)
  --sites=SITES              VCF or BED containing variants of interest for --sample. If this contains ':', then it's used as a single region and the first bam/cram given is the sample of interest. If it ends with '.bed' or '.bed.gz' it's assumed to be BED format.
  -g, --genome-build=GENOME_BUILD
                             genome build (e.g. hg19, mm10, dm6, etc, from https://s3.amazonaws.com/igv.org.genomes/genomes.json).  If this is specified then the page will request fasta, ideogram and gene data from a server.
  --cytoband=CYTOBAND        optional path to cytoband/ideogram file
  --annotation=ANNOTATION    path to additional bed or vcf file to be added as a track; may be specified multiple times
  --ped=PED                  pedigree file used to find relations for --sample
  --prefix=PREFIX            if specified, encoded data for each region is written to it's own js file and no html is generated. this is a path prefix like: 'jigv_encoded/HG002/' where  where and `$site.js` will be added by jigv
  --prefix-raw               by default if --prefix is specified, the data is written to a javascript variable and includes the 'data:base64' prefix. if this option is also specified, then the raw base64 encoded data is written to the file.
  --fasta=FASTA              path to indexed fasta file; required for cram files
  --flank=FLANK              bases on either side of the variant or region to show (default: 100) (default: 100)

prefix

By default, jigv will embed all data for all sites into a single html file. This can scale up to about 2000 variants for a trio at which point the single file becomes quite large (~60MB). Using --prefix, it's possible to send each encoded site to a separate file. These can be loaded on demand from a server or sent to the user and loaded as a script on demand from the local file system.

Files written with --prefix but without --prefix-raw' can be loaded from the local file-sytem of the user (or from a server depending on if they are viewing as file:///...` on their local system or on a server. The code for that looks like this:

    var jigv_data; // define this here, but it is set when the script is loaded.
    var s = document.createElement("script")
    s.type = "text/javascript"
    s.src = "$sample/chr1-1746431-A-T.jigv.js" // path to whichever file made by jigv.
    s.onload = function(a, b) {
        jigv_data["showChromosomeWidget"] = false
        jigv_data["search"] = false
        jigv_data["queryParametersSupported"] = true
        jigv_data["showCursorTrackingGuide"] = true

        var div = document.getElementById("igv")
        meta_options = {"sessionURL": jigv_data }
        igv.createBrowser(div, meta_options)
    }

note that jigv writes the data as jigv_data so once the file is loaded, it can be accessed via that variable name.

limitations

  • if you have some custom javascript used with igv.js, that is generally useful, please open an issue so I can add it.
  • not all file types are supported
  • the sites file must contain only the variants to plot; there is no filtering in jigv

See Also

  • igv-reports by the IGV team does this as well. jigv adds extra features for working with pedigrees, reducing dependencies, and reducing the output size. That said, igv-reports may work well for your use-case.

examples

  1. a set of bam files given a set of regions in BED format:
jigv \
    --fasta $fasta \
    --sites $bed \
    /path/to/*.bam > regions.html

This will use the first 8 bam files. Beyond that number the files are too large.

  1. a set of de novo variants for a trio:
jigv \
    --sample $proband \     # the sample of interest drawn in top panel
    --ped trio.ped \        # jigv will use this to also show parents and sibs of --sample
    --sites dn.vcf.gz \     # file with candidate de novo varants
    --fasta $fasta \
    --annotation hg38.refGene.bed.gz \ # see: https://github.com/brentp/jigv/wiki/bed12
    --annotation LCR-hs38.bed.gz     \ # specify as many of these as needed.
    /path/to/*.cram > denovos.html
  1. a single region
jigv \
    --sample $proband \     # the sample of interest drawn in top panel
    --ped trio.ped \        # jigv will use this to also show parents and sibs of --sample
    --sites "chr1:3453454-3453554" \  # single region.
    --fasta $fasta \
    --annotation hg38.refGene.bed.gz \ # see: https://github.com/brentp/jigv/wiki/bed12
    --annotation LCR-hs38.bed.gz     \ # specify as many of these as needed.
    /path/to/*.cram > denovos.html

jigv's People

Contributors

brentp avatar brwnj avatar juanesarango avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jigv's Issues

customization

i think a simple way to allow customization is just to let the user inject some javascript into the template.
They will have access to options which includes options.tracks so a user could, for example inject code to iterate over options.tracks find any alignment track and change the row height or alignmentRowHeight or any of the features here

sort by base

Hi Brent,

One of my fav option is sort by base thats show non-ref-allele reads on top of the alignment in the Desktop IGV app. Is it possible to achieve this in jigv? igv.js may not support this either.

Cheers,
Richard

jigv settings for targeted deep sequencing

would love to use jigv for manually checking the targeted deep sequencing variants. It seems that when it gets over 1500X there is some sampling of reads going on. It is not obvious where to modify the code to ask jigv to not subsample the reads.

Read sequence is "*"

right click on read -> View read sequence sometimes results in:

Screen Shot 2020-04-09 at 2 23 58 PM

One occurs on some reads, while others are fine. Can PM you the file if that's helpful.

Should print help when no input provided?

$ ./jigv 
INFO Jester is making jokes at http://0.0.0.0:5001
Starting 1 threads
/home/brentp/src/jigv/jigv.nim(416) jigv
/home/brentp/src/jigv/jigv.nim(413) main
/root/.nimble/pkgs/jester-0.4.3/jester.nim(482) serve
/root/.nimble/pkgs/httpbeast-0.2.2/httpbeast.nim(423) run
/root/.nimble/pkgs/httpbeast-0.2.2/httpbeast.nim(271) eventLoop
/nim/lib/pure/net.nim(779) bindAddr
/nim/lib/pure/includes/oserr.nim(94) raiseOSError
Error: unhandled exception: Address in use [OSError]

list of regions to iterate through

given a VCF or BED, desktop IGV can iterate through variants/regions with ctrl+f. AFAICT, that's not available in igv.js. But we could generate a list of links to click through.

Anotation track

Is it possible to view the annotation track in the current jigv version? How to do this?

IDEA: seeing reads for more than one sample without pedigree file

Hello Brent!

Thank you for creating jigv, it looks promising.

I work with normal-tumor matched samples as well as samples collected over time and it would be great to see them together. I believe that I can make a fake pedigree file for them, right? Pedigree format is something new for me, so I will appreciate any suggestions how to make it!

If the above will not work, it would be great to add more than one --sample and load bam/cram files for many samples as it is possible with pedigree file.

Best wishes,
Agata

parameter usage for RNA sequencing samples

Hi, I have multiple bam files (test1.bam test2.bam test3.bam) and the genome fasta and annotation gff.
I want to visualize it with jigv. Could you please post the command for this.

Thanks

Provide small example output

Hi @brentp !

Thanks for the fantastic tool - would be great to have (similar to what igv.js and other tools do) a small example HTML available here in the repository so that end users can simply get a quick feeling for what the tool is capable of ๐Ÿ‘๐Ÿป

Windows build

Is it possible to make a static build for Windows?

Custom Template

Hi,

This is great piece of software. Was wondering if it was possible to add option to use custom html template jigv-template.html?

Or can I just set the env variable of JIGV_TEMPLATE?

Was thinking of allowing user to submit "real" or "not real" to a database for each variant. We currently do a IGV check on each variant in our lab and need to record this somewhere. Alternatively I may try and edit template to allow user to download text report with decision for each variant.

Thanks,

Joseph

possible to display gene name by default?

Hi Brent,

I was wondering if the .html can display the gene name or gene_id automatically without having to click on a transcript? I've attached a screenshot.

Thanks,
Ming
Screenshot 2023-05-16 at 10 21 50 AM

vcf sites html does not show alignments

thank-you for a really great tool. I just have one issue - when I use .vcf to define sites, the .html output does not show any alignments in the alignments track, instead I just get a bar at the nucleotide with the mutation, and when I click on the bar it displays the VCF information. I do get the reads and alignments when I use .bed to define the sites.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.