Git Product home page Git Product logo

xvfb_igv_singularity's Introduction

Repository to explain headless automatic plotting with igv

This tool can be used to script the taking of screenshots with IGV.

It can be used either locally on your PC (as a background task, without sacrificing your monitor), or even in completely headless environments such as compute clusters (for example, if your desktop isn't allowed direct access to secured data). It achieves this by using the "X virtual frame buffer", Xvfb

In case you do not have a local IGV/Xvfb installation on the relevant machines, we also provide an IGV_xfvb Docker/Singularity image for easy containerisation.

Requirements

For Singularity

  • working singularity installation
  • python3
  • .igv folder in the home directory of the current user

or on your local computer

  • full igv installation
  • xvfb-run installed and in $PATH
  • python3

Docker & Singularity

The image IGV_xfvb Image can be pulled and formated to singularity format using:

singularity pull docker://stephanholgerdrukewitz/igvplots:latest

How it works

  • Main entry point is the plotRegions.py script
  • plotRegions processes a vars.tsv 'todo list'.
    • The actual work is done inside PlotVarSingularity() or PlotVarIGVlocal() funtions from the igvXfvb.py script
    • both functions need an ID, chro, start, end, mapping, key
  • The vars.tsv file chro, start, end, mapping, are informations about the alignment file and the position of interest
    • ID and key are only uysed in the naming of the output, could be removed in future
  • both plotVar-functions write a 'plot.bat' file which is later read in by igvXfvb
  • plots are saved in a directory with the name Snaphots in your current working directory
  • every variant provided to PlotVarSingularity or PlotVarIGVlocal is plotted 3 times --> 30nt to both sides, 75nt to both sides, 150nt to both sides
  • PlotVarSingularity or PlotVarIGVlocal both call igv headless using :
xvfb-run --auto-servernum --server-num=1 java -Xmx8000m jar /opt/conda/bin/igv.jar -b plot.bat
  • /opt/conda/bin/igv.jar is the location of the igv.jar file in the docker image, might differ depending on your installation

Example generated plot.bat

This is an example plot.bat, created from the first line of the provided in vars.tsv.
See also the pseudocode in plotRegions.py, which reads out vars.tsv and calls PlotVarSingularity or PlotVarIGVlocal

new
maxPanelHeight 5000
genome hg19
snapshotDirectory Snapshots
load /mnt/pat2.bam
group strand
goto chr2:41196281-41196341
sort base
collapse
snapshot Patient2_pat2_brcaBlaBlub_pat2_out_pad30_collapse.png
expand
snapshot Patient2_pat2_brcaBlaBlub_pat2_out_pad30_expand.png
goto chr2:41196236-41196386
sort base
collapse
snapshot Patient2_pat2_brcaBlaBlub_pat2_out_pad75_collapse.png
expand
snapshot Patient2_pat2_brcaBlaBlub_pat2_out_pad75_expand.png
goto chr2:41196161-41196461
sort base
collapse
snapshot Patient2_pat2_brcaBlaBlub_pat2_out_pad150_collapse.png
expand
snapshot Patient2_pat2_brcaBlaBlub_pat2_out_pad150_expand.png
exit

Author

Stephan drukewitz --> [email protected] --> [email protected]

xvfb_igv_singularity's People

Contributors

juleskers avatar stephanholgerd avatar

Watchers

 avatar

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.