phac-nml / staramr

Scans genome contigs against the ResFinder, PlasmidFinder, and PointFinder databases.
Apache License 2.0
113 stars 26 forks source link

Fixed index range error and added integration test #60

Closed jennifertran closed 5 years ago

jennifertran commented 5 years ago

Problem

  1. While testing some fasta files, plasmid IncFII(pKPX1)__AP012055 only returned 2 parameters when it was supposed to return 3-5 pameters. This is because it the get_amr_gene_id() in PlasmidfinderHitHSP.py normally returns some variation of [plasmid name, number, accession] but in this case, it only returned [plasmid name, accession]
  2. The column names get mixed up whenever the resistrance frame is empty but plasmid frame is not in the summary table.

Solution

Add logic to handle these edge cases and use integration testing to verify if the implementation worked

Implementation

  1. If the length if the amr gene list is 2, append another value of one to allow the plasmid be added to the table.
  2. Check if plasmid table is not empty and the resistance is empty. If it is, append the plasmid table to the resistance table and reindex the columns in the following proper order: Isolate ID, Genotype, Predicted Phenotype, Plasmid Genes

Testing

Integration testing was used on the plasmid IncFII(pKPX1)__AP012055 as it was the one that was causing issues. We need to make sure that it returns the proper values in the correct columns.

apetkau commented 5 years ago

This looks great. Thanks so much @jennifertran