comparison TrackDb.py @ 30:e7c4be523cb7 draft

planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 2f1b3cc8c9cb463e460f7f79efe99ed472700ecf
author yating-l
date Tue, 19 Jun 2018 13:02:32 -0400
parents 7e8a8b732db3
children
comparison
equal deleted inserted replaced
29:7e8a8b732db3 30:e7c4be523cb7
1 #!/usr/bin/python 1 #!/usr/bin/python
2 import os
2 import collections 3 import collections
3 from util import santitizer 4 from util import santitizer
4 5
5 class TrackDb(object): 6 class TrackDb(object):
6 """docstring for TrackDb""" 7 """docstring for TrackDb"""
19 self.createTrackDb(trackName, longLabel, shortLabel, trackDataURL, trackType, extraSettings) 20 self.createTrackDb(trackName, longLabel, shortLabel, trackDataURL, trackType, extraSettings)
20 21
21 def createTrackDb(self, track_name, long_label, short_label, file_path, track_type, extraSettings = None): 22 def createTrackDb(self, track_name, long_label, short_label, file_path, track_type, extraSettings = None):
22 23
23 # TODO: Remove the hardcoded "tracks" by the value used as variable from myTrackFolderPath 24 # TODO: Remove the hardcoded "tracks" by the value used as variable from myTrackFolderPath
24 data_url = "tracks/%s" % track_name 25 data_url = "tracks/%s" % os.path.basename(file_path)
25 if not short_label: 26 if not short_label:
26 short_label = TrackDb.getShortName(long_label) 27 short_label = TrackDb.getShortName(long_label)
27 # Replace '_' by ' ', to invert the sanitization mecanism 28 # Replace '_' by ' ', to invert the sanitization mecanism
28 # TODO: Find a better way to manage the sanitization of file path 29 # TODO: Find a better way to manage the sanitization of file path
29 long_label = long_label.replace("_", " ") 30 long_label = long_label.replace("_", " ")