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]
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
If the length if the amr gene list is 2, append another value of one to allow the plasmid be added to the table.
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.
Problem
IncFII(pKPX1)__AP012055
only returned 2 parameters when it was supposed to return 3-5 pameters. This is because it theget_amr_gene_id()
inPlasmidfinderHitHSP.py
normally returns some variation of[plasmid name, number, accession]
but in this case, it only returned[plasmid name, accession]
Solution
Add logic to handle these edge cases and use integration testing to verify if the implementation worked
Implementation
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.