Skip to content

Commit

Permalink
add a method to start writing the qc files again
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinschaper committed Aug 25, 2023
1 parent 3e5163c commit a87ab02
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cat_merge/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,10 @@ def write(kg: MergedKG, name: str, output_dir: str):
write_df(df=kg.edges, filename=edges_path)

write_tar(tar_path, [nodes_path, edges_path])

def write_qc(qc: MergeQC, name: str, output_dir: str):
duplicate_nodes_path = f"{output_dir}/qc/{name}-duplicate-nodes.tsv.gz"
dangling_edges_path = f"{output_dir}/qc/{name}-dangling-edges.tsv.gz"

write_df(df=qc.duplicate_nodes, filename=duplicate_nodes_path)
write_df(df=qc.dangling_edges, filename=dangling_edges_path)
2 changes: 2 additions & 0 deletions cat_merge/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ def merge(
output_dir=output_dir
)

write_qc(name=name, qc=qc, output_dir=output_dir)

if qc_report:
print("Generating QC report")
qc_report = create_qc_report(kg, qc)
Expand Down

0 comments on commit a87ab02

Please sign in to comment.