Multiple Alignment Viewer GMAJ.py $out_file1 $maf_input $gmaj_file $filenames_file #:gmaj title = "Galaxy: $maf_input.name" alignfile = input.maf refseq = $refseq tabext = .bed .gff .gtf #if $nowarn.value: nowarn = $nowarn #end if #set $seq_count = 0 #for $annotation_count, $annotation in $enumerate( $annotations ): #if $annotation.annotation_style.style == "galaxy": #set $species_chromosomes = {} #if $maf_input.dataset.metadata.species_chromosomes: #for $line in open( $maf_input.dataset.metadata.species_chromosomes.file_name ): #set $fields = $line.split( "\t" ) #if $fields: #set $spec = $fields.pop( 0 ) #set $species_chromosomes[spec] = $fields #end if #end for #end if #if $species_chromosomes and $annotation.annotation_style['species'].value in $species_chromosomes and $species_chromosomes[$annotation.annotation_style['species'].value]: #set $seq_names = [ "%s.%s" % ( $annotation.annotation_style['species'].value, $chrom ) for $chrom in $species_chromosomes[$annotation.annotation_style['species'].value]] #else: #set $seq_names = [$annotation.annotation_style['species']] #end if #else: #set $seq_names = [$annotation.annotation_style['seq_name']] #end if #for $seq_name in $seq_names: seq ${seq_count}: seqname = $seq_name #if $annotation.annotation_style['exons_file'].dataset: exons = ${annotation_count}.exons.${annotation.annotation_style['exons_file'].extension} #end if #if $annotation.annotation_style['repeats_file'].dataset: repeats = ${annotation_count}.repeats.${annotation.annotation_style['repeats_file'].extension} #end if #if $annotation.annotation_style['links_file'].dataset: links = ${annotation_count}.links.${annotation.annotation_style['links_file'].extension} #end if #if $annotation.annotation_style['underlays_file'].dataset: underlays = ${annotation_count}.underlays.${annotation.annotation_style['underlays_file'].extension} #end if #if $annotation.annotation_style['highlights_file'].dataset: highlights = ${annotation_count}.highlights.${annotation.annotation_style['highlights_file'].extension} #end if #if $annotation.annotation_style.style == "basic": offset = $annotation.annotation_style['offset'] #end if #set $seq_count = $seq_count + 1 #end for #end for #for $annotation_count, $annotation in $enumerate( $annotations ): #if $annotation.annotation_style['exons_file'].dataset: $annotation.annotation_style['exons_file'] = ${annotation_count}.exons.${annotation.annotation_style['exons_file'].extension} #end if #if $annotation.annotation_style['repeats_file'].dataset: $annotation.annotation_style['repeats_file'] = ${annotation_count}.repeats.${annotation.annotation_style['repeats_file'].extension} #end if #if $annotation.annotation_style['links_file'].dataset: $annotation.annotation_style['links_file'] = ${annotation_count}.links.${annotation.annotation_style['links_file'].extension} #end if #if $annotation.annotation_style['underlays_file'].dataset: $annotation.annotation_style['underlays_file'] = ${annotation_count}.underlays.${annotation.annotation_style['underlays_file'].extension} #end if #if $annotation.annotation_style['highlights_file'].dataset: $annotation.annotation_style['highlights_file'] = ${annotation_count}.highlights.${annotation.annotation_style['highlights_file'].extension} #end if #end for .. class:: infomark **Reference Sequence:** The default option, "First sequence in each block", is the correct choice for the vast majority of MAF alignments. The alternative, "Any sequence", will allow you to flip the blocks to view them with any of the MAF sequences as the reference, but this is only appropriate if the file was generated by a sequence-symmetric alignment program such as TBA_. Using "Any sequence" with an ordinary MAF will **not** give the same results as if that alignment had been run with a different reference sequence. .. class:: infomark **Annotation Style:** The default style, "Galaxy", specifies one set of annotations for each species in the MAF file; it assumes that if you have, say, exons for several chromosomes of one species, they are all together in one file. The other style, "Basic", is more flexible but cumbersome: a separate set of files is specified for each sequence (e.g. chromosome), and you must fill in the full sequence name as it appears in the MAF. The Basic style also allows you to provide a display offset that GMAJ will add to all of the position labels for that sequence. With either style, specifying more than one set of annotations for the same sequence will result in an error message from GMAJ. ---- **What it does** GMAJ is an interactive viewer for MAF alignments, with support for optional annotation data. In addition to browsing the alignments, you can select and export them according to a variety of criteria and send the output back to your Galaxy history. For detailed information on GMAJ, click here_. .. _here: /static/gmaj/docs/gmaj_readme.html .. _TBA: http://www.bx.psu.edu/miller_lab/