diff --git a/build_figures.py b/build_figures.py index 39654ca64154d6053c5fcd44c9420f169ba1a2fa..f1f05bbfb75a4483d802d47b678b51302cd4c83a 100755 --- a/build_figures.py +++ b/build_figures.py @@ -200,8 +200,11 @@ def build_recall_precision_graphs(tools, output_dir): def init(input_dir, nb_inds, haploid, stripplot, output): os.chdir(input_dir) tools = ["breakdancer", "delly", "lumpy", "pindel", "cnvnator", "genomestrip", "Filtered_results"] - build_genotype_quality_graphs(tools, nb_inds, haploid, stripplot, output) build_recall_precision_graphs(tools, output) + if len(glob.glob("*sv_genotypes_quality_per_tools.tsv")) > 0: + build_genotype_quality_graphs(tools, nb_inds, haploid, stripplot, output) + else: + print("No genotypes found. Step ignored.") def main(): diff --git a/build_results.py b/build_results.py index b67cd9f4634521ac2c7209240b7073e3491b0d65..96554e602e280f2c9ff5ae046d774879f32b5820 100755 --- a/build_results.py +++ b/build_results.py @@ -813,9 +813,10 @@ def build_body_cells(rec_keys, records, nb_records, nb_inds, tools, cells, cells ############################################################################### # Until we have filled all tools, check if the record is kept after filtering: # ############################################################################### - cells, cells_gt, cells_gq = apply_style_of_filter_cells(cells, cells_gt, cells_gq, i, is_kept, nb_records, - nb_inds, nb_tools, filtered_records, do_genotype, - rec_id) + if filtered_records is not None: + cells, cells_gt, cells_gq = apply_style_of_filter_cells(cells, cells_gt, cells_gq, i, is_kept, nb_records, + nb_inds, nb_tools, filtered_records, do_genotype, + rec_id) i += 1 @@ -858,9 +859,10 @@ def init(output, vcf_folder, true_vcf, filtered_vcfs=None, genotypes_files=None, eprint(" Reading file %s" % true_ones) sv_set_to, true_ones_records = read_vcf_file(true_ones) sv_set += sv_set_to - filtered_records = [] + filtered_records = None if filtered_vcfs: + filtered_records = [] for filtered_vcf in filtered_vcfs: eprint(" Reading file %s" % filtered_vcf) filtered_records += read_vcf_file(filtered_vcf)[1]