# HG changeset patch # User yating-l # Date 1483025668 18000 # Node ID f23321937d46d80d07e343565fe4b34ed8e003df # Parent 40d00240688401f79b80014a6a5a4137fa965878 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit c778f8ee85e9acc924c5c0a30042ac90c8e7a70d-dirty diff -r 40d002406884 -r f23321937d46 trackHub/README.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/trackHub/README.md Thu Dec 29 10:34:28 2016 -0500 @@ -0,0 +1,12 @@ +This folder exists to configure Galaxy to handle the files generated by HubArchiveCreator tool + +* The **content** of datatypes_conf.xml should go inside config/datatypes_conf.xml, under \ (Copy config/datatypes_conf.xml.sample to config/datatypes_conf.xml if it does not exist yet) +* The content of tracks_partial.py should go inside `lib/galaxy/datatypes/tracks.py` +* trackhub.xml should go inside display_application/ucsc/ + + +TODO: + +- [x] Create a script to copy all these files directly into galaxy => Done but not usable now I have changed the datatype to match Galaxy IUC +- [ ] Need to modify the script `util/add_datatype.py` to match the changes introduced in https://github.com/galaxyproject/galaxy/pull/2348 +- [x] Create a package in ToolShed that install directly this when installing HubArchiveCreator => Not recommended by Galaxy IUC and team diff -r 40d002406884 -r f23321937d46 trackHub/datatypes_conf.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/trackHub/datatypes_conf.xml Thu Dec 29 10:34:28 2016 -0500 @@ -0,0 +1,3 @@ + + + diff -r 40d002406884 -r f23321937d46 trackHub/trackhub.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/trackHub/trackhub.xml Thu Dec 29 10:34:28 2016 -0500 @@ -0,0 +1,6 @@ + + + https://genome.ucsc.edu/cgi-bin/hgHubConnect?hubUrl=${qp($hub_file.url + '/myHub/hub.txt')}&hgHub_do_firstDb=on&hgHub_do_redirect=on&hgHubConnect.remakeTrackHub=on + + + diff -r 40d002406884 -r f23321937d46 trackHub/tracks_partial.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/trackHub/tracks_partial.py Thu Dec 29 10:34:28 2016 -0500 @@ -0,0 +1,87 @@ +""" +HubAssembly datatype +""" +import logging + +from galaxy.datatypes.text import Html + +log = logging.getLogger( __name__ ) + +# !!! README !!! The content of this file should be added in tracks.py, but do it carefully! +# Don't erase the existing content + + +class UCSCTrackHub( Html ): + """ + derived class for BioC data structures in Galaxy + """ + + file_ext = 'trackhub' + composite_type = 'auto_primary_file' + + def __init__( self, **kwd ): + Html.__init__( self, **kwd ) + + def generate_primary_file( self, dataset=None ): + """ + This is called only at upload to write the html file + cannot rename the datasets here - they come with the default unfortunately + """ + rval = [ + 'Files for Composite Dataset (%s)

\ + This composite dataset is composed of the following files:

') + return "\n".join(rval) + + def set_peek( self, dataset, is_multi_byte=False ): + if not dataset.dataset.purged: + dataset.peek = "Track Hub structure: Visualization in UCSC Track Hub" + else: + dataset.peek = 'file does not exist' + dataset.blurb = 'file purged from disk' + + def display_peek( self, dataset ): + try: + return dataset.peek + except: + return "Track Hub structure: Visualization in UCSC Track Hub" + + def sniff( self, filename ): + return False