Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: multiple matches for gene=gyrA #174

Closed
stanikae opened this issue Apr 23, 2023 · 3 comments
Closed

Error: multiple matches for gene=gyrA #174

stanikae opened this issue Apr 23, 2023 · 3 comments
Assignees

Comments

@stanikae
Copy link

stanikae commented Apr 23, 2023

Hi,

Getting following error when running staramr on one of my E coli assemblies: staramr.exceptions.GenotypePhenotypeMatchException.GenotypePhenotypeMatchException: Error, multiple matches for gene=gyrA, codon_mutation=CodonMutationPosition(_database_amr_gene_start=1, _nucleotide_position_amr_gene=259, _codon_start=87, _database_amr_gene_codon=GAC, _input_genome_codon=AAC)

See full error message below:

--- Logging error ---
Traceback (most recent call last):
  File "~/lib/python3.6/site-packages/staramr/blast/results/BlastResultsParser.py", line 67, in parse_results
    self._handle_blast_hit(file, database_name, blast_out, results, hit_seq_records)
  File "~/lib/python3.6/site-packages/staramr/blast/results/BlastResultsParser.py", line 109, in _handle_blast_hit
    blast_results = self._get_result_rows(hit, database_name)
  File "~/lib/python3.6/site-packages/staramr/blast/results/pointfinder/BlastResultsParserPointfinder.py", line 79, in _get_result_rows
    database_resistance_mutations = self._blast_database.get_resistance_codons(gene, database_mutations)
  File "~/lib/python3.6/site-packages/staramr/blast/pointfinder/PointfinderBlastDatabase.py", line 54, in get_resistance_codons
    return self._pointfinder_info.get_resistance_codons(gene, codon_mutations)
  File "~/lib/python3.6/site-packages/staramr/blast/pointfinder/PointfinderDatabaseInfo.py", line 107, in get_resistance_codons
    match = self._get_resistance_codon_match(gene, codon_mutation)
  File "~/lib/python3.6/site-packages/staramr/blast/pointfinder/PointfinderDatabaseInfo.py", line 76, in _get_resistance_codon_match
    raise GenotypePhenotypeMatchException("Error, multiple matches for gene=" + str(gene) + ", codon_mutation=" + str(codon_mutation))
staramr.exceptions.GenotypePhenotypeMatchException.GenotypePhenotypeMatchException: Error, multiple matches for gene=gyrA, codon_mutation=CodonMutationPosition(_database_amr_gene_start=1, _nucleotide_position_amr_gene=259, _codon_start=87, _database_amr_gene_codon=GAC, _input_genome_codon=AAC)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "~/lib/python3.6/logging/__init__.py", line 994, in emit
    msg = self.format(record)
  File "~/lib/python3.6/logging/__init__.py", line 840, in format
    return fmt.format(record)
  File "~/lib/python3.6/logging/__init__.py", line 577, in format
    record.message = record.getMessage()
  File "~/lib/python3.6/logging/__init__.py", line 338, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "~/bin/staramr", line 68, in <module>
    args.run_command(args)
  File "~/lib/python3.6/site-packages/staramr/subcommand/Search.py", line 488, in run
    unacceptable_num_contigs= args.unacceptable_num_contigs)
  File "~/lib/python3.6/site-packages/staramr/subcommand/Search.py", line 290, in _generate_results
    report_all_blast, ignore_invalid_files, mlst_scheme)
  File "~/lib/python3.6/site-packages/staramr/detection/AMRDetection.py", line 195, in run_amr_detection
    plength_threshold_pointfinder, report_all)
  File "~/lib/python3.6/site-packages/staramr/detection/AMRDetectionResistance.py", line 56, in _create_pointfinder_dataframe
    return pointfinder_parser.parse_results()
  File "~/lib/python3.6/site-packages/staramr/blast/results/BlastResultsParser.py", line 69, in parse_results
    logger.error(f"Error with results from file [{file}]", e)
