phac-nml / irida-plugin-amr-detection

IRIDA Plugin for AMR Detection
Apache License 2.0
3 stars 3 forks source link

Fix/missing rgi results #13

Closed apetkau closed 3 years ago

apetkau commented 3 years ago

This refactors some of the code used to parse the results and write to our metadata tables. A few things it fixes:

Changes

  1. It fixes this issue https://github.com/phac-nml/irida-plugin-amr-detection/issues/8 which was causing an error when writing metadata if the RGI results were empty. My fix changes the code so that if any fields are missing in either RGI or staramr then the character - will be written to the that particular field in the table (instead of throwing an Exception and causing the entire metadata write to fail).
  2. This changes parsing of the results files (e.g., staramr-summary.tsv) to not rely on the column number but instead to use the column name (e.g., it won't rely on the GENOTYPE information being in column 2, but instead rely on the column name Genotype). This is because, depending on the parameters you set in the tool, some columns for staramr can be added or removed from the final results file.

Testing

To test you will have to first install IRIDA 21.01 to a local maven repository with the command (run from the IRIDA directory):

mvn clean install -DskipTests

Then you can compile this code into a package and copy to the /etc/irida/plugins directory:

mvn clean package
cp target/amr-detection-0.2.0.jar /etc/irida/plugins

Now, to test out you will need to start up Galaxy and install the appropriate tools:

docker run -d -p 3000:80 -v /path/to/irida/data:/path/to/irida/data phacnml/galaxy-irida-20.05

Now, you will have to login to the Galaxy instance (username: admin@galaxy.org, password: password) and go to Admin > Install and Uninstall and install the appropriate versions of tools:

Now, you can start up IRIDA and test out. So to test out point (1) (the bug) you can use the below files which will have a results for staramr but not for RGI.