diff hubArchiveCreator.xml @ 29:7e8a8b732db3 draft

planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 1a81ebd0ddea950b84af3fc830e9267a4814b29f
author yating-l
date Wed, 16 May 2018 18:04:20 -0400
parents 6aa28a85cc38
children e7c4be523cb7
line wrap: on
line diff
--- a/hubArchiveCreator.xml	Mon Jul 10 17:08:38 2017 -0400
+++ b/hubArchiveCreator.xml	Wed May 16 18:04:20 2018 -0400
@@ -1,8 +1,11 @@
-<tool id="hubArchiveCreator" name="Hub Archive Creator" version="2.4.2">
+<tool id="hubArchiveCreator" name="Hub Archive Creator" version="2.5.0">
     <description>
         This Galaxy tool permits to prepare your files to be ready for
         Assembly Hub visualization.
     </description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
 
     <requirements>
         <requirement type="package" version="340">ucsc_hac</requirement>
@@ -23,156 +26,192 @@
     <!-- Idea: python \ -augustus [parameters] \ -trfBig [parameters] -->
     <command detect_errors="exit_code"><![CDATA[
         mkdir -p $output.extra_files_path;
+        
+        ## Dump the tool parameters into a JSON file 
+        python $json_file parameters.json;
 
-        python $__tool_directory__/hubArchiveCreator.py
+        python $__tool_directory__/hubArchiveCreator.py --data_json parameters.json -o $output;
+
 
-        ## Ask the user to enter the genome name
-        --genome_name '$genome_name'
+    ]]></command>
+    <configfiles>
+        <configfile name="json_file">
+import json
+import sys
 
-        #import json
+file_path = sys.argv[1]
+#set global $data_parameter_dict = {}
 
-        #set global data_parameter_dict = {}
+## Ask the user to enter the genome name
+#silent $data_parameter_dict.update({"genome_name": str($genome_name)})
+
+## Function to retrieve the data of the inputs
+#def prepare_json($datatype, $input_to_prepare, $order_index, $extra_data_dict={})
+    #set false_path = str($input_to_prepare)
+    #set $data_dict = {"false_path": $false_path}
 
-        ## Function to retrieve the data of the inputs
-        #def prepare_json($input_to_prepare, $order_index, $extra_data_dict={})
-            #set false_path = str($input_to_prepare)
-            #set name = $input_to_prepare.name
+    #set name = str($input_to_prepare.name)
+    #silent $data_dict.update({"name": $name})
+    #silent $data_dict.update($extra_data_dict)
+    ## Add the ordering by taking the tool form indexes
+    #silent $data_dict.update({"order_index": $order_index})
 
-            #set data_dict = {"name": $name}
-            #silent data_dict.update($extra_data_dict)
+    #if $datatype in $data_parameter_dict
+        #silent $data_parameter_dict[$datatype].append($data_dict)
+    #else
+        #set array_inputs = []
+        #silent $array_inputs.append($data_dict)
+        #silent $data_parameter_dict.update({$datatype: $array_inputs})
+    #end if 
+#end def
 
-            ## Add the ordering by taking the tool form indexes
-            #silent $data_dict.update({"order_index": $order_index})
+## Get the number of digits from tracks, to have a unique integer from group index and track index
+
+#set temp_max_digit = 0
 
-            #silent $data_parameter_dict.update({$false_path: $data_dict})
-
-        #end def
+#for $g in $group
+    #if len($g.format) > $temp_max_digit
+        #silent temp_max_digit = len($g.format)
+    #end if
+#end for
 
 
-        ## Get the number of digits from tracks, to have a unique integer from group index and track index
+#set nb_digits_max_track = len(str($temp_max_digit))
 
-        #set temp_max_digit = 0
+## END Get the number of digits
 
-        #for $g in $group
-            #if len($g.format) > $temp_max_digit
-                #silent temp_max_digit = len($g.format)
-            #end if
-        #end for
-
-        #set nb_digits_max_track = len(str($temp_max_digit))
-
-        ## END Get the number of digits
+#for $i_g, $g in enumerate( $group )
+    #for $i, $f in enumerate( $g.format )
+        ## Create the order index using index_group+1 concatenated with index_track
+        #set index_group_final = str($i_g + 1)
+        #set index_track_final = str($index_group_final) + str($i).zfill($nb_digits_max_track)
 
-        #for $i_g, $g in enumerate( $group )
-            #for $i, $f in enumerate( $g.format )
-                ## Create the order index using index_group+1 concatenated with index_track
-                #set index_group_final = str($i_g + 1)
-                #set index_track_final = str($index_group_final) + str($i).zfill($nb_digits_max_track)
+        ## For each format, we have a few mandatory fields we store in a dict
+        #set track_color = str($f.formatChoice.track_color)
+        #set group_name = str($g.group_name)
+        #set longLabel = str($f.formatChoice.longLabel)
+        #set extra_data_dict = {"track_color": $track_color,
+                                "group_name": $group_name,
+                                "long_label": $longLabel}
 
-                ## For each format, we have a few mandatory fields we store in a dict
-                #set track_color = str($f.formatChoice.track_color)
-                #set group_name = str($g.group_name)
-                #set longLabel = str($f.formatChoice.longLabel)
-                #set extra_data_dict = {"database": "",
-                                        "track_color": $track_color,
-                                        "group_name": $group_name,
-                                        "long_label": $longLabel}
+        #if $f.formatChoice.format_select == "bam"
+            #set bam_index = $f.formatChoice.BAM.metadata.bam_index
+
+            ## Add Bam format specific fields
+            #silent $extra_data_dict.update({"index": $bam_index})
 
-                #if $f.formatChoice.format_select == "bam"
-                    --bam $f.formatChoice.BAM
-                    #set bam_index = $f.formatChoice.BAM.metadata.bam_index
-
-                    ## Add Bam format specific fields
-                    #silent extra_data_dict.update({"index": $bam_index})
-
-                    #silent $prepare_json($f.formatChoice.BAM, $index_track_final, extra_data_dict)
+            #silent $prepare_json("Bam", $f.formatChoice.BAM, $index_track_final, $extra_data_dict)
+        #end if
+        #if $f.formatChoice.format_select == "bed"
+            #if $f.formatChoice.bedChoice.bed_select == "bed_generic"
+                #silent $prepare_json("Bed", $f.formatChoice.bedChoice.BED, $index_track_final,
+                                                $extra_data_dict)
+            #end if
+            #if $f.formatChoice.bedChoice.bed_select == "bed_cytoBand"
+                #silent $prepare_json("CytoBand", $f.formatChoice.bedChoice.BED_cytoBand, $index_track_final,
+                                                $extra_data_dict)
+            #end if
+            #if $f.formatChoice.bedChoice.bed_select == "bed_simple_repeats_option"
+                #silent $prepare_json("BedSimpleRepeats", $f.formatChoice.bedChoice.BED_simple_repeats, $index_track_final,
+                                                $extra_data_dict)
+            #end if
+            #if $f.formatChoice.bedChoice.bed_select == "bed_splice_junctions_option"
+                #silent $prepare_json("BedSpliceJunctions", $f.formatChoice.bedChoice.BED_splice_junctions, $index_track_final,
+                                                $extra_data_dict)
+            #end if
+            #if $f.formatChoice.bedChoice.bed_select == "bed_blast_alignment_option"
+                #set database = str($f.formatChoice.bedChoice.database)
+                #silent $extra_data_dict.update({"database": $database})
+                #if $f.formatChoice.bedChoice.add_trix_index.add_trix_index_selector == "yes"
+                    #for i in $f.formatChoice.bedChoice.add_trix_index.trix_index
+                        #if $i.element_identifier.endswith("ix")
+                            #$extra_data_dict.update({"index_ix": str($i)})
+                        #elif $i.element_identifier.endswith("ixx")
+                            #$extra_data_dict.update({"index_ixx": str($i)})
+                        #end if
+                    #end for
+                    ##set ix_index = str($f.formatChoice.bedChoice.add_trix_index.trix_index.index_ix)
+                    ##set ixx_index = str($f.formatChoice.bedChoice.add_trix_index.trix_index.index_ixx)
+                    ##silent $extra_data_dict.update({"indexIx": $ix_index, "indexIxx": $ixx_index})
                 #end if
-                #if $f.formatChoice.format_select == "bed"
-                    #if $f.formatChoice.bedChoice.bed_select == "bed_generic"
-                        --bed $f.formatChoice.bedChoice.BED
-                        #silent $prepare_json($f.formatChoice.bedChoice.BED, $index_track_final,
-                                                extra_data_dict)
-                    #end if
-                    #if $f.formatChoice.bedChoice.bed_select == "bed_cytoBand"
-                        --cytoBand $f.formatChoice.bedChoice.BED_cytoBand
-                        #silent $prepare_json($f.formatChoice.bedChoice.BED_cytoBand, $index_track_final,
-                                                extra_data_dict)
-                    #end if
-                    #if $f.formatChoice.bedChoice.bed_select == "bed_simple_repeats_option"
-                        --bedSimpleRepeats $f.formatChoice.bedChoice.BED_simple_repeats
-                        #silent $prepare_json($f.formatChoice.bedChoice.BED_simple_repeats, $index_track_final,
-                                                extra_data_dict)
-                    #end if
-                    #if $f.formatChoice.bedChoice.bed_select == "bed_splice_junctions_option"
-                        --bedSpliceJunctions $f.formatChoice.bedChoice.BED_splice_junctions
-                        #silent $prepare_json($f.formatChoice.bedChoice.BED_splice_junctions, $index_track_final,
-                                                extra_data_dict)
+                #silent $prepare_json("BedBlastAlignments", $f.formatChoice.bedChoice.BED_blast_alignment, $index_track_final,
+                                             $extra_data_dict)
+            #end if
+            #if $f.formatChoice.bedChoice.bed_select == "bed_blat_alignment_option"
+                #set database = str($f.formatChoice.bedChoice.database)
+                #silent $extra_data_dict.update({"database": $database})
+                #if $f.formatChoice.bedChoice.add_trix_index.add_trix_index_selector == "yes"
+                    #for i in $f.formatChoice.bedChoice.add_trix_index.trix_index
+                        #if $i.element_identifier.endswith("ix")
+                            #$extra_data_dict.update({"index_ix": str($i)})
+                        #elif $i.element_identifier.endswith("ixx")
+                            #$extra_data_dict.update({"index_ixx": str($i)})
+                        #end if
+                    #end for
+                    ##set ix_index = str($f.formatChoice.bedChoice.add_trix_index.trix_index.index_ix)
+                    ##set ixx_index = str($f.formatChoice.bedChoice.add_trix_index.trix_index.index_ixx)
+                    ##silent $extra_data_dict.update({"indexIx": $ix_index, "indexIxx": $ixx_index})
+                #end if
+                #silent $prepare_json("BedBlatAlignments", $f.formatChoice.bedChoice.BED_blat_alignment, $index_track_final,
+                                             $extra_data_dict)
+            #end if
+        #end if
+        #if $f.formatChoice.format_select == "psl"
+            #silent $prepare_json("Psl", $f.formatChoice.PSL, $index_track_final,
+                                           $extra_data_dict)
+        #end if
+        #if $f.formatChoice.format_select == "bigwig"
+            #silent $prepare_json("BigWig", $f.formatChoice.BIGWIG, $index_track_final,
+                                            $extra_data_dict)
+        #end if
+        #if $f.formatChoice.format_select == "bigbed"
+            #if $f.formatChoice.add_trix_index.add_trix_index_selector == "yes"
+                ##set ix_index = str($f.formatChoice.add_trix_index.trix_index.index_ix)
+                ##set ixx_index = str($f.formatChoice.add_trix_index.trix_index.index_ixx)
+                #for i in $f.formatChoice.add_trix_index.trix_index
+                    #if $i.element_identifier.endswith("ix")
+                        #$extra_data_dict.update({"index_ix": str($i)})
+                    #elif $i.element_identifier.endswith("ixx")
+                        #$extra_data_dict.update({"index_ixx": str($i)})
                     #end if
-                    #if $f.formatChoice.bedChoice.bed_select == "bed_blast_alignment_option"
-                        --bedBlastAlignments $f.formatChoice.bedChoice.BED_blast_alignment
-                        #set database = str($f.formatChoice.bedChoice.database)
-                        #silent extra_data_dict.update({"database": $database})
-                        #silent $prepare_json($f.formatChoice.bedChoice.BED_blast_alignment, $index_track_final,
-                                             extra_data_dict)
-                    #end if
-                    #if $f.formatChoice.bedChoice.bed_select == "bed_blat_alignment_option"
-                        --bigpsl $f.formatChoice.bedChoice.BED_blat_alignment
-                        #set database = str($f.formatChoice.bedChoice.database)
-                        #silent extra_data_dict.update({"database": $database})
-                        #silent $prepare_json($f.formatChoice.bedChoice.BED_blat_alignment, $index_track_final,
-                                             extra_data_dict)
-                    #end if
-                #end if
-                #if $f.formatChoice.format_select == "psl"
-                    --psl $f.formatChoice.PSL
-                    #silent $prepare_json($f.formatChoice.PSL, $index_track_final,
-                                           extra_data_dict)
-                #end if
-                #if $f.formatChoice.format_select == "bigwig"
-                    --bigwig $f.formatChoice.BIGWIG
-                    #silent $prepare_json($f.formatChoice.BIGWIG, $index_track_final,
-                                            extra_data_dict)
-                #end if
-                #if $f.formatChoice.format_select == "bigbed"
-                    --bigbed $f.formatChoice.BIGBED
-                    #silent $prepare_json($f.formatChoice.BIGBED, $index_track_final,
-                                            extra_data_dict)
-                #end if
-                #if $f.formatChoice.format_select == "gff3"
-                    --gff3 $f.formatChoice.GFF3
-                    #silent $prepare_json($f.formatChoice.GFF3, $index_track_final,
-                                            extra_data_dict)
-                #end if
-                #if $f.formatChoice.format_select == "gtf"
-                    ## Add also GTF from Agustus? See https://github.com/ENCODE-DCC/kentUtils/issues/8
-                    --gtf $f.formatChoice.GTF
-                    #silent $prepare_json($f.formatChoice.GTF, $index_track_final,
-                                             extra_data_dict)
-                #end if
-            #end for
-        #end for
+                #end for
+                #$extra_data_dict.update({"trix_id": str($f.formatChoice.add_trix_index.trix_id)})
+                ##set trix_id = str($f.formatChoice.add_trix_index.trix_id)
+                ##silent $extra_data_dict.update({"indexIx": $ix_index, "indexIxx": $ixx_index, "trix_id": $trix_id})
+            #end if
+            #silent $prepare_json("BigBed", $f.formatChoice.BIGBED, $index_track_final,
+                                            $extra_data_dict)
+        #end if
+        #if $f.formatChoice.format_select == "gff3"
+            #silent $prepare_json("Gff3", $f.formatChoice.GFF3, $index_track_final,
+                                            $extra_data_dict)
+        #end if
+        #if $f.formatChoice.format_select == "gtf"
+            ## Add also GTF from Agustus? See https://github.com/ENCODE-DCC/kentUtils/issues/8
+            #silent $prepare_json("Gtf", $f.formatChoice.GTF, $index_track_final,
+                                             $extra_data_dict)
+        #end if
+    #end for
+#end for
 
-        ## We combine the fasta file dataset name with his false path in a JSON object
-        #set fasta_json = json.dumps({"false_path": str($fasta_file), "name": $fasta_file.name})
-        -f '$fasta_json'
+## We combine the fasta file dataset name with his false path in a JSON object
+#set fasta_json = {"false_path": str($fasta_file), "name": str($fasta_file.name)}
+$data_parameter_dict.update({"fasta": $fasta_json})
 
-        ## Dump the final json
-        #set all_data_json = json.dumps($data_parameter_dict)
+## Retrieve the user email
+#silent $data_parameter_dict.update({"user_email": str($__user_email__)})
 
-        --data_json '$all_data_json'
+#silent $data_parameter_dict.update({"tool_directory": str($__tool_directory__)})
 
-        ## Retrieve the user email
-        --user_email $__user_email__
+#silent $data_parameter_dict.update({"extra_files_path": str($output.extra_files_path)})
 
-        -d $__tool_directory__
+#silent $data_parameter_dict.update({"debug_mode": str($advanced_options.debug_mode)})
 
-        -e $output.extra_files_path
-
-        $advanced_options.debug_mode
+with open(file_path, 'w') as f:
+    json.dump($data_parameter_dict, f)
 
-        -o $output;
-
-    ]]></command>
+        </configfile>
+    </configfiles>
 
     <inputs>
         <param
@@ -275,6 +314,7 @@
                                     <option value="FlyBase">FlyBase</option>
                                     <option value="Others">Others</option>
                                 </param>
+                                <expand macro="add_trix_file"/>
                             </when>
                             <when value="bed_blat_alignment_option">
                                 <param
@@ -287,6 +327,7 @@
                                     <option value="NCBI" selected="true">NCBI</option>
                                     <option value="Others">Others</option>
                                 </param>
+                                <expand macro="add_trix_file"/>
                             </when>
                         </conditional>
                         <param name="longLabel" type="text" size="76" label="Track label" help="It is limited to 76 printable characters, the first 17 printable characters will be used as a short label of the track" />
@@ -337,6 +378,15 @@
                                 type="data"
                                 label="BIGBED File"
                         />
+                        <expand macro="add_trix_file">
+                            <param 
+                                name="trix_id" 
+                                value="name" 
+                                type="text"
+                                size="30"
+                                label="Specify Trix identifier (The default is name)"
+                            />
+                        </expand>
                         <param name="longLabel" type="text" size="76" label="Track label" help="It is limited to 76 printable characters, the first 17 printable characters will be used as a short label of the track" />
                         <param name="track_color" type="color" label="Track color" value="#000000">
                             <sanitizer>
@@ -388,9 +438,9 @@
             </param>
             <!-- TODO: Avoid redundancy here -->
             <when value="on">
-                <param name="debug_mode" type="boolean"
-                       label="Activate debug mode" checked="false"
-                       truevalue="--debug_mode" falsevalue="">
+                <param name="debug_mode" type="select" label="Activate debug mode"> 
+                    <option value="false" selected="true">No</option>
+                    <option value="true">Yes</option>
                     <help>
                         Use this option if you are a G-OnRamp developer
                     </help>
@@ -398,34 +448,25 @@
             </when>
             <when value="off">
                 <param name="debug_mode" type="hidden"
-                       value="">
+                       value="false">
                 </param>
             </when>
-    </conditional>
-</inputs>
+        </conditional>
+    </inputs>
 
     <outputs>
         <data format="trackhub" name="output"/>
     </outputs>
 
     <tests>
-        <!-- Test with only the fasta file -->
+   
+       <!-- Test with only the fasta file -->
         <test>
             <param name="genome_name" value="Dbia3"/>
             <param name="fasta_file" value="common/dbia3.fa"/>
             <output name="output" file="only_genome/only_genome.html">
-                <extra_files type="file" name="__main__.log" value="only_genome/__main__.log" />
-                <extra_files type="file" name="myHub/genomes.txt" value="only_genome/myHub/genomes.txt" />
-                <extra_files type="file" name="myHub/Dbia3.html" value="only_genome/myHub/Dbia3.html"/>
-                <!-- Email could be different, but we need to ensure we still have the email line -->
-                <extra_files type="file" name="myHub/hub.txt" value="only_genome/myHub/hub.txt" lines_diff="2">
-                    <assert_contents>
-                        <has_text text="email"/>
-                    </assert_contents>
-                </extra_files>
-                <extra_files type="file" name="myHub/Dbia3/Dbia3.2bit" value="common/Dbia3.2bit">
-                </extra_files>
-                <extra_files type="file" name="myHub/Dbia3/description.html" value="only_genome/myHub/Dbia3/description.html"/>
+                <!-- Use macro to check the whole common structure without repeated code -->
+                <expand macro="verify_hub_structure_no_track" test="only_genome" />
             </output>
         </test>
 
@@ -439,6 +480,7 @@
                     <conditional name="formatChoice">
                         <param name="format_select" value="bam"/>
                         <param name="BAM" value="bam/inputs/HISAT2_Accepted_Hits.bam" />
+                        <param name="longLabel" value="HISAT sequence alignment" />
                         <param name="track_color" value="#000000"/>
                     </conditional>
                 </repeat>
@@ -455,22 +497,8 @@
                              value="bam/myHub/Dbia3/tracks/HISAT2_Accepted_Hits.bam.bai"
                              compare="sim_size"
                 />
-                <!-- Verify trackDb.txt contains the basic fields for a bam -->
-                <extra_files type="file" name="myHub/Dbia3/trackDb.txt" value="bam/myHub/Dbia3/trackDb.txt">
-                    <assert_contents>
-                        <has_text text="track"/>
-                        <has_text text="longLabel"/>
-                        <has_text text="shortLabel"/>
-                        <has_text text="bigDataUrl"/>
-                        <has_text text="type"/>
-                        <has_text text="visibility"/>
-                        <has_text text="thickDrawItem"/>
-                        <has_text text="priority"/>
-                        <has_text text="color"/>
-                        <has_text text="group"/>
-                    </assert_contents>
-                </extra_files>
-                <!-- TODO: Find a way to check also that the whole common structure is intact too, without too much repetition -->
+                <!-- Use macro to check the whole common structure without repeated code -->
+                <expand macro="verify_hub_structure" test="bam" />
             </output>
         </test>
 
@@ -486,18 +514,19 @@
                         <conditional name="bedChoice">
                             <param name="bed_select" value="bed_generic"/>
                             <param name="BED" ftype="bed" value="bed_generic/inputs/TBLASTN_Alignment_to_proteins"/>
+                            <param name="longLabel" value="TBLASTN alignment" />
                             <param name="track_color" value="#000000"/>
                         </conditional>
                     </conditional>
                 </repeat>
             </repeat>
             <output name="output" file="bed_generic/bed_generic.html">
-                <!-- Verify tracks folder contains bam and bai -->
                 <extra_files type="file"
                              name="myHub/Dbia3/tracks/TBLASTN_Alignment_to_proteins.bb"
                              value="bed_generic/myHub/Dbia3/tracks/TBLASTN_Alignment_to_proteins.bb"
                              compare="sim_size"
                 />
+                <expand macro="verify_hub_structure" test="bed_generic" />
             </output>
         </test>
 
@@ -513,22 +542,22 @@
                         <conditional name="bedChoice">
                             <param name="bed_select" value="bed_simple_repeats_option"/>
                             <param name="BED_simple_repeats" ftype="bed" value="bed_simple_repeats/inputs/Repeating_Elements_by_TrfBig"/>
+                            <param name="longLabel" value="Simple repeat" />
                             <param name="track_color" value="#000000"/>
                         </conditional>
                     </conditional>
                 </repeat>
             </repeat>
             <output name="output" file="bed_simple_repeats/bed_simple_repeats_trackhub.html">