Message: 'Error with results from file [11008_assembly_assembly.fasta]'
Arguments: (GenotypePhenotypeMatchException('Error, multiple matches for gene=gyrA, codon_mutation=CodonMutationPosition(_database_amr_gene_start=1, _nucleotide_position_amr_gene=259, _codon_start=87, _database_amr_gene_codon=GAC, _input_genome_codon=AAC)',),)
2023-04-23 11:40:00 ERROR: Error, multiple matches for gene=gyrA, codon_mutation=CodonMutationPosition(_database_amr_gene_start=1, _nucleotide_position_amr_gene=259, _codon_start=87, _database_amr_gene_codon=GAC, _input_genome_codon=AAC)
Traceback (most recent call last):
 File "~/bin/staramr", line 68, in <module>
    args.run_command(args)
  File "~/lib/python3.6/site-packages/staramr/subcommand/Search.py", line 488, in run
    unacceptable_num_contigs= args.unacceptable_num_contigs)
  File "~/lib/python3.6/site-packages/staramr/subcommand/Search.py", line 290, in _generate_results
    report_all_blast, ignore_invalid_files, mlst_scheme)
  File "~/lib/python3.6/site-packages/staramr/detection/AMRDetection.py", line 195, in run_amr_detection
    plength_threshold_pointfinder, report_all)
  File "~/lib/python3.6/site-packages/staramr/detection/AMRDetectionResistance.py", line 56, in _create_pointfinder_dataframe
    return pointfinder_parser.parse_results()
  File "~/lib/python3.6/site-packages/staramr/blast/results/BlastResultsParser.py", line 70, in parse_results
    raise e
  File "~/lib/python3.6/site-packages/staramr/blast/results/BlastResultsParser.py", line 67, in parse_results
    self._handle_blast_hit(file, database_name, blast_out, results, hit_seq_records)
  File "~/lib/python3.6/site-packages/staramr/blast/results/BlastResultsParser.py", line 109, in _handle_blast_hit
    blast_results = self._get_result_rows(hit, database_name)
  File "~/lib/python3.6/site-packages/staramr/blast/results/pointfinder/BlastResultsParserPointfinder.py", line 79, in _get_result_rows
    database_resistance_mutations = self._blast_database.get_resistance_codons(gene, database_mutations)
  File "~/lib/python3.6/site-packages/staramr/blast/pointfinder/PointfinderBlastDatabase.py", line 54, in get_resistance_codons
    return self._pointfinder_info.get_resistance_codons(gene, codon_mutations)
  File "~/lib/python3.6/site-packages/staramr/blast/pointfinder/PointfinderDatabaseInfo.py", line 107, in get_resistance_codons
    match = self._get_resistance_codon_match(gene, codon_mutation)
  File "~/lib/python3.6/site-packages/staramr/blast/pointfinder/PointfinderDatabaseInfo.py", line 76, in _get_resistance_codon_match
    raise GenotypePhenotypeMatchException("Error, multiple matches for gene=" + str(gene) + ", codon_mutation=" + str(codon_mutation))
staramr.exceptions.GenotypePhenotypeMatchException.GenotypePhenotypeMatchException: Error, multiple matches for gene=gyrA, codon_mutation=CodonMutationPosition(_database_amr_gene_start=1, _nucleotide_position_amr_gene=259, _codon_start=87, _database_amr_gene_codon=GAC, _input_genome_codon=AAC)
@apetkau
Copy link
Member

apetkau commented Apr 24, 2023

Thank you for reporting. We will try to find a fix for you.

@apetkau apetkau moved this to In Progress in StarAMR 0.10.0 Aug 3, 2023
@emarinier
Copy link
Member

Noting that this particular exception appears to exist in StarAMR version 0.8.0, but not in 0.9.0 and onwards.

@apetkau
Copy link
Member

apetkau commented Aug 10, 2023

This issue is fixed in the latest version of staramr. Test added in #192 to verify

@apetkau apetkau closed this as completed Aug 10, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in StarAMR 0.10.0 Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants