Repository 'hubarchivecreator'
hg clone https://toolshed.g2.bx.psu.edu/repos/rmarenco/hubarchivecreator

Changeset 18:d786bca6a75d (2016-09-30)
Previous changeset 17:c02720d1afee (2016-09-30) Next changeset 19:0152500d9acd (2016-10-13)
Commit message:
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 3007f4ce1d6e8ac8324970d355f028b9394e2a5f
modified:
Bed.pyc
BedSimpleRepeats.pyc
BigWig.pyc
Datatype.pyc
Gff3.pyc
Gtf.pyc
Psl.pyc
Track.pyc
TrackDb.pyc
TrackHub.py
TrackHub.pyc
hubArchiveCreator.py
hubArchiveCreator.xml
tool_dependencies.xml
added:
Bam.pyc
b
diff -r c02720d1afee -r d786bca6a75d Bam.pyc
b
Binary file Bam.pyc has changed
b
diff -r c02720d1afee -r d786bca6a75d Bed.pyc
b
Binary file Bed.pyc has changed
b
diff -r c02720d1afee -r d786bca6a75d BedSimpleRepeats.pyc
b
Binary file BedSimpleRepeats.pyc has changed
b
diff -r c02720d1afee -r d786bca6a75d BigWig.pyc
b
Binary file BigWig.pyc has changed
b
diff -r c02720d1afee -r d786bca6a75d Datatype.pyc
b
Binary file Datatype.pyc has changed
b
diff -r c02720d1afee -r d786bca6a75d Gff3.pyc
b
Binary file Gff3.pyc has changed
b
diff -r c02720d1afee -r d786bca6a75d Gtf.pyc
b
Binary file Gtf.pyc has changed
b
diff -r c02720d1afee -r d786bca6a75d Psl.pyc
b
Binary file Psl.pyc has changed
b
diff -r c02720d1afee -r d786bca6a75d Track.pyc
b
Binary file Track.pyc has changed
b
diff -r c02720d1afee -r d786bca6a75d TrackDb.pyc
b
Binary file TrackDb.pyc has changed
b
diff -r c02720d1afee -r d786bca6a75d TrackHub.py
--- a/TrackHub.py Fri Sep 30 15:14:24 2016 -0400
+++ b/TrackHub.py Fri Sep 30 18:33:03 2016 -0400
b
@@ -96,6 +96,9 @@
             )
             trackDbFile.write(htmlMakoRendered)
 
+        logging.debug("We just added track {0} (in group {1})".format(trackDbObject.trackName,
+                                                                  trackDbObject.group_name.lower().replace(' ', '_')))
+
     def addGroup(self, group_name="Default"):
         # If not already present in self.groups, add to groups.txt
         # Create the trackDb.txt file in the specie folder, if not exists
@@ -105,6 +108,8 @@
 
         # If the group is already present, we don't need to add it
         if group_name in self.groups:
+            logging.debug("We DON'T add in {0} the group {1}".format(groupsTxtFilePath,
+                                                                      group_name))
             return
 
         # Append to trackDbTxtFilePath the trackDbTemplate populate with the newTrack object
@@ -115,6 +120,8 @@
                     label=group_name
             )
             groupFile.write(htmlMakoRendered)
+        logging.debug("We just added in {0} the group {1}".format(groupsTxtFilePath,
+                                                                  group_name))
         self.groups.add(group_name)
 
     def terminate(self):
b
diff -r c02720d1afee -r d786bca6a75d TrackHub.pyc
b
Binary file TrackHub.pyc has changed
b
diff -r c02720d1afee -r d786bca6a75d hubArchiveCreator.py
--- a/hubArchiveCreator.py Fri Sep 30 15:14:24 2016 -0400
+++ b/hubArchiveCreator.py Fri Sep 30 18:33:03 2016 -0400
b
@@ -147,8 +147,13 @@
     # Create Ordered Dictionary to add the tracks in the tool form order
     all_datatype_ordered_dictionary = collections.OrderedDict(all_datatype_dictionary)
 
