From 98f3ad279c24beecc855f5ba1e9bf95375bd6888 Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Thu, 5 Sep 2024 17:33:28 -0400 Subject: [PATCH] Get ontology ID only from list file --- src/kg_bioportal/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kg_bioportal/cli.py b/src/kg_bioportal/cli.py index d9c2417..18231ca 100644 --- a/src/kg_bioportal/cli.py +++ b/src/kg_bioportal/cli.py @@ -136,7 +136,7 @@ def download( with open(f"{output_dir}/{ONTOLOGY_LIST_NAME}", "r") as f: f.readline() # Skip the header for line in f: - onto_list.append(line.strip()) + onto_list.append(line.strip().split("\t")[0]) except FileNotFoundError: logging.error( f"Ontology list file not found. Please run the 'get_ontology_list' command first." @@ -153,7 +153,7 @@ def download( with open(ontology_file, "r") as f: f.readline() # Skip the header for line in f: - onto_list.append(line.strip()) + onto_list.append(line.strip().split("\t")[0]) logging.info(f"{len(onto_list)} ontologies to retrieve.")