Skip to content

Commit

Permalink
Merge pull request #100 from GavinHuttley/develop
Browse files Browse the repository at this point in the history
ENH: support specifying downloading homologies in config
  • Loading branch information
GavinHuttley authored May 8, 2024
2 parents 842d19d + d0d7bd3 commit 53b733b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/ensembl_lite/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class Config:
species_dbs: dict[str, list[str]]
align_names: Iterable[str]
tree_names: Iterable[str]
homologies: bool

def update_species(self, species: dict[str, list[str]]):
if not species:
Expand Down Expand Up @@ -210,7 +211,7 @@ def read_config(config_path) -> Config:
install_path = (
pathlib.Path(parser.get("local path", "install_path")).expanduser().absolute()
)

homologies = parser.has_option("compara", "homologies")
species_dbs = {}
get_option = parser.get
align_names = []
Expand Down Expand Up @@ -248,4 +249,5 @@ def read_config(config_path) -> Config:
species_dbs=species_dbs,
align_names=align_names,
tree_names=tree_names,
homologies=homologies,
)
2 changes: 1 addition & 1 deletion src/ensembl_lite/_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def __call__(self, name: str) -> bool:

def download_homology(config: Config, debug: bool, verbose: bool):
"""downloads tsv homology files for each genome"""
if not any((config.align_names, config.tree_names)):
if not config.homologies:
return

site_map = get_site_map(config.host)
Expand Down
4 changes: 3 additions & 1 deletion src/ensembl_lite/data/sample.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ db=core
db=core
[compara]
align_names=10_primates.epo
tree_names=10_primates_EPO_default.nh
tree_names=10_primates_EPO_default.nh
# if you want homology data, keep the following line
homologies =

0 comments on commit 53b733b

Please sign in to comment.