-                <!-- Verify tracks folder contains bam and bai -->
                 <extra_files type="file"
                              name="myHub/Dbia3/tracks/Repeating_Elements_by_TrfBig.bb"
                              value="bed_simple_repeats/myHub/Dbia3/tracks/Repeating_Elements_by_TrfBig.bb"
                              compare="sim_size"
                 />
+                <expand macro="verify_hub_structure" test="bed_simple_repeats" />
             </output>
         </test>
 
-
         <!-- Test with Psl -->
         <test>
             <param name="genome_name" value="Dbia3"/>
@@ -539,19 +568,18 @@
                     <conditional name="formatChoice">
                         <param name="format_select" value="psl"/>
                         <param name="PSL" value="psl/inputs/blastXmlToPsl"/>
+                        <param name="longLabel" value="BLAST Alignment" />
                         <param name="track_color" value="#000000"/>
                     </conditional>
                 </repeat>
             </repeat>
             <output name="output" file="psl/psl_trackhub.html">
-                <!-- Verify tracks folder contains bam and bai -->
                 <extra_files type="file"
                              name="myHub/Dbia3/tracks/blastXmlToPsl.bb"
                              value="psl/myHub/Dbia3/tracks/blastXmlToPsl.bb"
                              compare="sim_size"
                 />
-                <!-- Verify trackDb.txt contains the basic fields for a bam -->
-                <!-- TODO: Find a way to check also that the whole common structure is intact too, without too much repetition -->
+                <expand macro="verify_hub_structure" test="psl" />
             </output>
         </test>
 
@@ -564,20 +592,27 @@
                 <repeat name="format">
                     <conditional name="formatChoice">
                         <param name="format_select" value="bigwig"/>
-                        <param name="BIGWIG" value="bigwig/inputs/RNA-Seq_Alignment_Summary"/>
+                        <param name="BIGWIG" value="bigwig/inputs/RNA-Seq_Alignment_Coverage"/>
+                        <param name="longLabel" value="RNA-Seq Coverage" />
                         <param name="track_color" value="#000000"/>
                     </conditional>
                 </repeat>
             </repeat>
             <output name="output" file="bigwig/bigwig.html">
-                <!-- Verify tracks folder contains bam and bai -->
                 <extra_files type="file"
-                             name="myHub/Dbia3/tracks/RNA-Seq_Alignment_Summary.bigwig"
-                             value="bigwig/myHub/Dbia3/tracks/RNA-Seq_Alignment_Summary.bigwig"
+                             name="myHub/Dbia3/tracks/RNA-Seq_Alignment_Coverage.bigwig"
+                             value="bigwig/myHub/Dbia3/tracks/RNA-Seq_Alignment_Coverage.bigwig"
                              compare="sim_size"
                 />
-                <!-- Verify trackDb.txt contains the basic fields for a bam -->
-                <!-- TODO: Find a way to check also that the whole common structure is intact too, without too much repetition -->
+                <expand macro="verify_hub_structure" test="bigwig" />
+                <!-- check additional trackDb settings for BigWig -->
+                <extra_files type="file" name="myHub/Dbia3/trackDb.txt">
+                    <assert_contents>
+                        <has_text text="autoScale"/>
+                        <has_text text="maxHeightPixels"/>
+                        <has_text text="windowingFunction"/>
+                    </assert_contents>
+                </extra_files>
             </output>
         </test>
 
@@ -591,19 +626,18 @@
                     <conditional name="formatChoice">
                         <param name="format_select" value="gff3"/>
                         <param name="GFF3" value="gff3/inputs/Augustus_Gene_Predictions"/>
+                        <param name="longLabel" value="Augustus" />
                         <param name="track_color" value="#000000"/>
                     </conditional>
                 </repeat>
             </repeat>
             <output name="output" file="gff3/gff3_trackhub.html">
-                <!-- Verify tracks folder contains bam and bai -->
                 <extra_files type="file"
                              name="myHub/Dbia3/tracks/Augustus_Gene_Predictions.bb"
                              value="gff3/myHub/Dbia3/tracks/Augustus_Gene_Predictions.bb"
                              compare="sim_size"
                 />
-                <!-- Verify trackDb.txt contains the basic fields for a bam -->
-                <!-- TODO: Find a way to check also that the whole common structure is intact too, without too much repetition -->
+                <expand macro="verify_hub_structure" test="gff3" />
             </output>
         </test>
 
@@ -617,19 +651,182 @@
                     <conditional name="formatChoice">
                         <param name="format_select" value="gtf"/>
                         <param name="GTF" value="gtf/inputs/StringTie_Assembled_Transcripts"/>
+                        <param name="longLabel" value="StringTie transcripts" />
                         <param name="track_color" value="#000000"/>
                     </conditional>
                 </repeat>
             </repeat>
             <output name="output" file="gtf/gtf_trackhub.html">
-                <!-- Verify tracks folder contains bam and bai -->
                 <extra_files type="file"
                              name="myHub/Dbia3/tracks/StringTie_Assembled_Transcripts.bb"
                              value="gtf/myHub/Dbia3/tracks/StringTie_Assembled_Transcripts.bb"
                              compare="sim_size"
                 />
