Skip to content

Commit

Permalink
write cutoff network files and full network file
Browse files Browse the repository at this point in the history
  • Loading branch information
CatarinaCarolina committed Nov 3, 2023
1 parent e2f4751 commit 4b0693c
Show file tree
Hide file tree
Showing 3 changed files with 286 additions and 25 deletions.
29 changes: 12 additions & 17 deletions big_scape/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
legacy_prepare_bin_output,
legacy_generate_bin_output,
write_record_annotations_file,
write_clustering_file,
write_full_network_file,
)


Expand Down Expand Up @@ -341,6 +341,9 @@ def align_callback(tasks_done: int):
# prepare output files
legacy_prepare_output(run["output_dir"], pfam_info)

# write full network file
write_full_network_file(run, all_bgc_records)

# prepare output files per cutoff
for cutoff in run["gcf_cutoffs"]:
# TODO: update to use records and not gbk regions?
Expand All @@ -364,9 +367,8 @@ def align_callback(tasks_done: int):
f"Network {mix_bin.label} with cutoff {cutoff} is empty after culling singletons"
)
continue
legacy_prepare_bin_output(run["output_dir"], run["label"], cutoff, mix_bin)
legacy_generate_bin_output(run["output_dir"], run["label"], cutoff, mix_bin)
write_clustering_file(run, cutoff, mix_bin)
legacy_prepare_bin_output(run, cutoff, mix_bin)
legacy_generate_bin_output(run, cutoff, mix_bin)

# legacy_classify

Expand All @@ -382,9 +384,8 @@ def align_callback(tasks_done: int):
f"Network '{bin.label}' with cutoff {cutoff} is empty after culling singletons"
)
continue
legacy_prepare_bin_output(run["output_dir"], run["label"], cutoff, bin)
legacy_generate_bin_output(run["output_dir"], run["label"], cutoff, bin)
write_clustering_file(run, cutoff, bin)
legacy_prepare_bin_output(run, cutoff, bin)
legacy_generate_bin_output(run, cutoff, bin)

# classify

Expand All @@ -409,9 +410,8 @@ def align_callback(tasks_done: int):
f"Network '{bin.label}' with cutoff {cutoff} is empty after culling singletons"
)
continue
legacy_prepare_bin_output(run["output_dir"], run["label"], cutoff, bin)
legacy_generate_bin_output(run["output_dir"], run["label"], cutoff, bin)
write_clustering_file(run, cutoff, bin)
legacy_prepare_bin_output(run, cutoff, bin)
legacy_generate_bin_output(run, cutoff, bin)

# query

Expand All @@ -423,13 +423,8 @@ def align_callback(tasks_done: int):
[record for record in all_bgc_records if record is not None]
)
for cutoff in run["gcf_cutoffs"]:
legacy_prepare_bin_output(
run["output_dir"], run["label"], cutoff, query_bin
)
legacy_generate_bin_output(
run["output_dir"], run["label"], cutoff, query_bin
)
write_clustering_file(run, cutoff, query_bin)
legacy_prepare_bin_output(run, cutoff, query_bin)
legacy_generate_bin_output(run, cutoff, query_bin)

if run["profiling"]:
profiler.stop()
Expand Down
4 changes: 4 additions & 0 deletions big_scape/output/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
legacy_generate_bin_output,
write_record_annotations_file,
write_clustering_file,
write_cutoff_network_file,
write_full_network_file,
)

__all__ = [
Expand All @@ -14,4 +16,6 @@
"legacy_generate_bin_output",
"write_record_annotations_file",
"write_clustering_file",
"write_cutoff_network_file",
"write_full_network_file",
]
Loading

0 comments on commit 4b0693c

Please sign in to comment.