Skip to content

Commit f8f1e7c

Browse files
PauBadiaMclaude
andcommitted
Fix op.translate HCOP URL after EBI FTP drop (#303)
HGNC removed the entire /pub/databases/genenames/ subtree from the EBI FTP mirror, so every op.translate call (and every op.resource call for a non-human organism) was failing with HTTP 404. Point the download at the new HGNC Google Cloud Storage bucket, which is where HGNC now publishes the HCOP fifteen-column files. Also drop a stray pd.read_csv(url, ...) that was re-downloading the file a second time right after _download + _bytes_to_pandas had already produced map_df, silently doubling the network cost and bypassing the retry logic in _download. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6e18630 commit f8f1e7c

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning][].
88
[keep a changelog]: https://keepachangelog.com/en/1.0.0/
99
[semantic versioning]: https://semver.org/spec/v2.0.0.html
1010

11+
## 2.1.6
12+
13+
### Bugfixes
14+
- Fixed `op.translate` (and every `op.resource` call for non-human organisms) failing with HTTP 404 after HGNC dropped the `genenames/` subtree from the EBI FTP mirror; the HCOP fifteen-column files are now fetched from the new HGNC Google Cloud Storage bucket (#303)
15+
- Removed a redundant `pd.read_csv` call in `op.translate` that re-downloaded the HCOP file a second time and bypassed the retry logic in `_download`
16+
1117
## 2.1.5
1218

1319
### Added

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ requires = [ "hatchling" ]
44

55
[project]
66
name = "decoupler"
7-
version = "2.1.5"
7+
version = "2.1.6"
88
description = "Python package to perform enrichment analysis from omics data."
99
readme = "README.md"
1010
license = { file = "LICENSE" }

src/decoupler/op/_translate.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def translate(
130130
predictions tool. Briefings in Bioinformatics, 22(6), p.bbab155.
131131
132132
For more information, please visit the HCOP website: https://www.genenames.org/tools/hcop/,
133-
or alternatively check the bulk download FTP links page: https://ftp.ebi.ac.uk/pub/databases/genenames/hcop/
133+
or the HCOP help page for bulk download details: https://www.genenames.org/help/hcop/
134134
135135
Parameters
136136
----------
@@ -181,10 +181,9 @@ def translate(
181181
elif target_organism == "fruitfly":
182182
target_col = "fruit fly_symbol"
183183
# Process orthologs
184-
url = f"https://ftp.ebi.ac.uk/pub/databases/genenames/hcop/human_{target_organism}_hcop_fifteen_column.txt.gz"
184+
url = f"https://storage.googleapis.com/public-download-files/hcop/human_{target_organism}_hcop_fifteen_column.txt.gz"
185185
map_df = _download(url, verbose=verbose)
186186
map_df = _bytes_to_pandas(map_df, low_memory=False, compression="gzip", sep="\t")
187-
map_df = pd.read_csv(url, sep="\t", low_memory=False)
188187
map_df["evidence"] = map_df["support"].apply(lambda x: len(x.split(",")))
189188
map_df = map_df[map_df["evidence"] >= min_evidence]
190189
map_df = map_df[["human_symbol", target_col]]

0 commit comments

Comments
 (0)