Mercurial > repos > rmarenco > hubarchivecreator
changeset 18:d786bca6a75d draft
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 3007f4ce1d6e8ac8324970d355f028b9394e2a5f
author | rmarenco |
---|---|
date | Fri, 30 Sep 2016 18:33:03 -0400 |
parents | c02720d1afee |
children | 0152500d9acd |
files | Bam.pyc 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 |
diffstat | 15 files changed, 38 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/TrackHub.py Fri Sep 30 15:14:24 2016 -0400 +++ b/TrackHub.py Fri Sep 30 18:33:03 2016 -0400 @@ -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):
--- a/hubArchiveCreator.py Fri Sep 30 15:14:24 2016 -0400 +++ b/hubArchiveCreator.py Fri Sep 30 18:33:03 2016 -0400 @@ -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()
--- a/hubArchiveCreator.xml Fri Sep 30 15:14:24 2016 -0400 +++ b/hubArchiveCreator.xml Fri Sep 30 18:33:03 2016 -0400 @@ -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
--- a/tool_dependencies.xml Fri Sep 30 15:14:24 2016 -0400 +++ b/tool_dependencies.xml Fri Sep 30 18:33:03 2016 -0400 @@ -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>