Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
bebatut committed Oct 31, 2023
1 parent ed3faa3 commit b806367
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions bin/extract_galaxy_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def check_categories(ts_categories, ts_cat):
:param ts_cat: list of ToolShed categories to keep in the extraction
"""
if ts_categories is not None and len(ts_cat) > 0:
ts_cats = ts_categories.split(', ')
ts_cats = ts_categories.split(", ")
to_keep = False
for cat in ts_cats:
if cat in ts_cat:
Expand All @@ -145,12 +145,10 @@ def check_categories(ts_categories, ts_cat):


def get_tool_metadata(tool, repo):
""""
Get tool information
- Check the `.shed.yaml` file
- Extract metadata from the `.shed.yaml`
- Extract the requirements in the macros or xml file to get tool version supported in Galaxy
- Extract bio.tools information if available in the macros or xml
"""" "
Get tool metadata from the .shed.yaml, requirements in the macros or xml
file, bio.tools information if available in the macros or xml, EDAM
annotations using bio.tools API, recent conda version using conda API
:param tool: GitHub ContentFile object
:param repo: GitHub Repository object
Expand All @@ -174,7 +172,7 @@ def get_tool_metadata(tool, repo):
"Galaxy wrapper source": None,
"Galaxy wrapper version": None,
"Conda id": None,
"Conda version": None
"Conda version": None,
}
# extract .shed.yml information and check macros.xml
try:
Expand Down Expand Up @@ -368,18 +366,29 @@ def filter_tools(tools, ts_cat, excluded_tools, keep_tools):


if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Extract Galaxy tools from GitHub repositories together with biotools and conda metadata")
parser = argparse.ArgumentParser(
description="Extract Galaxy tools from GitHub repositories together with biotools and conda metadata"
)
subparser = parser.add_subparsers(dest="command")
# Extract tools
extractools = subparser.add_parser("extractools", help="Extract tools")
extractools.add_argument("--api", "-a", required=True, help="GitHub access token")
extractools.add_argument("--all_tools", "-o", required=True, help="Filepath to CSV with all extracted tools")
# Filter tools
filtertools = subparser.add_parser("filtertools", help="Filter tools")
filtertools.add_argument("--tools", "-t", required=True, help="Filepath to CSV with all extracted tools, generated by extractools command")
filtertools.add_argument(
"--tools",
"-t",
required=True,
help="Filepath to CSV with all extracted tools, generated by extractools command",
)
filtertools.add_argument("--filtered_tools", "-f", required=True, help="Filepath to CSV with filtered tools")
filtertools.add_argument("--categories", "-c", help="Path to a file with ToolShed category to keep in the extraction (one per line)")
filtertools.add_argument("--exclude", "-e", help="Path to a file with ToolShed ids of tools to exclude (one per line)")
filtertools.add_argument(
"--categories", "-c", help="Path to a file with ToolShed category to keep in the extraction (one per line)"
)
filtertools.add_argument(
"--exclude", "-e", help="Path to a file with ToolShed ids of tools to exclude (one per line)"
)
filtertools.add_argument("--keep", "-k", help="Path to a file with ToolShed ids of tools to keep (one per line)")
args = parser.parse_args()

Expand Down

0 comments on commit b806367

Please sign in to comment.