Mercurial > repos > rmarenco > hubarchivecreator
comparison trackHub/tracks_partial.py @ 1:fb5e60d4d18a draft
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 64cfc08088d11f6818c1b4e5514ef9e67969eaff-dirty
author | rmarenco |
---|---|
date | Wed, 13 Jul 2016 13:36:37 -0400 |
parents | |
children | 3233451a3bd6 |
comparison
equal
deleted
inserted
replaced
0:0f3bc17e5ede | 1:fb5e60d4d18a |
---|---|
1 """ | |
2 HubAssembly datatype | |
3 """ | |
4 import logging | |
5 | |
6 from galaxy.datatypes.text import Html | |
7 | |
8 log = logging.getLogger( __name__ ) | |
9 | |
10 # !!! README !!! The content of this file should be added in tracks.py, but do it carefully! | |
11 # Don't erase the existing content | |
12 | |
13 | |
14 class UCSCTrackHub( Html ): | |
15 """ | |
16 derived class for BioC data structures in Galaxy | |
17 """ | |
18 | |
19 file_ext = 'trackhub' | |
20 composite_type = 'auto_primary_file' | |
21 | |
22 def __init__( self, **kwd ): | |
23 Html.__init__( self, **kwd ) | |
24 | |
25 def generate_primary_file( self, dataset=None ): | |
26 """ | |
27 This is called only at upload to write the html file | |
28 cannot rename the datasets here - they come with the default unfortunately | |
29 """ | |
30 rval = [ | |
31 '<html><head><title>Files for Composite Dataset (%s)</title></head><p/>\ | |
32 This composite dataset is composed of the following files:<p/><ul>' % ( | |
33 self.file_ext)] | |
34 for composite_name, composite_file in self.get_composite_files(dataset=dataset).iteritems(): | |
35 opt_text = '' | |
36 if composite_file.optional: | |
37 opt_text = ' (optional)' | |
38 rval.append('<li><a href="%s">%s</a>%s' % (composite_name, composite_name, opt_text)) | |
39 rval.append('</ul></html>') | |
40 return "\n".join(rval) | |
41 | |
42 def set_peek( self, dataset, is_multi_byte=False ): | |
43 if not dataset.dataset.purged: | |
44 dataset.peek = "Track Hub structure: Visualization in UCSC Track Hub" | |
45 else: | |
46 dataset.peek = 'file does not exist' | |
47 dataset.blurb = 'file purged from disk' | |
48 | |
49 def display_peek( self, dataset ): | |
50 try: | |
51 return dataset.peek | |
52 except: | |
53 return "Track Hub structure: Visualization in UCSC Track Hub" | |
54 | |
55 def sniff( self, filename ): | |
56 return False |