Skip to content

Commit b7dce21

Browse files
Merge pull request #7 from Knowledge-Graph-Hub/remove_refs_to_monarch_ingest
Update package name 'monarch-ingest' -> 'kg-alzheimers'
2 parents 71f66f5 + 2889ae7 commit b7dce21

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/kg_alzheimers/cli_utils.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def get_pkg_versions(output_dir: str = OUTPUT_DIR, release_version: Optional[str
342342
packages = {}
343343
packages["biolink"] = version("biolink-model")
344344
packages["koza"] = version("koza")
345-
packages["monarch-ingest"] = version("monarch-ingest")
345+
packages["kg-alzheimers"] = version("kg-alzheimers")
346346
kg_version = get_release_version() if release_version is None else release_version
347347
with open("data/metadata.yaml", "r") as f:
348348
data_versions = yaml.load(f, Loader=yaml.FullLoader)["data"]
@@ -359,7 +359,7 @@ def get_pkg_versions(output_dir: str = OUTPUT_DIR, release_version: Optional[str
359359

360360

361361
def merge_files(
362-
name: str = "monarch-kg",
362+
name: str = "kg-alzhimers",
363363
input_dir: str = f"{OUTPUT_DIR}/transform_output",
364364
output_dir: str = OUTPUT_DIR,
365365
verbose: Optional[bool] = None,
@@ -378,7 +378,7 @@ def merge_files(
378378

379379

380380
def apply_closure(
381-
name: str = "monarch-kg",
381+
name: str = "kg-alzheimers",
382382
closure_file: str = f"data/monarch/phenio-relation-filtered.tsv",
383383
output_dir: str = OUTPUT_DIR,
384384
):
@@ -422,7 +422,7 @@ def load_solr():
422422

423423

424424
def load_jsonl():
425-
db = duckdb.connect('output/monarch-kg.duckdb')
425+
db = duckdb.connect('output/kg-alzheimers.duckdb')
426426

427427
biolink_model = SchemaView(
428428
f"https://raw.githubusercontent.com/biolink/biolink-model/v{model.version}/biolink-model.yaml"
@@ -458,7 +458,7 @@ def slot_is_multi_valued(slot_name: str) -> bool:
458458
select nodes.* replace (ancestors as category, {mv_node_replacement})
459459
from nodes
460460
join class_ancestor_df on category = classname
461-
) to 'output/monarch-kg_nodes.jsonl' (FORMAT JSON);
461+
) to 'output/kg_alzheimers_nodes.jsonl' (FORMAT JSON);
462462
"""
463463
)
464464

@@ -468,26 +468,26 @@ def slot_is_multi_valued(slot_name: str) -> bool:
468468
select edges.* replace (ancestors as category, {mv_edge_replacement}),
469469
from edges
470470
join class_ancestor_df on category = classname
471-
) to 'output/monarch-kg_edges.jsonl' (FORMAT JSON);
471+
) to 'output/kg_alzheimers_edges.jsonl' (FORMAT JSON);
472472
"""
473473
)
474474

475475

476476
def create_qc_reports():
477-
database_file = "output/monarch-kg.duckdb"
477+
database_file = "output/kg-alzheimers.duckdb"
478478
# error if the database exists but needs to be gunzipped
479479
if Path(database_file + ".gz").is_file():
480480
raise FileExistsError(database_file + ".gz", "Database exists but needs to be decompressed")
481481
# error if the database doesn't exist
482482
if not Path(database_file).is_file():
483483
raise FileNotFoundError(database_file, "Database not found")
484-
484+
485485
qc_sql = Path("scripts/generate_reports.sql")
486486
if not qc_sql.is_file():
487487
raise FileNotFoundError(qc_sql, "generate_reports.sql QC SQL script not found")
488488
sql = qc_sql.read_text()
489489

490-
con = duckdb.connect('output/monarch-kg.duckdb')
490+
con = duckdb.connect('output/kg_alzheimers.duckdb')
491491
con.execute(sql)
492492

493493
def export_tsv():
@@ -497,22 +497,22 @@ def export_tsv():
497497
def do_prepare_release(dir: str = OUTPUT_DIR):
498498

499499
compressed_artifacts = [
500-
'output/monarch-kg.duckdb',
501-
'output/monarch-kg-denormalized-edges.tsv',
502-
'output/monarch-kg-denormalized-nodes.tsv',
500+
'output/kg-alzheimers.duckdb',
501+
'output/kg-alzheimers-denormalized-edges.tsv',
502+
'output/kg-alzheimers-denormalized-nodes.tsv',
503503
]
504504

505505
for artifact in compressed_artifacts:
506506
if Path(artifact).exists() and not Path(f"{artifact}.gz").exists():
507507
sh.pigz(artifact, force=True)
508508

509-
jsonl_tar = tarfile.open("output/monarch-kg.jsonl.tar.gz", "w:gz")
510-
jsonl_tar.add("output/monarch-kg_nodes.jsonl", arcname="monarch-kg_nodes.jsonl")
511-
jsonl_tar.add("output/monarch-kg_edges.jsonl", arcname="monarch-kg_edges.jsonl")
509+
jsonl_tar = tarfile.open("output/kg-alzheimers.jsonl.tar.gz", "w:gz")
510+
jsonl_tar.add("output/kg-alzheimers_nodes.jsonl", arcname="kg-alzheimers_nodes.jsonl")
511+
jsonl_tar.add("output/kg-alzheimers_edges.jsonl", arcname="kg-alzheimers_edges.jsonl")
512512
jsonl_tar.close()
513513

514-
os.remove("output/monarch-kg_nodes.jsonl")
515-
os.remove("output/monarch-kg_edges.jsonl")
514+
os.remove("output/kg-alzheimers_nodes.jsonl")
515+
os.remove("output/kg-alzheimers_edges.jsonl")
516516

517517

518518
def do_release(dir: str = OUTPUT_DIR, kghub: bool = False):

0 commit comments

Comments
 (0)