diff --git a/CHANGELOG.md b/CHANGELOG.md index f9b791f..28632f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +# 0.2.0 + +- For each gene in the 'gene screening file', both the 'detection status' (True/False) and the detected allele + are written to the IRIDA line-list. Alleles are also reported in the 'gene_detection_status.tsv' output file. +- Limited pipeline parameters to simplify and standardize operation + - Resistance Gene Database is fixed on CARD database. + - Cannot disable post-assembly correction or read trimming. + - Cannot change contig name format + - Cannot provide 'extra spades options' to shovill assembler +- Added thresholds for resistance gene %Coverage and %Identity during secondary screening phase +- The gene screening file used for the analysis is included in the pipeline output + +# 0.1.1 + +- Fixed [issue](https://github.com/Public-Health-Bioinformatics/irida-plugin-resistance-screen/issues/1) where sequence data was not being transferred to galaxy + # 0.1.0 -* Initial release of example plugin. +- Initial release of example plugin. + diff --git a/README.md b/README.md index 8f1aa55..35baab2 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ managers within your Galaxy instance. These can be found at: | shovill | `1.0.4` | `iuc` | 3 (2018-11-13) | [shovill-3:865119fcb694](https://toolshed.g2.bx.psu.edu/view/iuc/shovill/865119fcb694) | | quast | `5.0.2` | `iuc` | 5 (2018-12-04) | [quast-5:81df4950d65b](https://toolshed.g2.bx.psu.edu/view/iuc/quast/81df4950d65b) | | abricate | `0.9.8` | `iuc` | 7 (2019-10-29) | [abricate-7:4efdca267d51](https://toolshed.g2.bx.psu.edu/view/iuc/abricate/4efdca267d51) | -| screen_abricate_report | `0.1.0` | `public-health-bioinformatics` | 0 (2019-10-31) | [screen_abricate_report-0:b2d56a44a872](https://toolshed.g2.bx.psu.edu/view/public-health-bioinformatics/screen_abricate_report/b2d56a44a872) | +| screen_abricate_report | `0.4.0` | `public-health-bioinformatics` | 4 (2020-01-02) | [screen_abricate_report-4:22247b1a59d5](https://toolshed.g2.bx.psu.edu/view/public-health-bioinformatics/screen_abricate_report/22247b1a59d5) | | data_manager_manual | `0.0.2` | `iuc` | 5 (2019-10-21) | [data_manager_manual-5:744f607fac50](https://toolshed.g2.bx.psu.edu/view/iuc/data_manager_manual/744f607fac50) | ## Installing to IRIDA @@ -49,13 +49,13 @@ Please download the provided `irida-plugin-resistance-screen-[version].jar` from ## Setting up your abricate report screening file(s) Abricate report screening files have a simple tabular format, and can be created with Excel, another spreadsheet application, -or a plaintext editor. They consist of two columns, with headings `gene_name` and `regex`. All fields should be tab-delimited. +or a plaintext editor. They consist of two columns, with headings `gene_name` and `regex`. All fields must be tab-delimited. ``` gene_name regex -KPC KPC -OXA-48 OXA\-48 -NDM NDM +KPC ^KPC-\d+$ +OXA ^OXA-\d+$ +NDM ^NDM-\d+$ ``` ## Preparing the 'abricate_report_screening_files' Tool Data Table in Galaxy @@ -86,9 +86,10 @@ report, and a screened `abricate` report that includes only your genes of intere And, you should be able to save and view these results in the IRIDA metadata table. The following fields are written to the IRIDA 'Line List': -| Field Name | Description | -|--------------------------------------------|-----------------------------------------------------------| -| resistance-screen//detected | Whether or not `GENE_NAME` was detected (True/False) | +| Field Name | Description | +|--------------------------------------------|------------------------------------------------------------------------------------------------------------| +| resistance-screen//detected | Whether or not `GENE_NAME` was detected (True/False) | +| resistance-screen//alleles | Any allele(s) detected for `GENE_NAME`. If multiple alleles detected, commma-delimited (eg: `KPC-2,KPC-3`) | **Note**: If your abricate report screening file contains many genes, this will result in many columns diff --git a/doc/images/pipeline-parameters.png b/doc/images/pipeline-parameters.png index 0e4c4ea..d1cefc6 100644 Binary files a/doc/images/pipeline-parameters.png and b/doc/images/pipeline-parameters.png differ diff --git a/doc/images/plugin-metadata.png b/doc/images/plugin-metadata.png index 85af467..eab7f46 100644 Binary files a/doc/images/plugin-metadata.png and b/doc/images/plugin-metadata.png differ diff --git a/doc/images/plugin-results-1.png b/doc/images/plugin-results-1.png index f690542..e82b8cc 100644 Binary files a/doc/images/plugin-results-1.png and b/doc/images/plugin-results-1.png differ diff --git a/doc/images/plugin-results-2.png b/doc/images/plugin-results-2.png index 912af81..c4f35ec 100644 Binary files a/doc/images/plugin-results-2.png and b/doc/images/plugin-results-2.png differ diff --git a/doc/images/plugin-results-3.png b/doc/images/plugin-results-3.png index 6fa10c0..19123bd 100644 Binary files a/doc/images/plugin-results-3.png and b/doc/images/plugin-results-3.png differ diff --git a/pom.xml b/pom.xml index 0f92205..d51197a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,14 +6,14 @@ org.publichealthbioinformatics irida-plugin-resistance-screen - 0.2.0-SNAPSHOT + 0.2.0 resistance-screen org.publichealthbioinformatics.irida.plugin.resistancescreen.ResistanceScreenPlugin - 0.2.0-SNAPSHOT + 0.2.0 Dan Fornika 1.0.0 diff --git a/src/main/java/org/publichealthbioinformatics/irida/plugin/resistancescreen/ResistanceScreenPluginUpdater.java b/src/main/java/org/publichealthbioinformatics/irida/plugin/resistancescreen/ResistanceScreenPluginUpdater.java index ad93007..b8803fe 100644 --- a/src/main/java/org/publichealthbioinformatics/irida/plugin/resistancescreen/ResistanceScreenPluginUpdater.java +++ b/src/main/java/org/publichealthbioinformatics/irida/plugin/resistancescreen/ResistanceScreenPluginUpdater.java @@ -96,11 +96,15 @@ public void update(Collection samples, AnalysisSubmission analysis) thro for (Map geneDetectionStatus : geneDetectionStatuses) { String geneName = geneDetectionStatus.get("gene_name"); String geneDetected = geneDetectionStatus.get("detected"); - PipelineProvidedMetadataEntry geneDetectedEntry = new PipelineProvidedMetadataEntry(geneDetected, "boolean", analysis); - - // key will be string like 'abricate-screen/KPC/detected' - String key = workflowName + "/" + geneName + "/" + "detected"; + String alleles = geneDetectionStatus.get("alleles"); + PipelineProvidedMetadataEntry geneDetectedEntry = new PipelineProvidedMetadataEntry(geneDetected, "xs:boolean", analysis); + PipelineProvidedMetadataEntry allelesEntry = new PipelineProvidedMetadataEntry(alleles, "xs:string", analysis); + // key will be string like 'resistance-screen/KPC/detected' + String key; + key = workflowName + "/" + geneName + "/" + "detected"; metadataEntries.put(key, geneDetectedEntry); + key = workflowName + "/" + geneName + "/" + "alleles"; + metadataEntries.put(key, allelesEntry); } Map metadataMap = metadataTemplateService.getMetadataMap(metadataEntries); @@ -125,8 +129,8 @@ public void update(Collection samples, AnalysisSubmission analysis) thro * the pipeline. This file should contain contents like: * *
-	 * gene_name	detected
-	 * KPC	True
+	 * gene_name	detected	alleles
+	 * KPC	True	KPC-2
 	 * OXA	False
 	 *                 
