comparison TrackHub.py @ 52:6fec27968f86 draft

planemo upload for repository https://github.com/Yating-L/jbrowse_hub commit 6391cdb975d14b5a7060fa1665a8a575797a0eaa-dirty
author yating-l
date Thu, 30 Mar 2017 18:03:43 -0400
parents acedf82ea46c
children 1e4806330e51
comparison
equal deleted inserted replaced
51:acedf82ea46c 52:6fec27968f86
70 subprocess.call(['generate-names.pl', '-v', '--out', self.json]) 70 subprocess.call(['generate-names.pl', '-v', '--out', self.json])
71 print "finished name index \n" 71 print "finished name index \n"
72 72
73 def makeArchive(self): 73 def makeArchive(self):
74 shutil.make_archive(self.out_path, 'zip', self.out_path) 74 shutil.make_archive(self.out_path, 'zip', self.out_path)
75 data_folder = '/home/galaxy/galaxy/static/JBrowse-1.12.1/jbrowse_hub' 75 data_folder = '/var/www/html/JBrowse-1.12.1/jbrowse_hub'
76 try: 76 try:
77 if os.path.exists(data_folder): 77 if os.path.exists(data_folder):
78 if os.path.isdir(data_folder): 78 if os.path.isdir(data_folder):
79 shutil.rmtree(data_folder) 79 shutil.rmtree(data_folder)
80 else: 80 else:
89 #run it locally. May need modify 89 #run it locally. May need modify
90 def outHtml(self): 90 def outHtml(self):
91 with open(self.outfile, 'w') as htmlfile: 91 with open(self.outfile, 'w') as htmlfile:
92 htmlstr = 'The JBrowse Hub is created: <br>' 92 htmlstr = 'The JBrowse Hub is created: <br>'
93 zipfiles = '<li><a href = "%s">Download</a></li>' 93 zipfiles = '<li><a href = "%s">Download</a></li>'
94 jbrowse_hub = '<li><a href = "/static/JBrowse-1.12.1/index.html?data=jbrowse_hub/json" target="_blank">View JBrowse Hub</a></li>' 94 jbrowse_hub = '<li><a href = ":80/JBrowse-1.12.1/index.html?data=jbrowse_hub/json" target="_blank">View JBrowse Hub</a></li>'
95 filedir_abs = os.path.abspath(self.outfile) 95 filedir_abs = os.path.abspath(self.outfile)
96 filedir = os.path.dirname(filedir_abs) 96 filedir = os.path.dirname(filedir_abs)
97 filedir = os.path.join(filedir, self.outfolder) 97 filedir = os.path.join(filedir, self.outfolder)
98 for root, dirs, files in os.walk(filedir): 98 for root, dirs, files in os.walk(filedir):
99 for file in files: 99 for file in files: