comparison TrackHub.py @ 70:39a32cb31623 draft

planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
author yating-l
date Tue, 26 Sep 2017 18:46:02 -0400
parents 4ca7cbf2d9b8
children
comparison
equal deleted inserted replaced
69:ffbec960dc34 70:39a32cb31623
9 from mako.lookup import TemplateLookup 9 from mako.lookup import TemplateLookup
10 10
11 # Internal dependencies 11 # Internal dependencies
12 from datatypes.Datatype import Datatype 12 from datatypes.Datatype import Datatype
13 from util import subtools 13 from util import subtools
14 from util import santitizer
14 15
15 16
16 17
17 18
18 class TrackHub(object): 19 class TrackHub(object):
82 # Else append the new track 83 # Else append the new track
83 # TODO: Get this out of the function 84 # TODO: Get this out of the function
84 trackDbTxtFilePath = os.path.join(self.mySpecieFolderPath, 'trackDb.txt') 85 trackDbTxtFilePath = os.path.join(self.mySpecieFolderPath, 'trackDb.txt')
85 # Append to trackDbTxtFilePath the trackDbTemplate populate with the newTrack object 86 # Append to trackDbTxtFilePath the trackDbTemplate populate with the newTrack object
86 with open(trackDbTxtFilePath, 'a+') as trackDbFile: 87 with open(trackDbTxtFilePath, 'a+') as trackDbFile:
88 group_name = trackDbObject["group"]
89 trackDbObject["group"] = santitizer.sanitize_group_name(trackDbObject["group"])
87 trackDbs = [trackDbObject] 90 trackDbs = [trackDbObject]
88
89 # TODO: The addGroup does not belong here. Move it when the group becomes more than just a label 91 # TODO: The addGroup does not belong here. Move it when the group becomes more than just a label
90 # Add the group as well, if exists in trackDbObject 92 # Add the group as well, if exists in trackDbObject
91 self.addGroup(trackDbObject["group"]) 93 self.addGroup(group_name)
92 94
93 htmlMakoRendered = self.trackDbTemplate.render( 95 htmlMakoRendered = self.trackDbTemplate.render(
94 trackDbs=trackDbs 96 trackDbs=trackDbs
95 ) 97 )
96 trackDbFile.write(htmlMakoRendered) 98 trackDbFile.write(htmlMakoRendered)