Mercurial > repos > yating-l > hubarchivecreator
changeset 17:40d002406884 draft
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit c778f8ee85e9acc924c5c0a30042ac90c8e7a70d-dirty
author | yating-l |
---|---|
date | Thu, 29 Dec 2016 10:32:52 -0500 |
parents | a256533e820d |
children | f23321937d46 |
files | templates/__init__.py templates/display.txt templates/genomesAssembly/__init__.py templates/genomesAssembly/layout.txt templates/groupsTxt/__init__.py templates/groupsTxt/layout.txt templates/hubDescription/__init__.py templates/hubDescription/layout.txt templates/hubTxt/__init__.py templates/hubTxt/layout.txt templates/specieDescription/__init__.py templates/specieDescription/layout.txt templates/trackDb/__init__.py templates/trackDb/layout.txt |
diffstat | 7 files changed, 99 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/display.txt Thu Dec 29 10:32:52 2016 -0500 @@ -0,0 +1,52 @@ +<%namespace name="os" module="os"/> +<html> + <body> + <p> + The following has been generated by Hub Archive Creator: + </p> + <ul> + ${print_tree(walkable_tree)} + </ul> + </body> +</html> + +<%def name="print_tree(tree)"> + % if len(tree) == 0: + ## We do nothing, we are called by a leaf + ## If we are there, this is not normal though + ## TODO: Manage the error + return + % else: + % for vertex in tree: + % if len(tree[vertex][0]) > 0: + <li> + ${vertex} + </li> + <ul> + ${print_tree(tree[vertex][0])} + </ul> + % else: + <li> + <a href="${tree[vertex][1]}">${vertex}</a> + </li> + % endif + % endfor + % endif +</%def> + +<%doc> + def recurse_print_tree(tree, level): + if len(tree) == 0: + return + + for vertex in tree: + composite_name = vertex + bullet_point = '<li><a href="{0}>{0}</a></li>'.format(composite_name) + rval.append(bullet_point) + # Parent, so need to create a sub <ul> + if len(tree[vertex]) > 0: + rval.append('<ul>') + print_tree(tree[vertex], level+1) + rval.append('</ul>') + +</%doc> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/genomesAssembly/layout.txt Thu Dec 29 10:32:52 2016 -0500 @@ -0,0 +1,11 @@ +## TODO: Add a loop to be able to put this template for each genome +genome ${genomeName} +trackDb ${trackDbPath} +groups ${groupsPath} +description ${genomeDescription} +twoBitPath ${twoBitPath} +organism ${organismName} +defaultPos ${defaultPosition} +orderKey ${orderKey} +scientificName ${scientificName} +htmlPath ${pathAssemblyHtmlDescription}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/groupsTxt/layout.txt Thu Dec 29 10:32:52 2016 -0500 @@ -0,0 +1,5 @@ +name ${label.lower().replace(' ', '_')} +label ${label} +priority 2 +defaultIsClosed 0 +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/hubDescription/layout.txt Thu Dec 29 10:32:52 2016 -0500 @@ -0,0 +1,6 @@ +<html> +<body> + ${specie} genome with ${toolUsed} + <a href="${ncbiSpecieUrl}">NCBI genome/${genomeID} (${specieFullName})</a> +</body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/hubTxt/layout.txt Thu Dec 29 10:32:52 2016 -0500 @@ -0,0 +1,6 @@ +hub ${hubName} +shortLabel ${shortLabel} +longLabel ${longLabel} +genomesFile ${genomesFile} +email ${email} +descriptionUrl ${descriptionUrl}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/specieDescription/layout.txt Thu Dec 29 10:32:52 2016 -0500 @@ -0,0 +1,5 @@ +<html> +<body> + ${specieDescription} +</body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/trackDb/layout.txt Thu Dec 29 10:32:52 2016 -0500 @@ -0,0 +1,14 @@ +% for trackDb in trackDbs: + ## See this http://genome.ucsc.edu/goldenPath/help/hgTrackHubHelp.html + track ${trackDb.trackName} + longLabel ${trackDb.longLabel} + shortLabel ${trackDb.shortLabel} + bigDataUrl ${trackDb.trackDataURL} + type ${trackDb.trackType} + visibility ${trackDb.visibility} + thickDrawItem ${trackDb.thickDrawItem} + priority ${trackDb.priority} + color ${trackDb.track_color} + group ${trackDb.group_name.lower().replace(' ', '_')} + +% endfor