Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a method to start writing the qc files again #59

Merged
merged 2 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
4 changes: 3 additions & 1 deletion cat_merge/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import yaml
import logging

from cat_merge.file_utils import read_dfs, read_tar_dfs, get_files, write
from cat_merge.file_utils import read_dfs, read_tar_dfs, get_files, write, write_qc
from cat_merge.merge_utils import merge_kg
from cat_merge.qc_utils import create_qc_report

Expand Down 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
Loading