From 6cabd2496244ebe739aeb7e0237ac52cb62d7442 Mon Sep 17 00:00:00 2001 From: luissian Date: Thu, 25 Jan 2024 17:27:04 +0100 Subject: [PATCH] fixing liting and update test --- .github/workflows/tests.yml | 4 ++-- taranis/__main__.py | 5 ++--- taranis/analyze_schema.py | 8 +++++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9a8095c..d8bb01c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,6 +28,6 @@ jobs: conda activate taranis_env - name: testung analyze schema run: - pip install . - taranis analyze-schema -i test/MLST_listeria -o analyze_schema_test --cpus 1 + poetry install + taranis analyze-schema -i test/MLST_listeria -o analyze_schema_test --cpus 1 --output-allele-annot --remove-no-cds --remove-duplicated --remove-subset \ No newline at end of file diff --git a/taranis/__main__.py b/taranis/__main__.py index da1ed40..6243bba 100644 --- a/taranis/__main__.py +++ b/taranis/__main__.py @@ -90,6 +90,7 @@ def decorator(f): cmd = super(CustomHelpOrder, self).command(*args, **kwargs)(f) help_priorities[cmd.name] = help_priority return cmd + return decorator @@ -120,6 +121,7 @@ def taranis_cli(verbose, log_file): ) log.addHandler(log_fh) + @taranis_cli.command(help_priority=1) @click.option( "-i", @@ -223,8 +225,6 @@ def analyze_schema( results.append(future.result()) _ = taranis.analyze_schema.collect_statistics(results, output, output_allele_annot) - _ = taranis.analyze_schema.collect_statistics(schema_analyze, output, output_allele_annot) - finish = time.perf_counter() print(f"Schema analyze finish in {round((finish-start)/60, 2)} minutes") @@ -251,7 +251,6 @@ def reference_alleles( schema: str, output: str, ): - schema_files = taranis.utils.get_files_in_folder(schema, "fasta") # Check if output folder exists diff --git a/taranis/analyze_schema.py b/taranis/analyze_schema.py index 4977a43..6cb4206 100644 --- a/taranis/analyze_schema.py +++ b/taranis/analyze_schema.py @@ -152,7 +152,9 @@ def check_allele_quality(self, prokka_annotation: dict) -> OrderedDict: try: unique_seq.remove(seq_value) except ValueError: - log.warning("Already deleted same sequence as for record id %s" , record.id) + log.warning( + "Already deleted same sequence as for record id %s", record.id + ) if seq_value in unique_seq: a_quality[rec_id]["quality"] = "Bad quality" a_quality[rec_id]["reason"] = "Sub set allele" @@ -295,8 +297,8 @@ def stats_graphics(stats_folder: str) -> None: # create graphic for alleles/number of genes group_alleles_df = stats_df.groupby( - pd.cut(stats_df["num_alleles"], allele_range) - ).count() + pd.cut(stats_df["num_alleles"], allele_range) + ).count() _ = taranis.utils.create_graphic( graphic_folder, "num_genes_per_allele.png",