# HG changeset patch
# User greg
# Date 1682963525 0
# Node ID 487a3c0088120e939fe8f88263abc5ef8fd9b346
# Parent  c5e80637cf3df8ee99c78be82dd3d3283bc49d2a
Uploaded

diff -r c5e80637cf3d -r 487a3c008812 draw_amr_matrix.py
--- a/draw_amr_matrix.py	Tue Mar 28 13:42:30 2023 +0000
+++ b/draw_amr_matrix.py	Mon May 01 17:52:05 2023 +0000
@@ -58,7 +58,7 @@
     sys.exit(1)
 
 
-def draw_amr_matrix(amr_feature_hits_files, amr_deletions_file, varscan_vcf_file, amr_mutation_regions_bed_file, amr_gene_drug_file, reference, reference_size, mutation_regions_dir, amr_matrix_png_dir, errors, in_test_mode):
+def draw_amr_matrix(amr_feature_hits_files, amr_deletions_file, varscan_vcf_file, amr_mutation_regions_bed_file, amr_gene_drug_file, reference, reference_size, mutation_regions_dir, amr_matrix_png_dir, errors):
     efh = open(errors, 'w')
     ofh = open('process_log', 'w')
 
@@ -192,16 +192,12 @@
             ofh.write("\nAfter processing deletions, amr_to_draw: %s\n" % str(amr_to_draw))
 
         ofh.write("\namr_to_draw.shape[0]: %s\n" % str(amr_to_draw.shape[0]))
-        # I have no idea why, but when running functional test with planemo
+        # I have no idea why, but when running functional tests with planemo
         # the value of amr_to_draw.shape[0] is 1 even though the tests use the
         # exact inputs when running outside of planeo that result in the value
-        # being 2.  So we have to pass this in_test_mode flag in order to get
-        # functional tests to work.
-        if in_test_mode == 'true':
-            shape_val = 0
-        else:
-            shape_val = 1
-        if amr_to_draw.shape[0] > shape_val:
+        # being 2.  So we cannot test with planemo unless we incorporate a hack
+        # like a hidden in_test_mode parameter.
+        if amr_to_draw.shape[0] > 1:
             ofh.write("\nDrawing AMR matrix...\n")
             present_genes = amr_to_draw['gene'].unique()
             present_drugs = amr_to_draw['drug'].unique()
diff -r c5e80637cf3d -r 487a3c008812 draw_amr_matrix.xml
--- a/draw_amr_matrix.xml	Tue Mar 28 13:42:30 2023 +0000
+++ b/draw_amr_matrix.xml	Mon May 01 17:52:05 2023 +0000
@@ -39,7 +39,6 @@
 --reference_genome reference.fa
 --amr_matrix_png_dir 'amr_matrix_png_dir'
 --errors '$errors'
---in_test_mode '$in_test_mode'
 #if str($output_process_log) == 'yes':
     && mv 'process_log' '$process_log'
 #end if
@@ -71,7 +70,6 @@
             <option value="no" selected="true">No</option>
             <option value="yes">Yes</option>
         </param>
-        <param name="in_test_mode" type="hidden" value="false"/>
     </inputs>
     <outputs>
         <data name="process_log" format="txt" label="${tool.name} on ${on_string} (process log)">
@@ -98,7 +96,6 @@
             <param name="varscan_vcf_file" value="varscan.vcf" ftype="vcf"/>
             <param name="amr_mutation_regions_bed_file" value="amr_mutation_regions.bed" ftype="bed"/>
             <param name="amr_gene_drug_file" value="amr_gene_drug.tsv" ftype="tsv"/>
-            <param name="in_test_mode" value="true"/>
             <output_collection name="amr_matrix_png" type="list" count="1">
                 <element name="amr_matrix" ftype="png">
                     <assert_contents>