Skip to content

Commit

Permalink
no temp file,
Browse files Browse the repository at this point in the history
general usage of the template,
more generic
  • Loading branch information
paulzierep committed Nov 2, 2023
1 parent d7f42fa commit f0eae20
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 31 deletions.
36 changes: 6 additions & 30 deletions bin/create_interactive_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,18 @@ def generate_table(

df = df.fillna("")

# TODO maybe allow comunities to modify
columns = [
"Expand",
"Galaxy wrapper id",
"Galaxy wrapper version",
"Conda version",
"Conda id",
"Status",
"bio.tool id",
"bio.tool name",
"EDAM operation",
"EDAM topic",
"Description",
"bio.tool description",
"Status",
"Source",
"ToolShed categories",
"ToolShed id",
"Galaxy wrapper owner",
"Galaxy wrapper source",
]

#we assume this column is here
df = df[df["To keep"]]

df = df.loc[:, columns]
df = df.reindex(columns=columns)

table_str = df.to_html(border=0, table_id="dataframe", classes=["display", "nowrap"], index=False)
table_str = df.to_html(border=0,
table_id="dataframe",
classes=["display", "nowrap"],
index=False)

with open(template_path) as template_file:
template = template_file.read()

with open("temp_tools_table.html") as table_file:
table = table_file.read()

final_html_output = template.replace("COMMUNITY_TABLE", table)
final_html_output = template.replace("COMMUNITY_TABLE", table_str)

with open(output_path, "w") as output:
output.write(final_html_output)
Expand Down
2 changes: 1 addition & 1 deletion bin/create_interactive_table.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ mkdir -p 'results/microgalaxy'

python bin/create_interactive_table.py \
--table 'results/microgalaxy/tools.tsv' \
--template 'data/microgalaxy/datatable_template.html' \
--template 'data/datatable_template.html' \
--output 'results/microgalaxy/index.html'
File renamed without changes.

0 comments on commit f0eae20

Please sign in to comment.