Skip to content

Commit

Permalink
Merge pull request #240 from RobokopU24/DnlRKorn-patch-2
Browse files Browse the repository at this point in the history
Dynamically load latest version of GenomeAlliance data
  • Loading branch information
EvanDietzMorris authored Dec 9, 2024
2 parents fcf6611 + d63d4bb commit cd9a6c5
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 cd9a6c5

Please sign in to comment.