Skip to content

Commit

Permalink
Dynamically load latest version of GenomeAlliance data
Browse files Browse the repository at this point in the history
Previously genome alliance data was frozen to version 5.3.0; added some code to get the latest version instead.
  • Loading branch information
DnlRKorn authored Jul 25, 2024
1 parent 8d8b643 commit d63d4bb
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions parsers/GenomeAlliance/src/loadGenomeAlliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import enum
import gzip
import requests

from Common.utils import GetData
from Common.loader_interface import SourceDataLoader
Expand Down Expand Up @@ -36,8 +37,11 @@ def __init__(self, test_mode: bool = False, source_data_dir: str = None):

self.latest_version = None
self.latest_version = self.get_latest_source_version()
self.genome_alliance_url = f'https://download.alliancegenome.org/{self.get_latest_source_version()}/ORTHOLOGY-ALLIANCE/COMBINED/'
self.genome_alliance_ortholog_file = 'ORTHOLOGY-ALLIANCE_COMBINED_25.tsv.gz'
#self.genome_alliance_url = f'https://download.alliancegenome.org/{self.get_latest_source_version()}/ORTHOLOGY-ALLIANCE/COMBINED/'
#self.genome_alliance_ortholog_file = 'ORTHOLOGY-ALLIANCE_COMBINED_25.tsv.gz'

self.genome_alliance_url = 'https://fms.alliancegenome.org/download/'
self.self.genome_alliance_ortholog_file = 'ORTHOLOGY-ALLIANCE_COMBINED.tsv.gz'
self.data_files = [self.genome_alliance_ortholog_file]

def get_latest_source_version(self) -> str:
Expand All @@ -46,8 +50,11 @@ def get_latest_source_version(self) -> str:
:return:
"""
if not self.latest_version:
self.latest_version = '5.3.0'
#if not self.latest_version:
# self.latest_version = '5.3.0'

self.latest_version = requests.get("https://www.alliancegenome.org/api/releaseInfo").json()['releaseVersion']

return self.latest_version

def get_data(self) -> int:
Expand Down

0 comments on commit d63d4bb

Please sign in to comment.