Skip to content

Instantly share code, notes, and snippets.

@idot
Created April 26, 2011 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save idot/942223 to your computer and use it in GitHub Desktop.
Save idot/942223 to your computer and use it in GitHub Desktop.
Display files from galaxy in IGB (needs copy of synonyms.txt)
<display id="igb_bed" version="1.0.0" name="display in ">
<link id="igb_bed" name="IGB">
<url>http://localhost:7085/UnibrowControl?version=${buildversion}&amp;${position}&amp;loadresidues=false&amp;feature_url_0=${bed_file.url}&amp;sym_name_0=${thenicename}&amp;sym_method_0=${bed_file.url}&amp;sym_bg_0=0xFFFFFF&amp;graph_show_label_0=true&amp;graph_show_axis_0=true&amp;graph_minvis_0=0.0&amp;graph_maxvis_0=100&amp;graph_float_0=false&amp;graph_style_0=Bar&amp;query_url=${bed_file.url}&amp;server_url=galaxy</url>
<param type="data" name="bed_file_for_name" viewable="False"/>
<param type="template" name="thenicename" viewable="False" strip="True">
#import re
#set nm=$bed_file_for_name.name
${re.sub('\W',"_",nm)}
</param>
<param type="data" name="bed_file" url="${thenicename}_${DATASET_HASH}.bed" strip_https="True" />
<param type="template" name="position" strip="True" >
#set line_count = 0
#set chrom = None
#set start = float( 'inf' )
#set end = 0
#for $line in open( $bed_file.file_name ):
#if $line_count &gt; 10: ##10 max lines to check for view port
#break
#end if
#if not $line.startswith( "#" ):
#set $fields = $line.split( "\t" )
#try:
#if len( $fields ) &gt;= max( $bed_file.metadata.startCol, $bed_file.metadata.endCol, $bed_file.metadata.chromCol ):
#if $chrom is None or $fields[ $bed_file.metadata.chromCol - 1 ] == $chrom:
#set chrom = $fields[ $bed_file.metadata.chromCol - 1 ]
#set start = min( $start, int( $fields[ $bed_file.metadata.startCol - 1 ] ) )
#set end = max( $end, int( $fields[ $bed_file.metadata.endCol - 1 ] ) )
#end if
#end if
#except:
#pass
#end try
#end if
#set line_count += 1
#end for
#if $chrom is not None:
seqid=${chrom}&amp;start=${start}&amp;end=${end + 1}
#else:
seqid=chr1&amp;start=10000&amp;end=10100
#end if
</param>
<param type="template" name="buildversion" strip="True" >
#set igbkey = "unknown"
#set dbkey=$bed_file.dbkey
#for $line in open('display_applications/igb/synonyms.txt', 'r')
#set $fields = $line.split( "\t" )
#for $field in $fields:
#if $field == dbkey:
#set igbkey = $fields[0]
#break
#end if
#end for
#end for
${igbkey}
</param>
</link>
</display>
@idot
Copy link
Author

idot commented Apr 26, 2011

Display files from galaxy in IGB

  1. create folder igb in display_applications

       mkdir ~/galaxy/display_applications/igb
    
  2. copy a synonyms.txt file from the igb distribution there

       cp ~/work/igb/resources/synonyms.txt ~/galaxy/display_applications/igb/synonyms.txt
    
  3. copy xml files from this gist there

  4. register xml files in datatypes_conf.xml
    for data type bed (search for <datatype extension="bed" type="galaxy.datatypes.interval:Bed" display_in_upload="true">) and insert

      <display file="igb/igb_bed.xml" />
    
  5. restart galaxy and hope for the best

known problems:

there is a problem with the sym_method that has to be created differently. It currenlty prevents the name to be shown in a nice way in the graph (or track - I confuse the two).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment