view xvfb_igv.py @ 10:afb3f4c224d4 draft

planemo upload for repository https://github.com/bardin-lab/readtagger/tree/master/galaxy commit 4824aeaa8107bd30ec786e8ca81779f053f0e736-dirty
author mvdbeek
date Mon, 03 Jul 2017 11:42:19 -0400
parents d828cf6bff42
children 64eb1ffd7872
line wrap: on
line source

import os
import subprocess
import sys

import xvfbwrapper


def take_screenshots(igv_script, screensize):
    width, height = screensize.split(',')
    with xvfbwrapper.Xvfb(width=width, height=height) as xvfb:
        exit_code = subprocess.call(['igv', '--batch', igv_script], env=os.environ.copy())
    sys.exit(exit_code)


if __name__ == '__main__':
    take_screenshots(sys.argv[1], sys.argv[2])