From 0f533178e9e90cc760d38053ef2f47cb1f2b8c3d Mon Sep 17 00:00:00 2001 From: genomewalker Date: Sun, 13 Oct 2024 06:56:21 +0200 Subject: [PATCH] MInor fix --- bam_filter/filter.py | 1 + bam_filter/sam_utils.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bam_filter/filter.py b/bam_filter/filter.py index c24bfda..2c11167 100644 --- a/bam_filter/filter.py +++ b/bam_filter/filter.py @@ -257,6 +257,7 @@ def filter_references(args): sort_by_name=args.sort_by_name, min_read_ani=args.min_read_ani, disable_sort=args.disable_sort, + write_bam=args.bam_filtered is not None, ) else: logging.info("Skipping filtering of reference BAM file.") diff --git a/bam_filter/sam_utils.py b/bam_filter/sam_utils.py index 7eb93b4..c6d6569 100644 --- a/bam_filter/sam_utils.py +++ b/bam_filter/sam_utils.py @@ -1067,6 +1067,7 @@ def filter_reference_BAM( transform_cov_evenness=False, sort_by_name=False, disable_sort=False, + write_bam=False, ): """Filter BAM based on certain conditions @@ -1162,7 +1163,7 @@ def filter_reference_BAM( sep="\t", index=False, ) - if out_files["bam_filtered"] is not None: + if write_bam: logging.info("Writing filtered BAM file... (be patient)") # refs_dict = dict( # zip(df_filtered["reference"], df_filtered["bam_reference_length"])