* @@ -147,7 +151,7 @@ List> parseGeneDetectionStatusFile(Path geneDetectionStatusF HashMap geneDetectionStatus = new HashMap<>(); String geneDetectionStatusLine; while (( geneDetectionStatusLine = geneDetectionStatusReader.readLine()) != null) { - String[] geneDetectionStatusEntries = geneDetectionStatusLine.split("\t"); + String[] geneDetectionStatusEntries = geneDetectionStatusLine.split("\t", -1); for (int i = 0; i < fieldNames.length; i++) { geneDetectionStatus.put(fieldNames[i], geneDetectionStatusEntries[i]); } diff --git a/src/main/resources/workflows/0.2.0/irida_workflow.xml b/src/main/resources/workflows/0.2.0/irida_workflow.xml index 570fd84..f0baf72 100644 --- a/src/main/resources/workflows/0.2.0/irida_workflow.xml +++ b/src/main/resources/workflows/0.2.0/irida_workflow.xml @@ -2,51 +2,36 @@ 1f40bbf2-4080-4cf7-a846-988e602eaa30 resistance-screen - 0.1.1 + 0.2.0 RESISTANCE_SCREEN sequence_reads_paired true - - - - - - - - - - - - - - - - - - - - - - + - + + + + + + + @@ -55,6 +40,7 @@ + @@ -79,7 +65,7 @@ screen_abricate_report public-health-bioinformatics https://toolshed.g2.bx.psu.edu - b2d56a44a872 + 22247b1a59d5 data_manager_manual diff --git a/src/main/resources/workflows/0.2.0/irida_workflow_structure.ga b/src/main/resources/workflows/0.2.0/irida_workflow_structure.ga index ca8ca0a..5b636ee 100644 --- a/src/main/resources/workflows/0.2.0/irida_workflow_structure.ga +++ b/src/main/resources/workflows/0.2.0/irida_workflow_structure.ga @@ -1,9 +1,9 @@ { - "uuid": "4bd94bec-d153-4ef4-9de9-7cc7dab52d58", + "uuid": "8d444915-9626-4acf-a59c-b6056a7b8bb3", "tags": [], "format-version": "0.1", "name": "resistance-screen", - "version": 5, + "version": 1, "steps": { "0": { "tool_id": null, @@ -12,7 +12,7 @@ "workflow_outputs": [ { "output_name": "output", - "uuid": "d8b40d39-da82-4fb2-8d71-2b6f369bd91b", + "uuid": "010f9985-5838-41d7-bb8e-aed39f941a7b", "label": null } ], @@ -72,7 +72,7 @@ "id": 0 } }, - "tool_state": "{\"adv\": \"{\\\"depth\\\": \\\"100\\\", \\\"gsize\\\": \\\"\\\", \\\"kmers\\\": \\\"\\\", \\\"mincov\\\": \\\"2\\\", \\\"minlen\\\": \\\"0\\\", \\\"namefmt\\\": \\\"contig%05d\\\", \\\"nocorr\\\": \\\"true\\\", \\\"opts\\\": \\\"\\\"}\", \"trim\": \"\\\"true\\\"\", \"log\": \"\\\"true\\\"\", \"__page__\": null, \"__rerun_remap_job_id__\": null, \"assembler\": \"\\\"spades\\\"\", \"library\": \"{\\\"__current_case__\\\": 1, \\\"input1\\\": {\\\"__class__\\\": \\\"RuntimeValue\\\"}, \\\"lib_type\\\": \\\"collection\\\"}\"}", + "tool_state": "{\"adv\": \"{\\\"depth\\\": \\\"100\\\", \\\"gsize\\\": \\\"\\\", \\\"kmers\\\": \\\"\\\", \\\"mincov\\\": \\\"2\\\", \\\"minlen\\\": \\\"0\\\", \\\"namefmt\\\": \\\"contig%05d\\\", \\\"nocorr\\\": \\\"true\\\", \\\"opts\\\": \\\"\\\"}\", \"trim\": \"\\\"true\\\"\", \"log\": \"\\\"true\\\"\", \"__page__\": null, \"__rerun_remap_job_id__\": null, \"assembler\": \"\\\"spades\\\"\", \"library\": \"{\\\"__current_case__\\\": 1, \\\"input1\\\": {\\\"__class__\\\": \\\"ConnectedValue\\\"}, \\\"lib_type\\\": \\\"collection\\\"}\"}", "id": 1, "tool_shed_repository": { "owner": "iuc", @@ -105,12 +105,7 @@ } }, "label": null, - "inputs": [ - { - "name": "library", - "description": "runtime parameter for tool Shovill" - } - ], + "inputs": [], "position": { "top": 209, "left": 261.5 @@ -213,7 +208,7 @@ "id": 1 } }, - "tool_state": "{\"input_operon\": \"{\\\"__class__\\\": \\\"RuntimeValue\\\"}\", \"__page__\": null, \"threshold_contig\": \"\\\"0,1000\\\"\", \"__rerun_remap_job_id__\": null, \"annot\": \"{\\\"__class__\\\": \\\"RuntimeValue\\\"}\", \"large\": \"\\\"false\\\"\", \"type_file\": \"\\\"contig\\\"\", \"input\": \"{\\\"__class__\\\": \\\"RuntimeValue\\\"}\", \"input_size\": \"\\\"\\\"\", \"input_ref\": \"{\\\"__class__\\\": \\\"RuntimeValue\\\"}\", \"min_contig\": \"\\\"500\\\"\", \"gene_selection\": \"\\\"prokaryotes\\\"\"}", + "tool_state": "{\"input_operon\": \"{\\\"__class__\\\": \\\"RuntimeValue\\\"}\", \"__page__\": null, \"threshold_contig\": \"\\\"0,1000\\\"\", \"__rerun_remap_job_id__\": null, \"annot\": \"{\\\"__class__\\\": \\\"RuntimeValue\\\"}\", \"large\": \"\\\"false\\\"\", \"type_file\": \"\\\"contig\\\"\", \"input\": \"{\\\"__class__\\\": \\\"ConnectedValue\\\"}\", \"input_size\": \"\\\"\\\"\", \"input_ref\": \"{\\\"__class__\\\": \\\"RuntimeValue\\\"}\", \"min_contig\": \"\\\"500\\\"\", \"gene_selection\": \"\\\"prokaryotes\\\"\"}", "id": 3, "tool_shed_repository": { "owner": "iuc", @@ -225,6 +220,11 @@ "errors": null, "name": "Quast", "post_job_actions": { + "HideDatasetActionunalign_tsv": { + "output_name": "unalign_tsv", + "action_type": "HideDatasetAction", + "action_arguments": {} + }, "HideDatasetActionreport_pdf": { "output_name": "report_pdf", "action_type": "HideDatasetAction", @@ -242,8 +242,8 @@ "newname": "quast.tsv" } }, - "HideDatasetActionunalign_tsv": { - "output_name": "unalign_tsv", + "HideDatasetActionreport_html": { + "output_name": "report_html", "action_type": "HideDatasetAction", "action_arguments": {} }, @@ -251,11 +251,6 @@ "output_name": "log_txt", "action_type": "HideDatasetAction", "action_arguments": {} - }, - "HideDatasetActionreport_html": { - "output_name": "report_html", - "action_type": "HideDatasetAction", - "action_arguments": {} } }, "label": null, @@ -268,10 +263,6 @@ "name": "annot", "description": "runtime parameter for tool Quast" }, - { - "name": "input", - "description": "runtime parameter for tool Quast" - }, { "name": "input_ref", "description": "runtime parameter for tool Quast" @@ -286,8 +277,8 @@ "type": "tool" }, "4": { - "tool_id": "toolshed.g2.bx.psu.edu/repos/public-health-bioinformatics/screen_abricate_report/screen_abricate_report/0.1.0", - "tool_version": "0.1.0", + "tool_id": "toolshed.g2.bx.psu.edu/repos/public-health-bioinformatics/screen_abricate_report/screen_abricate_report/0.4.0+galaxy0", + "tool_version": "0.4.0+galaxy0", "outputs": [ { "type": "tabular", @@ -296,17 +287,26 @@ { "type": "tabular", "name": "gene_detection_status" + }, + { + "type": "tabular", + "name": "output_screening_file" } ], "workflow_outputs": [ { "output_name": "gene_detection_status", - "uuid": "cd8ac0ac-0204-4e34-a0c7-db57e48a87bd", + "uuid": "4f09a150-7a8a-473c-b14e-785550da810c", + "label": null + }, + { + "output_name": "output_screening_file", + "uuid": "b0f2c40e-2e4e-48b0-a437-738618072702", "label": null }, { "output_name": "screened_report", - "uuid": "cc332d71-a8d1-4405-9c16-a5bd1998d935", + "uuid": "0c7ce13e-4a12-47cd-9832-edff13b0e84c", "label": null } ], @@ -316,15 +316,15 @@ "id": 2 } }, - "tool_state": "{\"__page__\": null, \"__rerun_remap_job_id__\": null, \"abricate_report\": \"{\\\"__class__\\\": \\\"RuntimeValue\\\"}\", \"screening_file\": \"{\\\"__class__\\\": \\\"RuntimeValue\\\"}\"}", + "tool_state": "{\"__page__\": null, \"min_coverage\": \"\\\"90.0\\\"\", \"screening_file_source\": \"{\\\"__current_case__\\\": 0, \\\"screening_file\\\": {\\\"__class__\\\": \\\"RuntimeValue\\\"}, \\\"screening_file_source_selector\\\": \\\"tool_data_table\\\"}\", \"abricate_report\": \"{\\\"__class__\\\": \\\"RuntimeValue\\\"}\", \"__rerun_remap_job_id__\": null, \"min_identity\": \"\\\"90.0\\\"\"}", "id": 4, "tool_shed_repository": { "owner": "public-health-bioinformatics", - "changeset_revision": "b2d56a44a872", + "changeset_revision": "22247b1a59d5", "name": "screen_abricate_report", "tool_shed": "toolshed.g2.bx.psu.edu" }, - "uuid": "93066c74-cee0-4184-90ff-9650e5b316f7", + "uuid": "d97fbdd9-52b2-42a2-b4b7-b0f111f6da3a", "errors": null, "name": "Screen Abricate Report", "post_job_actions": { @@ -341,25 +341,32 @@ "action_arguments": { "newname": "abricate_report_screened.tsv" } + }, + "RenameDatasetActionoutput_screening_file": { + "output_name": "output_screening_file", + "action_type": "RenameDatasetAction", + "action_arguments": { + "newname": "abricate_report_screening_file.tsv" + } } }, "label": null, "inputs": [ { - "name": "abricate_report", + "name": "screening_file_source", "description": "runtime parameter for tool Screen Abricate Report" }, { - "name": "screening_file", + "name": "abricate_report", "description": "runtime parameter for tool Screen Abricate Report" } ], "position": { - "top": 219.5, - "left": 848 + "top": 306.5, + "left": 870.5 }, "annotation": "", - "content_id": "toolshed.g2.bx.psu.edu/repos/public-health-bioinformatics/screen_abricate_report/screen_abricate_report/0.1.0", + "content_id": "toolshed.g2.bx.psu.edu/repos/public-health-bioinformatics/screen_abricate_report/screen_abricate_report/0.4.0+galaxy0", "type": "tool" } }, diff --git a/src/main/resources/workflows/0.2.0/messages_en.properties b/src/main/resources/workflows/0.2.0/messages_en.properties index 7f2b270..74d648a 100644 --- a/src/main/resources/workflows/0.2.0/messages_en.properties +++ b/src/main/resources/workflows/0.2.0/messages_en.properties @@ -6,21 +6,19 @@ pipeline.title.resistance-screen=Pipelines - Resistance-Screen workflow.RESISTANCE_SCREEN.description=Assemble reads with shovill, screen for genes with Abricate and apply filters to detect specific genes workflow.RESISTANCE_SCREEN.title=Resistance-Screen Pipeline workflow.label.share-analysis-samples.RESISTANCE_SCREEN=Save Results to Project Line List Metadata +dynamicsource.label.abricate_report_screening_files=Gene Screening File + #Tool Parameters - Tool: shovill - Workflow Step #: 1 #Wed Sep 25 16:34:00 PDT 2019 -pipeline.parameters.resistance-screen.shovill-1-assembler=Assembler to use -pipeline.parameters.resistance-screen.shovill-1-adv.nocorr=Disable post-assembly correction pipeline.parameters.resistance-screen.shovill-1-adv.gsize=Estimated genome size pipeline.parameters.resistance-screen.shovill-1-adv.minlen=Minimum contig length -pipeline.parameters.resistance-screen.shovill-1-adv.depth=Depth pipeline.parameters.resistance-screen.shovill-1-adv.mincov=Minimum contig coverage -pipeline.parameters.resistance-screen.shovill-1-adv.namefmt=Contig name format -pipeline.parameters.resistance-screen.shovill-1-adv.opts=Extra SPAdes options -pipeline.parameters.resistance-screen.shovill-1-trim=Trim reads #Tool Parameters - Tool: abricate - Workflow Step #: 2 #Wed Sep 25 16:34:00 PDT 2019 -pipeline.parameters.resistance-screen.abricate-2-adv.min_dna_id=Minimum DNA Identity -pipeline.parameters.resistance-screen.abricate-2-adv.db=Abricate DB {"card", "argannot", "ncbi", "resfinder"} +pipeline.parameters.resistance-screen.abricate-2-adv.min_dna_id=Resistance Genes: Minimum sequence identity for initial detection (0.0-100.0) #Tool Parameters - Tool: quast - Workflow Step #: 3 #Wed Sep 25 16:34:00 PDT 2019 -dynamicsource.label.abricate_report_screening_files=Screening File +#Tool Parameters - Tool: screen_abricate_report - Workflow Step #: 4 +#Thu Jan 02 15:11:41 PST 2020 +pipeline.parameters.resistance-screen.screen_abricate_report-4-min_coverage=Resistance Genes: Minimum percent coverage for secondary screening (0.0-100.0) +pipeline.parameters.resistance-screen.screen_abricate_report-4-min_identity=Resistance Genes: Minimum percent identity for secondary screening (0.0-100.0) \ No newline at end of file diff --git a/src/test/java/org/publichealthbioinformatics/irida/plugin/resistancescreen/ResistanceScreenPluginUpdaterTest.java b/src/test/java/org/publichealthbioinformatics/irida/plugin/resistancescreen/ResistanceScreenPluginUpdaterTest.java index 9f7ae85..7297b1c 100644 --- a/src/test/java/org/publichealthbioinformatics/irida/plugin/resistancescreen/ResistanceScreenPluginUpdaterTest.java +++ b/src/test/java/org/publichealthbioinformatics/irida/plugin/resistancescreen/ResistanceScreenPluginUpdaterTest.java @@ -32,8 +32,8 @@ public class ResistanceScreenPluginUpdaterTest { - private String WORKFLOW_NAME = "abricate-screen"; - private String WORKFLOW_VERSION = "0.1.0"; + private String WORKFLOW_NAME = "resistance-screen"; + private String WORKFLOW_VERSION = "0.2.0"; private ResistanceScreenPluginUpdater updater; @@ -64,11 +64,14 @@ public void setUp() throws IridaWorkflowException { @Test public void testUpdate() throws Throwable { ImmutableMap expectedResults = ImmutableMap.builder() - .put("abricate-screen/KPC/detected", "False") - .put("abricate-screen/NDM/detected", "True") - .put("abricate-screen/OXA/detected", "True") + .put("resistance-screen/KPC/detected", "False") + .put("resistance-screen/KPC/alleles", "") + .put("resistance-screen/NDM/detected", "False") + .put("resistance-screen/NDM/alleles", "") + .put("resistance-screen/OXA/detected", "True") + .put("resistance-screen/OXA/alleles", "OXA-9,OXA-48") .build(); - Path geneDetectionStatusFilePath = Paths.get(ClassLoader.getSystemResource("gene_detection_status.tsv").toURI()); + Path geneDetectionStatusFilePath = Paths.get(ClassLoader.getSystemResource("SAMN11840203-gene_detection_status.tsv").toURI()); AnalysisOutputFile geneDetectionStatusFile = new AnalysisOutputFile(geneDetectionStatusFilePath, null, null, null); Analysis analysis = new Analysis(null, ImmutableMap.of("gene_detection_status", geneDetectionStatusFile), null, null); @@ -116,12 +119,15 @@ public void testUpdate() throws Throwable { @Test public void testParseGeneDetectionStatusFile() throws Throwable { - Path geneDetectionStatusFilePath = Paths.get(ClassLoader.getSystemResource("gene_detection_status.tsv").toURI()); - List> geneDetectionStatuses = updater.parseGeneDetectionStatusFile(geneDetectionStatusFilePath); - for (Map geneDetectionStatus : geneDetectionStatuses) { - assertThat(geneDetectionStatus, IsMapContaining.hasKey("gene_name")); - assertThat(geneDetectionStatus, IsMapContaining.hasKey("detected")); + ArrayList sampleIds = new ArrayList<>(Arrays.asList("SAMN11840202", "SAMN11840203")); + for(String sampleId:sampleIds) { + Path geneDetectionStatusFilePath = Paths.get(ClassLoader.getSystemResource(sampleId + "-gene_detection_status.tsv").toURI()); + List> geneDetectionStatuses = updater.parseGeneDetectionStatusFile(geneDetectionStatusFilePath); + for (Map geneDetectionStatus : geneDetectionStatuses) { + assertThat(geneDetectionStatus, IsMapContaining.hasKey("gene_name")); + assertThat(geneDetectionStatus, IsMapContaining.hasKey("detected")); + assertThat(geneDetectionStatus, IsMapContaining.hasKey("alleles")); + } } - } } \ No newline at end of file diff --git a/src/test/resources/SAMN11840202-gene_detection_status.tsv b/src/test/resources/SAMN11840202-gene_detection_status.tsv new file mode 100644 index 0000000..c323623 --- /dev/null +++ b/src/test/resources/SAMN11840202-gene_detection_status.tsv @@ -0,0 +1,4 @@ +gene_name detected alleles +KPC False +NDM True NDM-5 +OXA True OXA-1 diff --git a/src/test/resources/SAMN11840203-gene_detection_status.tsv b/src/test/resources/SAMN11840203-gene_detection_status.tsv new file mode 100644 index 0000000..2c4c553 --- /dev/null +++ b/src/test/resources/SAMN11840203-gene_detection_status.tsv @@ -0,0 +1,4 @@ +gene_name detected alleles +KPC False +NDM False +OXA True OXA-9,OXA-48