Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshdhgd committed Aug 4, 2024
1 parent fe406e4 commit 943e246
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions kg_microbe_merge/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,13 @@ def duckdb_merge(
Path(file_path) for file_path in nodes_files_path if "ontologies" in str(file_path)
]
for file_path in ontology_nodes_paths:
if file_path.suffix == ".tsv":
with file_path.open(newline="") as tsvfile:
reader = csv.DictReader(tsvfile, delimiter="\t")
for row in reader:
provided_by_value = row.get("provided_by")
if provided_by_value:
priority_sources.append(provided_by_value)
break # We only need the value from one row
with file_path.open(newline="") as tsvfile:
reader = csv.DictReader(tsvfile, delimiter="\t")
for row in reader:
provided_by_value = row.get("provided_by")
if provided_by_value:
priority_sources.append(provided_by_value)
break # We only need the value from one row

# Merge nodes
duckdb_nodes_merge(nodes_files_path, merge_nodes_output_path, priority_sources)
Expand Down

0 comments on commit 943e246

Please sign in to comment.