Skip to content

Commit

Permalink
fixing liting and update test
Browse files Browse the repository at this point in the history
  • Loading branch information
luissian committed Jan 25, 2024
1 parent 98a1f63 commit 6cabd24
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

5 changes: 2 additions & 3 deletions taranis/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -120,6 +121,7 @@ def taranis_cli(verbose, log_file):
)
log.addHandler(log_fh)


@taranis_cli.command(help_priority=1)
@click.option(
"-i",
Expand Down Expand Up @@ -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")

Expand All @@ -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
Expand Down
8 changes: 5 additions & 3 deletions taranis/analyze_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 6cabd24

Please sign in to comment.