diff --git a/communities/microgalaxy/lab/base.yml b/communities/microgalaxy/lab/base.yml index 5a1f1be7..f48401be 100644 --- a/communities/microgalaxy/lab/base.yml +++ b/communities/microgalaxy/lab/base.yml @@ -64,6 +64,6 @@ sections: - sections/1_beginner.yml - sections/3_advanced.yml - sections/4_community.yml - # - sections/5_tools.yml + - sections/5_tools.yml # ----------------------------------------------------------------------------- diff --git a/communities/microgalaxy/lab/sections/5_tools.yml b/communities/microgalaxy/lab/sections/5_tools.yml index 11a75ac8..323d36c2 100644 --- a/communities/microgalaxy/lab/sections/5_tools.yml +++ b/communities/microgalaxy/lab/sections/5_tools.yml @@ -5,10 +5,5 @@ tabs: title: List of community curated tools available for microGalaxy content: - title_md: PAMPA - description_md: Tools to compute and analyse biodiversity metrics - - title_md: TreeBest - description_md: TreeBeST best - - title_md: abacas - description_md: Order and Orientate Contigs - - title_md: abricate - description_md: Mass screening of contigs for antiobiotic resistance genes + description_md: > + Tools to compute and analyse biodiversity metrics diff --git a/communities/microgalaxy/resources/.~lock.curated_tools.tsv# b/communities/microgalaxy/resources/.~lock.curated_tools.tsv# new file mode 100644 index 00000000..b540fde2 --- /dev/null +++ b/communities/microgalaxy/resources/.~lock.curated_tools.tsv# @@ -0,0 +1 @@ +,paul,paul-LIFEBOOK-U7410,07.11.2024 12:25,file:///home/paul/.config/libreoffice/4; \ No newline at end of file diff --git a/sources/bin/populate_labs.py b/sources/bin/populate_labs.py new file mode 100644 index 00000000..6e28ce12 --- /dev/null +++ b/sources/bin/populate_labs.py @@ -0,0 +1,70 @@ +import argparse +import os +from typing import List + +import oyaml as yaml +import pandas as pd + +# import yaml + + +def main() -> None: + parser = argparse.ArgumentParser(description="Create community tools.yml from tool.tsv.") + + # Adding positional arguments with short options + parser.add_argument( + "-c", "--tool_tsv", type=str, required=True, help="Path to the TSV file (e.g., curated_tools.tsv)" + ) + parser.add_argument( + "-y", "--tool_yml", type=str, required=True, help="Path to the output YAML file (e.g., tools.yml)" + ) + + args = parser.parse_args() + + # Check if the tool TSV file exists + if not os.path.exists(args.tool_tsv): + print(f"Error: The file '{args.tool_tsv}' does not exist.") + return + + try: + # Read the TSV file with pandas (use tab delimiter) + data = pd.read_csv(args.tool_tsv, sep="\t") + + # Construct the YAML data structure + yaml_data = { + "id": "tools", + "title": "Community Tools", + "tabs": [ + {"id": "tool_list", "title": "List of community curated tools available for microGalaxy", "content": []} + ], + } + + # Populate the content section with each row from the TSV + for _, row in data.iterrows(): + # Use the first column (assumed to be the tool title) as the title_md + title_md = row[data.columns[0]] # Get the first column's value as title_md + + # Start the unordered list