-                <!-- Verify trackDb.txt contains the basic fields for a bam -->
-                <!-- TODO: Find a way to check also that the whole common structure is intact too, without too much repetition -->
+                <expand macro="verify_hub_structure" test="gtf" />
+            </output>
+        </test>
+
+        <!-- Test with BLAT Alignment -->
+        <test>
+            <param name="genome_name" value="Dbia3"/>
+            <param name="fasta_file" value="common/dbia3.fa"/>
+            <repeat name="group">
+                <param name="group_name" value="Default group"/>
+                <repeat name="format">
+                    <conditional name="formatChoice">
+                        <param name="format_select" value="bed" />
+                        <conditional name="bedChoice">
+                            <param name="bed_select" value="bed_blat_alignment_option"/>
+                            <param name="BED_blat_alignment" ftype="bed" value="bed_blat_alignment/inputs/BLAT_alignment_bigpsl"/>
+                            <param name="longLabel" value="BLAT alignment" />
+                            <param name="track_color" value="#000000"/>
+                            <param name="database" value="NCBI" />
+                        </conditional>
+                    </conditional>
+                </repeat>
+            </repeat>
+            <output name="output" file="bed_blat_alignment/blat_alignment_trackhub.html">
+                <extra_files type="file"
+                             name="myHub/Dbia3/tracks/BLAT_alignment_bigpsl.bb"
+                             value="bed_blat_alignment/myHub/Dbia3/tracks/BLAT_alignment_bigpsl.bb"
+                             compare="sim_size"
+                />
+                <expand macro="verify_hub_structure" test="bed_blat_alignment" />
+                <!-- check additional trackDb settings for BLAT -->
+                <extra_files type="file" name="myHub/Dbia3/trackDb.txt">
+                    <assert_contents>
+                        <has_text text="searchIndex"/>
+                        <has_text text="url"/>
+                        <has_text text="urlLabel"/>
+                        <has_text text="iframeUrl"/>
+                        <has_text text="iframeOptions"/>
+                    </assert_contents>
+                </extra_files>
+            </output>
+        </test>
+
+        <!-- Test with BLAST Alignment -->
+        <test>
+            <param name="genome_name" value="Dbia3"/>
+            <param name="fasta_file" value="common/dbia3.fa"/>
+            <repeat name="group">
+                <param name="group_name" value="Default group"/>
+                <repeat name="format">
+                    <conditional name="formatChoice">
+                        <param name="format_select" value="bed" />
+                        <conditional name="bedChoice">
+                            <param name="bed_select" value="bed_blast_alignment_option"/>
+                            <param name="BED_blast_alignment" ftype="bed" value="bed_blast_alignment/inputs/BLAST_alignment_bigpsl"/>
+                            <param name="longLabel" value="BLAST alignment" />
+                            <param name="track_color" value="#000000"/>
+                            <param name="database" value="NCBI" />
+                        </conditional>
+                    </conditional>
+                </repeat>
+            </repeat>
+            <output name="output" file="bed_blast_alignment/blast_alignment_trackhub.html">
+                <extra_files type="file"
+                             name="myHub/Dbia3/tracks/BLAST_alignment_bigpsl.bb"
+                             value="bed_blast_alignment/myHub/Dbia3/tracks/BLAST_alignment_bigpsl.bb"
+                             compare="sim_size"
+                />
+                <expand macro="verify_hub_structure" test="bed_blast_alignment" />
+                <!-- check additional trackDb settings for BLAST -->
+                <extra_files type="file" name="myHub/Dbia3/trackDb.txt">
+                    <assert_contents>
+                        <has_text text="searchIndex"/>
+                        <has_text text="url"/>
+                        <has_text text="urlLabel"/>
+                        <has_text text="iframeUrl"/>
+                        <has_text text="iframeOptions"/>
+                    </assert_contents>
+                </extra_files>
+            </output>
+        </test>
+
+        <!-- Test with Regtools Splice Junctions -->
+        <test>
+            <param name="genome_name" value="Dbia3"/>
+            <param name="fasta_file" value="common/dbia3.fa"/>
+            <repeat name="group">
+                <param name="group_name" value="Default group"/>
+                <repeat name="format">
+                    <conditional name="formatChoice">
+                        <param name="format_select" value="bed" />
+                        <conditional name="bedChoice">
+                            <param name="bed_select" value="bed_splice_junctions_option"/>
+                            <param name="BED_splice_junctions" ftype="bed" value="bed_splice_junctions/inputs/regtools_junctions"/>
+                            <param name="longLabel" value="Splice junctions" />
+                            <param name="track_color" value="#000000"/>
+                        </conditional>
+                    </conditional>
+                </repeat>
+            </repeat>
+            <output name="output" file="bed_splice_junctions/splice_junctions_trackhub.html">
+                <extra_files type="file"
+                             name="myHub/Dbia3/tracks/regtools_junctions.bb"
+                             value="bed_splice_junctions/myHub/Dbia3/tracks/regtools_junctions.bb"
+                             compare="sim_size"
+                />
+                <expand macro="verify_hub_structure" test="bed_splice_junctions" />
+            </output>
+        </test>
+
+        <!-- Test with Cytoband -->
+        <test>
+            <param name="genome_name" value="Dbia3"/>
+            <param name="fasta_file" value="common/dbia3.fa"/>
+            <repeat name="group">
+                <param name="group_name" value="Default group"/>
+                <repeat name="format">
+                    <conditional name="formatChoice">
+                        <param name="format_select" value="bed" />
+                        <conditional name="bedChoice">
+                            <param name="bed_select" value="bed_cytoBand"/>
+                            <param name="BED_cytoBand" ftype="bed" value="bed_cytoband/inputs/Cytoband"/>
+                            <param name="longLabel" value="Cytoband" />
+                            <param name="track_color" value="#000000"/>
+                        </conditional>
+                    </conditional>
+                </repeat>
+            </repeat>
+            <output name="output" file="bed_cytoband/cytoband_trackhub.html">
+                <extra_files type="file"
+                             name="myHub/Dbia3/tracks/Cytoband.bb"
+                             value="bed_cytoband/myHub/Dbia3/tracks/Cytoband.bb"
+                             compare="sim_size"
+                />
+                <expand macro="verify_hub_structure" test="bed_cytoband" />
+                <extra_files type="file" name="myHub/Dbia3/trackDb.txt">
+                    <assert_contents>
+                        <has_text text="track cytoBandIdeo"/>
+                    </assert_contents>
+                </extra_files>
+            </output>
+        </test>
+
+        <!-- Test with bigBed -->
+        <test>
+            <param name="genome_name" value="Dbia3"/>
+            <param name="fasta_file" value="common/dbia3.fa"/>
+            <repeat name="group">
+                <param name="group_name" value="Default group"/>
+                <repeat name="format">
+                    <conditional name="formatChoice">
+                        <param name="format_select" value="bigbed"/>
+                        <param name="BIGBED" value="big_bed/inputs/BLAT_alignment_bigbed" />
+                        <param name="longLabel" value="bigBed" />
+                        <param name="track_color" value="#000000"/>
+                    </conditional>
+                </repeat>
+            </repeat>
+            <output name="output" file="big_bed/bigbed_trackhub.html">
+                <extra_files type="file"
+                             name="myHub/Dbia3/tracks/BLAT_alignment_bigbed.bigbed"
+                             value="big_bed/myHub/Dbia3/tracks/BLAT_alignment_bigbed.bigbed"
+                             compare="sim_size"
+                />
+                <expand macro="verify_hub_structure" test="big_bed" />
             </output>
         </test>
 
@@ -655,7 +852,6 @@
                 </repeat>
             </repeat>
             <output name="output" file="gtf_gff/gtf_gff_trackhub.html">
-                <!-- verify tracks folder contains bam and bai -->
                 <extra_files type="file"
                              name="myHub/Dbia3/tracks/StringTie_Assembled_Transcripts.bb"
                              value="gtf/myHub/Dbia3/tracks/StringTie_Assembled_Transcripts.bb"
@@ -666,12 +862,11 @@
                              value="gff3/myHub/Dbia3/tracks/Augustus_Gene_Predictions.bb"
                              compare="sim_size"
                 />
-                <!-- verify trackdb.txt contains the basic fields for a bam -->
-                <!-- todo: find a way to check also that the whole common structure is intact too, without too much repetition -->
+                <expand macro="verify_hub_structure" test="gtf_gff" />   
             </output>
         </test>
 
-        <!-- Test with one group and all the supported datatypes on 10/04/2016 -->
+        <!-- Test with one group and all the supported datatypes -->
         <test>
             <param name="genome_name" value="Dbia3"/>
             <param name="fasta_file" value="common/dbia3.fa"/>
@@ -715,7 +910,7 @@
                 <repeat name="format">
                     <conditional name="formatChoice">
                         <param name="format_select" value="bigwig"/>
-                        <param name="BIGWIG" value="bigwig/inputs/RNA-Seq_Alignment_Summary"/>
+                        <param name="BIGWIG" value="bigwig/inputs/RNA-Seq_Alignment_Coverage"/>
                         <param name="track_color" value="#000000"/>
                     </conditional>
                 </repeat>
@@ -733,6 +928,48 @@
                         <param name="track_color" value="#000000"/>
                     </conditional>
                 </repeat>