+    logging.debug("----- End of all_datatype_dictionary processing -----")
+    logging.debug("all_datatype_ordered_dictionary keys are: {0}".format(all_datatype_ordered_dictionary.values()))
+
+    logging.debug("----- Beginning of Track adding processing -----")
     for index, datatypeObject in all_datatype_ordered_dictionary.iteritems():
         trackHub.addTrack(datatypeObject.track.trackDb)
+    logging.debug("----- End of Track adding processing -----")
 
     # We process all the modifications to create the zip file
     #trackHub.createZip()
b
diff -r c02720d1afee -r d786bca6a75d hubArchiveCreator.xml
--- a/hubArchiveCreator.xml Fri Sep 30 15:14:24 2016 -0400
+++ b/hubArchiveCreator.xml Fri Sep 30 18:33:03 2016 -0400
b
@@ -56,14 +56,32 @@
             #silent data_dict.update($extra_data_dict)
 
             ## Add the ordering by taking the tool form indexes
-            #silent $data_dict.update({"order_index": $order_index + 1})
+            #silent $data_dict.update({"order_index": $order_index})
 
             #silent $data_parameter_dict.update({$false_path: $data_dict})
 
         #end def
 
+
+        ## Get the number of digits from tracks, to have a unique integer from group index and track index
+
+        #set temp_max_digit = 0
+
+        #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 each format, we have a few mandatory fields we store in a dict
                 #set track_color = str($f.formatChoice.track_color)
@@ -79,39 +97,39 @@
                     ## Add Bam format specific fields
                     #silent extra_data_dict.update({"index": $bam_index})
 
-                    #silent $prepare_json($f.formatChoice.BAM, $i, extra_data_dict)
+                    #silent $prepare_json($f.formatChoice.BAM, $index_track_final, extra_data_dict)
                 #end if
                 #if $f.formatChoice.format_select == "bed"
                     #if $f.formatChoice.bedChoice.bed_select == "bed"
                         --bed $f.formatChoice.bedChoice.BED
-                        #silent $prepare_json($f.formatChoice.bedChoice.BED, $i,
+                        #silent $prepare_json($f.formatChoice.bedChoice.BED, $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, $i,
+                        #silent $prepare_json($f.formatChoice.bedChoice.BED_simple_repeats, $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, $i,
+                    #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, $i,
+                    #silent $prepare_json($f.formatChoice.BIGWIG, $index_track_final,
                                             extra_data_dict)
                 #end if
                 #if $f.formatChoice.format_select == "gff3"
                     --gff3 $f.formatChoice.GFF3
-                    #silent $prepare_json($f.formatChoice.GFF3, $i,
+                    #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, $i,
+                    #silent $prepare_json($f.formatChoice.GTF, $index_track_final,
                                              extra_data_dict)
                 #end if
             #end for
b
diff -r c02720d1afee -r d786bca6a75d tool_dependencies.xml
--- a/tool_dependencies.xml Fri Sep 30 15:14:24 2016 -0400
+++ b/tool_dependencies.xml Fri Sep 30 18:33:03 2016 -0400
b
@@ -105,27 +105,4 @@
         </install>
         <readme>The tools downloaded by this dependency definition are free for academic use.</readme>
     </package>
-
-    <!-- Package pslToBigPsl -->
-    <package name="pslToBigPsl" version="0.0.1">
-        <install version="1.0">
-            <actions>
-                <action target_directory="bin" type="download_binary">
-                    <url_template os="darwin">
-                        http://hgdownload.cse.ucsc.edu/admin/exe/macOSX.${architecture}/pslToBigPsl
-                    </url_template>
-                    <url_template os="linux">
-                        http://hgdownload.cse.ucsc.edu/admin/exe/linux.${architecture}/pslToBigPsl
-                    </url_template>
-                </action>
-                <action type="chmod">
-                    <file mode="750">$INSTALL_DIR/bin/pslToBigPsl</file>
-                </action>
-                <action type="set_environment">
-                    <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR/bin</environment_variable>
-                </action>
-            </actions>
-        </install>
-        <readme>The tools downloaded by this dependency definition are free for academic use.</readme>
-    </package>
 </tool_dependency>