# HG changeset patch
# User saskia-hiltemann
# Date 1438096613 14400
# Node ID aad38011de338eac999bf3b8028885f53a2bb634
Uploaded
diff -r 000000000000 -r aad38011de33 README
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/README Tue Jul 28 11:16:53 2015 -0400
@@ -0,0 +1,29 @@
+IGV screenshot tool
+
+Installation
+-----------------------
+IMPORTANT: this tool assumes java runtime and Xvfb to be installed on the system!
+
+installing Xvfb on Ubuntu:
+ apt-get install Xvfb
+
+
+Dependencies
+----------------------
+Dependencies installed with this tool: IGV version 2.3.57
+
+
+Troubleshooting
+-----------------------
+tested on Ubuntu, IGV seems quite fussy depending on version..
+
+--
+If you get this error:
+(process:52487): GLib-GIO-ERROR **: Settings schema 'org.gnome.system.proxy' is not installed
+
+Fix by installing:
+sudo apt-get install gsettings-desktop-schemas
+--
+
+
+
diff -r 000000000000 -r aad38011de33 igvscreenshot.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/igvscreenshot.sh Tue Jul 28 11:16:53 2015 -0400
@@ -0,0 +1,115 @@
+# Get igv screenshot
+
+echo $@
+
+# parse input parameters
+set -- `getopt -n$0 -u -a --longoptions="track: region: archive: build: outfile: scriptdir: ftype: index: label: viewaspairs: view:" "h:" "$@"` || usage
+[ $# -eq 0 ] && usage
+
+while [ $# -gt 0 ]
+do
+ case "$1" in
+ --track) tracks+=",$2";shift;;
+ --region) region=$2;shift;;
+ --build) build=$2;shift;;
+ --outfile) outfile=$2;shift;;
+ --scriptdir) scriptdir=$2;shift;;
+ --ftype) ftypes+=",$2";shift;;
+ --index) indexfiles+=",$2";shift;;
+ --label) tracklabels+=",$2";shift;;
+ --view) view+=",$2";shift;;
+ --viewaspairs) viewaspairs+=",$2";shift;;
+ -h) shift;;
+ --) shift;break;;
+ -*) usage;;
+ *) break;;
+ esac
+ shift
+done
+
+# location of IGV installation
+igvlocation="${scriptdir}/IGV_2.1.28"
+
+# set preferences properly
+echo -e "IGV.track.show.attribute.views=true
+LAST_CHROMOSOME_VIEWED_KEY=All
+DEFAULT_GENOME_KEY=${build}" > prefs.properties
+
+#IGV.Bounds=0,0,$width,$height
+#SHOW_SEQUENCE_TRANSLATION=true
+#IGV.Frame.ExtendedState=0
+
+# parse track, filetype and indexfile strings
+tracks=${tracks/,/} # remove leading comma from list
+tracks=${tracks//,/ } # replace commas with spaces
+ftypes=${ftypes/,/} # remove leading comma from list
+indexfiles=${indexfiles/,/} # remove leading comma from list
+tracklabels=${tracklabels/,/} # remove leading comma from list
+tracklabels=${tracklabels// /_} # replace spaces with underscores for track labels
+view=${view/,/} # remove leading comma from list
+viewaspairs=${viewaspairs/,/} # remove leading comma from list
+
+# generate batch file recipe for igv
+echo -e "new
+genome ${build}" > recipe.txt
+
+# add tracks to recipe
+IFS=',' read -a ftypearray <<< "$ftypes"
+IFS=',' read -a indexarray <<< "$indexfiles"
+IFS=',' read -a labelarray <<< "$tracklabels"
+IFS=',' read -a viewarray <<< "$view"
+IFS=',' read -a viewaspairsarray <<< "$viewaspairs"
+count=0
+for track in $tracks
+do
+
+ # make symlink to file with the proper extension (or IGV will not work)
+ ftype=${ftypearray[count]}
+ label=${labelarray[count]}
+ ltrack="${label}.${ftype}"
+ ln -s ${track} ${ltrack}
+
+ # link the index file too if needed
+ if [[ $ftype == "bam" ]]
+ then
+ indexltrack="${label}.bam.bai"
+ ln -s ${indexarray[count]} ${indexltrack}
+ fi
+
+ # add track to recipe
+ echo -e "load ${ltrack}" >>recipe.txt
+
+ # set view for track (collapsed/expanded/squished)
+ echo -e "${viewarray[count]} ${ltrack}" >> recipe.txt
+
+ # set to view as pairs if requested
+ if [[ ${viewaspairsarray[count]} == "yes" ]]
+ then
+ echo -e "viewaspairs ${ltrack}" >> recipe.txt
+ fi
+
+
+ count=$[$count+1]
+
+done
+
+
+echo -e "snapshotDirectory .
+goto ${region//,/ }
+sort base
+snapshot screenshot.png
+exit" >> recipe.txt
+
+# for debugging purposes:
+echo -e "\nIGV batch recipe is:\n"
+cat recipe.txt
+
+# setup X environment
+echo -e "\nsetting up Xvfb:\n"
+Xvfb :0 2>&1 &
+export DISPLAY=:0
+
+# run igv
+echo -e "\nrunning IGV:\n"
+igv.sh -b recipe.txt -o prefs.properties 2>&1
+
diff -r 000000000000 -r aad38011de33 igvscreenshot.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/igvscreenshot.xml Tue Jul 28 11:16:53 2015 -0400
@@ -0,0 +1,84 @@
+
+
+ specifying tracks and a genomic location
+
+
+ igv
+
+
+
+
+ igvscreenshot.sh
+ --build $reference
+ #for $i, $t in enumerate( $tracks )
+ --track ${t.inputfile}
+ --ftype ${t.inputfile.extension}
+ --view ${t.view}
+ --viewaspairs ${t.viewaspairs}
+ #if not $t.trackname
+ #set $tracklabel = "noname"
+ #else
+ #set $tracklabel = $t.trackname
+ #end if
+ --label $tracklabel
+ #if $t.inputfile.extension == "bam"
+ --index $t.inputfile.metadata.bam_index
+ #else
+ --index "none"
+ #end if
+ #end for
+ --region "$region"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+This tool will create an IGV screenshot of the desired location(s) with the desired tracks.
+
+Tracks may be bam, vcf, bed, gff or gtf format.
+
+Multiple regions may be specified (comma-separated)
+
+
+
+
+
\ No newline at end of file
diff -r 000000000000 -r aad38011de33 tool_dependencies.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_dependencies.xml Tue Jul 28 11:16:53 2015 -0400
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+ http://www.broadinstitute.org/igv/projects/downloads/IGV_2.3.57.zip
+ chmod a+x igv.sh
+
+ .
+ $INSTALL_DIR
+
+
+ $INSTALL_DIR
+
+
+
+
+
+
+ Downloads and installs the igv 2.3.57 package.
+
+
+
+