+                <repeat name="format">
+                    <conditional name="formatChoice">
+                        <param name="format_select" value="bed" />
+                        <conditional name="bedChoice">
+                            <param name="bed_select" value="bed_cytoBand"/>
+                            <param name="BED_cytoBand" ftype="bed" value="bed_cytoband/inputs/Cytoband"/>
+                            <param name="track_color" value="#000000"/>
+                        </conditional>
+                    </conditional>
+                </repeat>
+                <repeat name="format">
+                    <conditional name="formatChoice">
+                        <param name="format_select" value="bed" />
+                        <conditional name="bedChoice">
+                            <param name="bed_select" value="bed_splice_junctions_option"/>
+                            <param name="BED_splice_junctions" ftype="bed" value="bed_splice_junctions/inputs/regtools_junctions"/>
+                            <param name="track_color" value="#000000"/>
+                        </conditional>
+                    </conditional>
+                </repeat>
+                <repeat name="format">
+                    <conditional name="formatChoice">
+                        <param name="format_select" value="bed" />
+                        <conditional name="bedChoice">
+                            <param name="bed_select" value="bed_blast_alignment_option"/>
+                            <param name="BED_blast_alignment" ftype="bed" value="bed_blast_alignment/inputs/BLAST_alignment_bigpsl"/>
+                            <param name="track_color" value="#000000"/>
+                            <param name="database" value="NCBI" />
+                        </conditional>
+                    </conditional>
+                </repeat>
+                <repeat name="format">
+                    <conditional name="formatChoice">
+                        <param name="format_select" value="bed" />
+                        <conditional name="bedChoice">
+                            <param name="bed_select" value="bed_blat_alignment_option"/>
+                            <param name="BED_blat_alignment" ftype="bed" value="bed_blat_alignment/inputs/BLAT_alignment_bigpsl"/>
+                            <param name="track_color" value="#000000"/>
+                            <param name="database" value="NCBI" />
+                        </conditional>
+                    </conditional>
+                </repeat>
             </repeat>
             <output name="output" file="all_datatypes/all_datatypes_trackhub.html">
                 <!-- verify tracks folder contains all the files -->
@@ -762,8 +999,8 @@
                              compare="sim_size"
                 />
                 <extra_files type="file"
-                             name="myHub/Dbia3/tracks/RNA-Seq_Alignment_Summary.bigwig"
-                             value="all_datatypes/myHub/Dbia3/tracks/RNA-Seq_Alignment_Summary.bigwig"
+                             name="myHub/Dbia3/tracks/RNA-Seq_Alignment_Coverage.bigwig"
+                             value="all_datatypes/myHub/Dbia3/tracks/RNA-Seq_Alignment_Coverage.bigwig"
                              compare="sim_size"
                 />
                 <extra_files type="file"
@@ -776,12 +1013,31 @@
                              value="all_datatypes/myHub/Dbia3/tracks/StringTie_Assembled_Transcripts.bb"
                              compare="sim_size"
                 />
-                <!-- verify trackdb.txt contains the basic fields for a bam -->
-                <!-- todo: find a way to check also that the whole common structure is intact too, without too much repetition -->
+                <extra_files type="file"
+                             name="myHub/Dbia3/tracks/Cytoband.bb"
+                             value="all_datatypes/myHub/Dbia3/tracks/Cytoband.bb"
+                             compare="sim_size"
+                />
+                <extra_files type="file"
+                             name="myHub/Dbia3/tracks/regtools_junctions.bb"
+                             value="all_datatypes/myHub/Dbia3/tracks/regtools_junctions.bb"
+                             compare="sim_size"
+                />
+                <extra_files type="file"
+                             name="myHub/Dbia3/tracks/BLAST_alignment_bigpsl.bb"
+                             value="all_datatypes/myHub/Dbia3/tracks/BLAST_alignment_bigpsl.bb"
+                             compare="sim_size"
+                />
+                <extra_files type="file"
+                             name="myHub/Dbia3/tracks/BLAT_alignment_bigpsl.bb"
+                             value="all_datatypes/myHub/Dbia3/tracks/BLAT_alignment_bigpsl.bb"
+                             compare="sim_size"
+                />
+                <expand macro="verify_hub_structure" test="all_datatypes" />
             </output>
         </test>
 
-        <!-- Test with two groups and no tracks -->
+         <!-- Test with two groups and no tracks -->
         <test>
             <param name="genome_name" value="Dbia3"/>
             <param name="fasta_file" value="common/dbia3.fa"/>
@@ -792,18 +1048,7 @@
                 <param name="group_name" value="Other group"/>
             </repeat>
             <output name="output" file="two_groups_no_track/two_groups_no_track_trackhub.html">
-                <extra_files type="file" name="myHub/genomes.txt" value="two_groups_no_track/myHub/genomes.txt"/>
-                <extra_files type="file" name="myHub/Dbia3.html" value="two_groups_no_track/myHub/Dbia3.html"/>
-                <!-- Email could be different, but we need to ensure we still have the email line -->
-                <extra_files type="file" name="myHub/hub.txt" value="two_groups_no_track/myHub/hub.txt" lines_diff="2">
-                    <assert_contents>
-                        <has_text text="email"/>
-                    </assert_contents>
-                </extra_files>
-                <extra_files type="file" name="myHub/Dbia3/Dbia3.2bit" value="common/Dbia3.2bit">
-                </extra_files>
-                <extra_files type="file" name="myHub/Dbia3/description.html"
-                             value="two_groups_no_track/myHub/Dbia3/description.html"/>
+                <expand macro="verify_hub_structure_no_track" test="two_groups_no_track" />
             </output>
         </test>
 
@@ -816,7 +1061,7 @@
                 <repeat name="format">
                     <conditional name="formatChoice">
                         <param name="format_select" value="bigwig"/>
-                        <param name="BIGWIG" value="bigwig/inputs/RNA-Seq_Alignment_Summary"/>
+                        <param name="BIGWIG" value="bigwig/inputs/RNA-Seq_Alignment_Coverage"/>
                         <param name="track_color" value="#000000"/>
                     </conditional>
                 </repeat>
@@ -825,28 +1070,13 @@
                 <param name="group_name" value="Other group"/>
             </repeat>
             <output name="output" file="two_groups_one_track_first/two_groups_one_track_first_trackhub.html">
-                <!-- Check myHub structure -->
-                <extra_files type="file" name="myHub/genomes.txt" value="two_groups_one_track_first/myHub/genomes.txt"/>
-                <extra_files type="file" name="myHub/Dbia3.html" value="two_groups_one_track_first/myHub/Dbia3.html"/>
-                <!-- Email could be different, but we need to ensure we still have the email line -->
-                <extra_files type="file" name="myHub/hub.txt" value="two_groups_one_track_first/myHub/hub.txt" lines_diff="2">
-                    <assert_contents>
-                        <has_text text="email"/>
-                    </assert_contents>
-                </extra_files>
-                <extra_files type="file" name="myHub/Dbia3/Dbia3.2bit" value="common/Dbia3.2bit">
-                </extra_files>
-                <extra_files type="file" name="myHub/Dbia3/description.html"
-                             value="two_groups_one_track_first/myHub/Dbia3/description.html"/>
-
                 <!-- Check tracks exist -->
                 <extra_files type="file"
-                             name="myHub/Dbia3/tracks/RNA-Seq_Alignment_Summary.bigwig"
-                             value="bigwig/myHub/Dbia3/tracks/RNA-Seq_Alignment_Summary.bigwig"
+                             name="myHub/Dbia3/tracks/RNA-Seq_Alignment_Coverage.bigwig"
+                             value="bigwig/myHub/Dbia3/tracks/RNA-Seq_Alignment_Coverage.bigwig"
                              compare="sim_size"
                 />
-
-                <!-- Check the groups.txt exists and is properly populated -->
+                <expand macro="verify_hub_structure" test="two_groups_one_track_first" />
             </output>
         </test>
 
@@ -859,7 +1089,7 @@
                 <repeat name="format">
                     <conditional name="formatChoice">
                         <param name="format_select" value="bigwig"/>
-                        <param name="BIGWIG" value="bigwig/inputs/RNA-Seq_Alignment_Summary"/>
+                        <param name="BIGWIG" value="bigwig/inputs/RNA-Seq_Alignment_Coverage"/>
                         <param name="track_color" value="#000000"/>
                     </conditional>
                 </repeat>
@@ -875,26 +1105,11 @@
                 </repeat>
             </repeat>
             <output name="output" file="two_groups_one_track_both/two_groups_one_track_both_trackhub.html">
