PageRenderTime 51ms CodeModel.GetById 41ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/lib/galaxy/datatypes/tracks.py

https://bitbucket.org/cistrome/cistrome-harvard/
Python | 39 lines | 10 code | 5 blank | 24 comment | 0 complexity | 70b0ec2e0dcc42c1f9bbab05197422fb MD5 | raw file
 1"""
 2Datatype classes for tracks/track views within galaxy.
 3"""
 4
 5import binary, binascii, logging
 6from galaxy import util
 7from galaxy.web import url_for
 8from galaxy.util.hash_util import hmac_new
 9from urllib import quote_plus
10
11log = logging.getLogger(__name__)
12
13# GeneTrack is no longer supported but leaving the datatype since
14# files of this type may still exist
15
16class GeneTrack( binary.Binary ):
17    file_ext = "genetrack"
18
19    def __init__(self, **kwargs):
20        super( GeneTrack, self ).__init__( **kwargs )
21        # self.add_display_app( 'genetrack', 'View in', '', 'genetrack_link' )
22    # def get_display_links( self, dataset, type, app, base_url, target_frame='galaxy_main', **kwd ): #Force target_frame to be 'galaxy_main'
23    #     return binary.Binary.get_display_links( self, dataset, type, app, base_url, target_frame=target_frame, **kwd )
24    # def genetrack_link( self, hda, type, app, base_url ):
25    #     ret_val = []
26    #     if hda.dataset.has_data():
27    #         # Get the disk file name and data id
28    #         file_name = hda.dataset.get_file_name()
29    #         data_id  = quote_plus( str( hda.id ) )
30    #         galaxy_url = quote_plus( "%s%s" % ( base_url, url_for( controller = 'tool_runner', tool_id='predict2genetrack' ) ) )
31    #         # Make it secure
32    #         hashkey = quote_plus( hmac_new( app.config.tool_secret, file_name ) )
33    #         encoded = quote_plus( binascii.hexlify( file_name ) )
34    #         for name, url in util.get_genetrack_sites():
35    #             if name.lower() in app.config.genetrack_display_sites:
36    #                 # send both  parameters filename and hashkey
37    #                 link = "%s?filename=%s&hashkey=%s&input=%s&GALAXY_URL=%s" % ( url, encoded, hashkey, data_id, galaxy_url )
38    #                 ret_val.append( ( name, link ) )
39    #         return ret_val