# HG changeset patch # User mvdbeek # Date 1498485606 14400 # Node ID d828cf6bff42851df4657d79d242419871ec06ab planemo upload for repository https://github.com/bardin-lab/readtagger/tree/master/galaxy commit 4824aeaa8107bd30ec786e8ca81779f053f0e736-dirty diff -r 000000000000 -r d828cf6bff42 igv_make_screenshots.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/igv_make_screenshots.xml Mon Jun 26 10:00:06 2017 -0400 @@ -0,0 +1,90 @@ + + + xvfbwrapper + + load_session.txt && + echo snapshotDirectory "\$PWD" >> load_session.txt && + cat load_session.txt '$script_file' '$exit_session' > '$igv_session_out' && + python $__tool_directory__/xvfb_igv.py '$igv_session_out' $width,$height && + zip '$screenshots_out' *.png + ]]> + + + + + #for $inputsection in $inputfiles + #set $path="%s.%s" % ($inputsection.input.element_identifier, $inputsection.input.extension) + + #end for + + #for $inputsection in $inputfiles + #if $inputsection.input.is_of_type('bam') + #set $label=$inputsection.label if not $inputsection.label == '' else $inputsection.input.element_identifier + #set $path="%s.%s" % ($inputsection.input.element_identifier, $inputsection.input.extension) + + ## First track is the coverage + + + + ## Second track is the actual BAM alignment file + + + + + #end if + #end for + + + + + + #for $inputsection in $inputfiles + #if not $inputsection.input.is_of_type('bam') + #set $label=$inputsection.label if not $inputsection.label == '' else $inputsection.input.element_identifier + #set $path="%s.%s" % ($inputsection.input.element_identifier, $inputsection.input.extension) + + #end if + #end for + + + + ]]> + +load $igv_session + + +exit + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r d828cf6bff42 test-data/complete_batchscript.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/complete_batchscript.txt Mon Jun 26 10:00:06 2017 -0400 @@ -0,0 +1,2 @@ +goto 2R:18158676-7052469 +snapshot 2R_rover_18158676_7052469_slop300.png diff -r 000000000000 -r d828cf6bff42 test-data/rover_dont_split.bam Binary file test-data/rover_dont_split.bam has changed diff -r 000000000000 -r d828cf6bff42 xvfb_igv.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xvfb_igv.py Mon Jun 26 10:00:06 2017 -0400 @@ -0,0 +1,17 @@ +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]) +