-                <!-- Check myHub structure -->
-                <extra_files type="file" name="myHub/genomes.txt" value="two_groups_one_track_both/myHub/genomes.txt"/>
-                <extra_files type="file" name="myHub/Dbia3.html" value="two_groups_one_track_both/myHub/Dbia3.html"/>
-                <!-- Email could be different, but we need to ensure we still have the email line -->
-                <extra_files type="file" name="myHub/hub.txt" value="two_groups_one_track_both/myHub/hub.txt"
-                             lines_diff="2">
-                    <assert_contents>
-                        <has_text text="email"/>
-                    </assert_contents>
-                </extra_files>
-                <extra_files type="file" name="myHub/Dbia3/Dbia3.2bit" value="common/Dbia3.2bit">
-                </extra_files>
-                <extra_files type="file" name="myHub/Dbia3/description.html"
-                             value="two_groups_one_track_both/myHub/Dbia3/description.html"/>
-
                 <!-- Check tracks exist -->
                 <!-- First group -->
                 <extra_files type="file"
-                             name="myHub/Dbia3/tracks/RNA-Seq_Alignment_Summary.bigwig"
-                             value="bigwig/myHub/Dbia3/tracks/RNA-Seq_Alignment_Summary.bigwig"
+                             name="myHub/Dbia3/tracks/RNA-Seq_Alignment_Coverage.bigwig"
+                             value="bigwig/myHub/Dbia3/tracks/RNA-Seq_Alignment_Coverage.bigwig"
                              compare="sim_size"
                 />
 
@@ -904,6 +1119,7 @@
                              value="gtf/myHub/Dbia3/tracks/StringTie_Assembled_Transcripts.bb"
                              compare="sim_size"
                 />
+                <expand macro="verify_hub_structure" test="two_groups_one_track_both" />
                 <!-- Check the groups.txt exists and is properly populated -->
             </output>
         </test>
@@ -917,7 +1133,7 @@
                 <repeat name="format">
                     <conditional name="formatChoice">
                         <param name="format_select" value="bigwig"/>
-                        <param name="BIGWIG" value="bigwig/inputs/RNA-Seq_Alignment_Summary"/>
+                        <param name="BIGWIG" value="bigwig/inputs/RNA-Seq_Alignment_Coverage"/>
                         <param name="track_color" value="#000000"/>
                     </conditional>
                 </repeat>
@@ -947,26 +1163,11 @@
                 </repeat>
             </repeat>
             <output name="output" file="two_groups_multiple_tracks/two_groups_multiple_tracks_trackhub.html">
-                <!-- Check myHub structure -->
-                <extra_files type="file" name="myHub/genomes.txt" value="two_groups_multiple_tracks/myHub/genomes.txt"/>
-                <extra_files type="file" name="myHub/Dbia3.html" value="two_groups_multiple_tracks/myHub/Dbia3.html"/>
-                <!-- Email could be different, but we need to ensure we still have the email line -->
-                <extra_files type="file" name="myHub/hub.txt" value="two_groups_multiple_tracks/myHub/hub.txt"
-                             lines_diff="2">
-                    <assert_contents>
-                        <has_text text="email"/>
-                    </assert_contents>
-                </extra_files>
-                <extra_files type="file" name="myHub/Dbia3/Dbia3.2bit" value="common/Dbia3.2bit">
-                </extra_files>
-                <extra_files type="file" name="myHub/Dbia3/description.html"
-                             value="two_groups_multiple_tracks/myHub/Dbia3/description.html"/>
-
                 <!-- Check tracks exist -->
                 <!-- First group -->
                 <extra_files type="file"
-                             name="myHub/Dbia3/tracks/RNA-Seq_Alignment_Summary.bigwig"
-                             value="bigwig/myHub/Dbia3/tracks/RNA-Seq_Alignment_Summary.bigwig"
+                             name="myHub/Dbia3/tracks/RNA-Seq_Alignment_Coverage.bigwig"
+                             value="bigwig/myHub/Dbia3/tracks/RNA-Seq_Alignment_Coverage.bigwig"
                              compare="sim_size"
                 />
                 <extra_files type="file"
@@ -991,7 +1192,7 @@
                              value="gff3_multi_fasta/myHub/Dbia3/tracks/Multi-Fasta_GlimmerHMM_Gene_Predictions.bb"
                              compare="sim_size"
                 />
-                <!-- Check the groups.txt exists and is properly populated -->
+                <expand macro="verify_hub_structure" test="two_groups_multiple_tracks" />
             </output>
         </test>
 
@@ -1010,8 +1211,9 @@
                 </repeat>
             </repeat>
             <output name="output" file="default_color/default_color_trackhub.html">
+                <expand macro="verify_hub_structure" test="default_color" />
                 <!-- Verify trackDb.txt contains the color 0,0,0 -->
-                <extra_files type="file" name="myHub/Dbia3/trackDb.txt" value="default_color/myHub/Dbia3/trackDb.txt">
+                <extra_files type="file" name="myHub/Dbia3/trackDb.txt">
                     <assert_contents>
                         <has_text text="color 0,0,0"/>
                     </assert_contents>
@@ -1036,8 +1238,9 @@
                 </repeat>
             </repeat>
             <output name="output" file="changed_color/changed_color_trackhub.html">
+                <expand macro="verify_hub_structure" test="changed_color" />
                 <!-- Verify trackDb.txt contains the color 128,100,162 -->
-                <extra_files type="file" name="myHub/Dbia3/trackDb.txt" value="changed_color/myHub/Dbia3/trackDb.txt">
+                <extra_files type="file" name="myHub/Dbia3/trackDb.txt">
                     <assert_contents>
                         <has_text text="color 128,100,162"/>
                     </assert_contents>
@@ -1067,15 +1270,207 @@
                              value="stringtie_chromosome_end_coordinates/myHub/Dbia3/tracks/StringTie_Assembled_Transcripts.bb"
                              compare="sim_size"
                 />
+                <expand macro="verify_hub_structure" test="stringtie_chromosome_end_coordinates" />
+
+                <!-- TODO: Find a way to check also that the whole common structure is intact too, without too much repetition -->
+            </output>
+        </test>
+
+        <!-- Test default label in a track -->
+        <test>
+            <param name="genome_name" value="Dbia3"/>
+            <param name="fasta_file" value="common/dbia3.fa"/>
+            <repeat name="group">
+                <param name="group_name" value="Default group"/>
+                <repeat name="format">
+                    <conditional name="formatChoice">
+                        <param name="format_select" value="bam"/>
+                        <param name="BAM" value="bam/inputs/HISAT2_Accepted_Hits.bam"/>
+                        <param name="track_color" value="#000000"/>
+                    </conditional>
+                </repeat>
+            </repeat>
+            <output name="output" file="default_color/default_color_trackhub.html">
+                <expand macro="verify_hub_structure" test="default_color" />
+                <!-- Verify trackDb.txt contains default label -->
+                <extra_files type="file" name="myHub/Dbia3/trackDb.txt">
+                    <assert_contents>
+                        <has_text text="longLabel HISAT2 Accepted Hits.bam"/>
+                    </assert_contents>
+                </extra_files>
+
+                <!-- TODO: Find a way to check also that the whole common structure is intact too, without too much repetition -->
+            </output>
+        </test>
+
+        <!-- Test customized label in a track -->
+        <test>
+            <param name="genome_name" value="Dbia3"/>
+            <param name="fasta_file" value="common/dbia3.fa"/>
+            <repeat name="group">
+                <param name="group_name" value="Default group"/>
+                <repeat name="format">
+                    <conditional name="formatChoice">
+                        <param name="format_select" value="bam"/>
+                        <param name="BAM" value="bam/inputs/HISAT2_Accepted_Hits.bam"/>
+                        <param name="longLabel" value="HISAT sequence alignment" />
+                        <param name="track_color" value="#000000"/>
+                    </conditional>
+                </repeat>
+            </repeat>
+            <output name="output" file="changed_label/changed_label_trackhub.html">
+                <expand macro="verify_hub_structure" test="changed_label" />
+                <!-- Verify trackDb.txt contains the customized label -->
+                <extra_files type="file" name="myHub/Dbia3/trackDb.txt">
+                    <assert_contents>
+                        <has_text text="longLabel HISAT sequence alignment"/>
+                    </assert_contents>
+                </extra_files>
 
                 <!-- TODO: Find a way to check also that the whole common structure is intact too, without too much repetition -->
             </output>
         </test>
 
