Skip to content

Commit

Permalink
Merge branch 'main' into biotool-extraction-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bebatut authored Oct 31, 2023
2 parents 3314b95 + c992b20 commit c5a1df0
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions bin/extract_galaxy_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@

import argparse
import base64
import time
import xml.etree.ElementTree as et
from pathlib import Path
from unicodedata import category

import pandas as pd
import requests
import time
import yaml
import xml.etree.ElementTree as et

from github import Github
from pathlib import Path

# config variables

# BIOTOOLS_API_URL = "https://bio.tools"
BIOTOOLS_API_URL = "https://130.226.25.21"

def read_file(filepath):
'''
Expand Down Expand Up @@ -264,12 +268,14 @@ def get_tool_metadata(tool, repo, ts_cat, excluded_tools, keep_tools):
metadata['Status'] = 'Up-to-date'
# get bio.tool information
if metadata["bio.tool id"] is not None:
r = requests.get(f'https://130.226.25.21/api/tool/{metadata["bio.tool id"]}/?format=json')
r = requests.get(f'{BIOTOOLS_API_URL}/api/tool/{metadata["bio.tool id"]}/?format=json')
if r.status_code == requests.codes.ok:
biotool_info = r.json()
if "function" in biotool_info and 'operation' in biotool_info['function']:
for op in biotool_info['function']['operation']:
metadata['EDAM operation'].append(op['term'])
if "function" in biotool_info:
for func in biotool_info['function']:
if 'operation' in func:
for op in func['operation']:
metadata['EDAM operation'].append(op['term'])
if "topic" in biotool_info:
for t in biotool_info['topic']:
metadata['EDAM topic'].append(t['term'])
Expand Down

0 comments on commit c5a1df0

Please sign in to comment.