-        <!-- Test for big files? -->
+        <!-- Test TrixIndex for Blat alignment track -->
+        <test>
+            <param name="genome_name" value="Dbia3"/>
+            <param name="fasta_file" value="common/dbia3.fa"/>
+            <repeat name="group">
+                <param name="group_name" value="Default group"/>
+                <repeat name="format">
+                    <conditional name="formatChoice">
+                        <param name="format_select" value="bed" />
+                        <conditional name="bedChoice">
+                            <param name="bed_select" value="bed_blat_alignment_option"/>
+                            <param name="BED_blat_alignment" ftype="bed" value="bed_blat_alignment/inputs/BLAT_alignment_bigpsl"/>
+                            <param name="longLabel" value="BLAT alignment" />
+                            <param name="track_color" value="#000000"/>
+                            <param name="database" value="NCBI" />
+                            <conditional name="add_trix_index">
+                                <param name="add_trix_index_selector" value="yes" />
+                                <param name="trix_index" value="trix_index_files/blat_out.ix,trix_index_files/blat_out.ixx" />
+                            </conditional>
+                        </conditional>
+                    </conditional>
+                </repeat>
+            </repeat>
+            <param name="debug_mode" value="true" />
+            <output name="output" file="trix_index_files/blat_alignment_trackhub.html">
+                <extra_files type="file"
+                             name="myHub/Dbia3/tracks/BLAT_alignment_bigpsl.bb"
+                             value="bed_blat_alignment/myHub/Dbia3/tracks/BLAT_alignment_bigpsl.bb"
+                             compare="sim_size"
+                />
+                <expand macro="verify_hub_structure" test="bed_blat_alignment" />
+                <!-- check additional trackDb settings for BLAT -->
+                <extra_files type="file" name="myHub/Dbia3/trackDb.txt">
+                    <assert_contents>
+                        <has_text text="searchIndex"/>
+                        <has_text text="searchTrix"/>
+                        <has_text text="url"/>
+                        <has_text text="urlLabel"/>
+                        <has_text text="iframeUrl"/>
+                        <has_text text="iframeOptions"/>
+                    </assert_contents>
+                </extra_files>
+                <!-- check Trix index directory -->
+                <extra_files type="file" name="myHub/Dbia3/trix/BLAT_alignment_bigpsl.bb.ix"
+                             value="trix_index_files/blat_out.ix" />
+                <extra_files type="file" name="myHub/Dbia3/trix/BLAT_alignment_bigpsl.bb.ixx"
+                             value="trix_index_files/blat_out.ixx" />
+            </output>
+        </test>
 
-        <!-- Find tests that should fail -->
+        <!-- Test TrixIndex for BLAST Alignment -->
+        <test>
+            <param name="genome_name" value="Dbia3"/>
+            <param name="fasta_file" value="common/dbia3.fa"/>
+            <repeat name="group">
+                <param name="group_name" value="Default group"/>
+                <repeat name="format">
+                    <conditional name="formatChoice">
+                        <param name="format_select" value="bed" />
+                        <conditional name="bedChoice">
+                            <param name="bed_select" value="bed_blast_alignment_option"/>
+                            <param name="BED_blast_alignment" ftype="bed" value="bed_blast_alignment/inputs/BLAST_alignment_bigpsl"/>
+                            <param name="longLabel" value="BLAST alignment" />
+                            <param name="track_color" value="#000000"/>
+                            <param name="database" value="NCBI" />
+                            <conditional name="add_trix_index">
+                                <param name="add_trix_index_selector" value="yes" />
+                                <param name="trix_index" value="trix_index_files/blast_out.ix,trix_index_files/blast_out.ixx" />
+                            </conditional>
+                        </conditional>
+                    </conditional>
+                </repeat>
+            </repeat>
+            <param name="debug_mode" value="true" />
+            <output name="output" file="trix_index_files/blast_alignment_trackhub.html">
+                <extra_files type="file"
+                             name="myHub/Dbia3/tracks/BLAST_alignment_bigpsl.bb"
+                             value="bed_blast_alignment/myHub/Dbia3/tracks/BLAST_alignment_bigpsl.bb"
+                             compare="sim_size"
+                />
+                <expand macro="verify_hub_structure" test="bed_blast_alignment" />
+                <!-- check additional trackDb settings for BLAST -->
+                <extra_files type="file" name="myHub/Dbia3/trackDb.txt">
+                    <assert_contents>
+                        <has_text text="searchIndex"/>
+                        <has_text text="searchTrix"/>
+                        <has_text text="url"/>
+                        <has_text text="urlLabel"/>
+                        <has_text text="iframeUrl"/>
+                        <has_text text="iframeOptions"/>
+                    </assert_contents>
+                </extra_files>
+                <!-- check Trix index directory -->
+                <extra_files type="file" name="myHub/Dbia3/trix/BLAST_alignment_bigpsl.bb.ix"
+                             value="trix_index_files/blast_out.ix" />
+                <extra_files type="file" name="myHub/Dbia3/trix/BLAST_alignment_bigpsl.bb.ixx"
+                             value="trix_index_files/blast_out.ixx" />
+            </output>
+        </test>
 
+        <!-- Test TrixIndex for BigBed -->
+        <test>
+            <param name="genome_name" value="Dbia3"/>
+            <param name="fasta_file" value="common/dbia3.fa"/>
+            <repeat name="group">
+                <param name="group_name" value="Default group"/>
+                <repeat name="format">
+                    <conditional name="formatChoice">
+                        <param name="format_select" value="bigbed"/>
+                        <param name="BIGBED" value="big_bed/inputs/BLAT_alignment_bigbed" />
+                        <param name="longLabel" value="bigBed" />
+                        <param name="track_color" value="#000000"/>
+                        <conditional name="add_trix_index">
+                            <param name="add_trix_index_selector" value="yes" />
+                            <param name="trix_index" value="trix_index_files/blat_out.ix,trix_index_files/blat_out.ixx" />
+                            <param name="trix_id" value="name" />
+                        </conditional>
+                    </conditional>
+                </repeat>
+            </repeat>
+            <param name="debug_mode" value="true" />
+            <output name="output" file="trix_index_files/bigbed_trackhub.html">
+                <extra_files type="file"
+                             name="myHub/Dbia3/tracks/BLAT_alignment_bigbed.bigbed"
+                             value="big_bed/myHub/Dbia3/tracks/BLAT_alignment_bigbed.bigbed"
+                             compare="sim_size"
+                />
+                <expand macro="verify_hub_structure" test="big_bed">
+                    <has_text text="searchIndex"/>
+                    <has_text text="searchTrix"/>
+                </expand>
+
+                <!-- check Trix index directory -->
+                <extra_files type="file" name="myHub/Dbia3/trix/BLAT_alignment_bigbed.bigbed.ix"
+                             value="trix_index_files/blat_out.ix" />
+                <extra_files type="file" name="myHub/Dbia3/trix/BLAT_alignment_bigbed.bigbed.ixx"
+                             value="trix_index_files/blat_out.ixx" />
+            </output>
+        </test>
+        
     </tests>
 
     <help>