diff plates_generator.xml @ 3:bd72cb677e4e draft

planemo upload for repository https://github.com/brsynth/icfree-ml commit b655805cb031443000d1da309287481d7a1dd823-dirty
author tduigou
date Wed, 24 Jul 2024 08:18:58 +0000
parents 5735a13c1f5b
children 37ba98019165
line wrap: on
line diff
--- a/plates_generator.xml	Wed Feb 14 15:25:58 2024 +0000
+++ b/plates_generator.xml	Wed Jul 24 08:18:58 2024 +0000
@@ -1,152 +1,117 @@
-<tool id="icfree_plates_generator" name="iCFree plates generator" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" license="@LICENCE@">
-    <description>Generates a list of Echo-compatible source and destination plates according a set of samples to test</description>
+<tool id="icfree_plates_generator" name="iCFree plates designer" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" license="@LICENCE@">
+    <description>Prepare source and destination well-plate mappings with advanced options.</description>
     <macros>
         <import>macros.xml</import>
     </macros>
     <expand macro="requirements"/>
     <expand macro="stdio"/>
     <command detect_errors="exit_code"><![CDATA[
-        #set factors = []
+        #set well_capacity = []
+        #set dead_volumes = []
         #for $x in $adv.rep
-            #silent factors.append(str($x.optimize_well_volumes))
+            #silent well_capacity.append(str($x.component_name) + "=" + str($x.well_capacity))
+            #silent dead_volumes.append(str($x.component_name) + "=" + str($x.dead_volumes))
         #end for
-        #set sfactors = ' '.join(['"' + $x + '"' for $x in $factors])
-        python -m icfree.plates_generator
-            '$cfps_file'
-            '$volume_file'
-            --sample_volume '$adv.sample_volume'
-            --source_plate_dead_volume '$adv.source_plate_dead_volume'
-            --dest_plate_dead_volume '$adv.dest_plate_dead_volume'
-            --dest-starting_well '$adv.dest_starting_well'
-            --src-starting_well '$adv.src_starting_well'
-            --nplicate '$adv.nplicate'
-            --keep-nil-vol '$adv.keep_nil_vol'
-            --source_plate_well_capacity '$adv.source_plate_well_capacity'
-            --dest_plate_well_capacity '$adv.dest_plate_well_capacity'
-            #if len(factors) > 0
-                --optimize-well-volumes ${sfactors}
+        #set swell_capacity = ','.join($well_capacity)
+        #set sdead_volumes = ','.join($dead_volumes)
+
+        python -m icfree.plate_designer
+            '$sampling_file'
+            '$sample_volume'
+            --start_well_src_plt '$adv.start_well_src_plt'
+            --start_well_dst_plt '$adv.start_well_dst_plt'
+            --plate_dims '$adv.plate_dims'
+            #if len($well_capacity) > 0
+                --well_capacity '$swell_capacity'
             #end if
-            --plate-dimensions '$adv.plate_dimensions'
-            --output-folder '.'
-            --output-format 'tsv' &&
-            mv volumes_summary.tsv '$volumes_summary'
-    ]]></command>
+            --default_well_capacity '$adv.default_well_capacity'
+            #if len($dead_volumes) > 0
+                --dead_volumes '$sdead_volumes'
+            #end if
+            --default_dead_volume '$adv.default_dead_volume'
+            --num_replicates '$adv.num_replicates' &&
+        mv source_plate.csv '$output_source_plate' &&
+        mv destination_plate.csv '$output_destination_plate'
+           ]]></command>
     <inputs>
-        <param name="cfps_file" type="data" format="tabular"  label="CFPS parameters and features" />
-        <param name="volume_file" type="data" format="tabular" label="Volumes" />
-
+        <param name="sampling_file" type="data" format="csv" label="Sampling file" />
+        <param name="sample_volume" type="integer" optional="false" label="Wanted sample volume in the destination plate" />
         <section name="adv" title="Advanced Options" expanded="false">
-
-            <param name="sample_volume" type="integer" value="1000" label="Final sample volume in each well in nL" />
-            <param name="source_plate_dead_volume" type="integer" value="15000" label="Dead volume to add in the source plate in nL"/>
-            <param name="dest_plate_dead_volume" type="integer" value="15000" label="Dead volume to add in the destination plate in nL"/>
-
-            <param name="dest_starting_well" type="text" value="A1" label="Starter well of destination plate to begin filling the 384 well-plate">
+            <param name="start_well_src_plt" type="text" value="A1" label="Starting well for the source plate">
                 <validator type="empty_field" message="Not empty"/>
                 <validator type="regex" message="Some letters followed by a number">^(?:[A-K]{1}([1-9]|1[0-2]))$</validator>
             </param>
-            <param name="src_starting_well" type="text" value="A1" label="Starter well of source plate to begin filling the 384 well-plate">
+            <param name="start_well_dst_plt" type="text" value="A1" label="Starting well for the destination plate">
                 <validator type="empty_field" message="Not empty"/>
                 <validator type="regex" message="Some letters followed by a number">^(?:[A-K]{1}([1-9]|1[0-2]))$</validator>
             </param>
-
-            <param name="nplicate" type="integer" value="3" min="1" max="12" label="Numbers of copies of volume sets"/>
-            <param name="keep_nil_vol" type="boolean" truevalue="True" falsevalue="False" checked="true" display="checkboxes" label="Keep nil volumes in instructions or not"/>
-
-            <param name="source_plate_well_capacity" type="integer" value="60000" label="Maximum volume capacity of the source plate in nL" />
-            <param name="dest_plate_well_capacity" type="integer" value="60000" label="Maximum volume capacity of the dest plate in nL" />
-            <param name="plate_dimensions" type="text" value="16x24" label="Dimensions of plate separated by a 'x'">
+            <param name="plate_dims" type="text" value="16x24" label="Plate dimensions (Format: NxM)">
                 <validator type="empty_field" message="Not empty"/>
                 <validator type="regex" message="An 'x' separator is expected">^(?:\d+x\d+)$</validator>
             </param>
-            <repeat name="rep" title="Optimize well volumes" min="0">
-                <param name="optimize_well_volumes" type="text" value="" label="Save volumes in source plate for all factors">
+            <param name="default_well_capacity" type="integer" value="60000" min="1" max="250000" label="Default well capacity in nL for components not specified in well_capacity" />
+            <param name="default_dead_volume" type="integer" value="15000" min="1" max="250000" label="Default dead volume in nL for the source plate"/>
+            <param name="num_replicates" type="integer" value="1" min="1" max="10" label="Number of wanted replicates"/>
+            <repeat name="rep" title="Specific components">
+                <param name="component_name" type="text" value="" label="Component Name">
                     <validator type="empty_field" message="Not empty"/>
                 </param>
+                <param name="well_capacity" type="integer" value="60000" min="1" max="250000" label="Well capacity" />
+                <param name="dead_volumes" type="integer" value="15000" min="1" max="250000" label="Dead volumes" />
             </repeat>
-
         </section>
     </inputs>
     <outputs>
-        <data name="volumes_summary" format="tabular" label="${tool.name} - Volumes" />
-        <collection name="output_source_dest" type="list" label="${tool.name} - Source Destination Plate">
-            <discover_datasets pattern="(?P&lt;name&gt;source_plate_\d+\.json)$" format="json" />
-            <discover_datasets pattern="(?P&lt;name&gt;source_plate_\d+\.tsv)$" format="tabular" />
-            <discover_datasets pattern="(?P&lt;name&gt;destination_plate_\d+\.json)$" format="json" />
-            <discover_datasets pattern="(?P&lt;name&gt;destination_plate_\d+\.tsv)$" format="tabular" />
-        </collection>
+        <data name="output_source_plate" format="csv" label="${tool.name} - Source" />
+        <data name="output_destination_plate" format="csv" label="${tool.name} - Destination" />
     </outputs>
     <tests>
-        <!-- test 1: check if identical outputs are produced with default parameters  -->
+        <test>
+            <!-- python -m icfree.plate_designer sampling.test-1.csv 6000 -default_well_capacity 60000 -default_dead_volume 20000 -num_replicates 1 -->
+            <param name="sampling_file" value="sampling.test-1.csv" />
+            <param name="sample_volume" value="6000" />
+            <param name="default_well_capacity" value="60000" />
+            <param name="default_dead_volume" value="20000" />
+            <param name="num_replicates" value="1" />
+            <output name="output_source_plate" file="plates_designer.source_plate.test-1.csv" ftype="csv" compare="diff" />
+            <output name="output_destination_plate" file="plates_designer.destination_plate.test-1.csv" ftype="csv" compare="diff" />
+        </test>
         <test>
-            <param name="cfps_file" value="converter_proCFPS_parameters.tsv" />
-            <param name="volume_file" value="converter_sampling_concentrations.tsv" />
-            <output name="volumes_summary" file="plates_generator_volumes_summary.test-1.tsv" ftype="tabular" compare="diff" />
-            <output_collection name="output_source_dest" type="list" count="4">
-                <element name="source_plate_1.json" ftype="json">
-                    <assert_contents>
-                        <has_n_lines n="26"/>
-                    </assert_contents>
-                </element>
-                <element name="source_plate_1.tsv" file="plates_generator_source_plate_1.test-1.tsv" ftype="tabular" compare="diff" />
-                <element name="destination_plate_1.json" ftype="json">
-                    <assert_contents>
-                        <has_n_lines n="26"/>
-                    </assert_contents>
-                </element>
-                <element name="destination_plate_1.tsv" file="plates_generator_destination_plate_1.test-1.tsv" ftype="tabular" compare="diff" />
-            </output_collection>
-        </test>
-        <!-- test 2: advance arguments -->
-        <test>
-            <param name="cfps_file" value="converter_proCFPS_parameters.tsv" />
-            <param name="volume_file" value="converter_sampling_concentrations.tsv" />
-            <param name="source_plate_dead_volume" value="1500" />
-            <param name="dest_plate_dead_volume" value="1000" />
-            <param name="dest_starting_well" value="C3" />
-            <param name="src_starting_well" value="A2" />
-            <param name="nplicate" value="2" />
-            <param name="keep_nil_vol" value="False" />
-            <param name="plate_dimensions" value="32x32" />
+            <!-- python -m icfree.plate_designer sampling.test-1.csv '5000' -start_well_src_plt 'A1' -start_well_dst_plt 'A1' -plate_dims '16x24' -well_capacity 'Hela lysate=3000,Access prot 50X=4000,Reaction mix=3000,RNA 1ug/uL=2000' -default_well_capacity '60000' -dead_volumes 'Hela lysate=30,Access prot 50X=5,Reaction mix=10,RNA 1ug/uL=20' -default_dead_volume '20000' -num_replicates '2' -->
+            <param name="sampling_file" value="sampling.test-1.csv" />
+            <param name="sample_volume" value="5000" />
+            <param name="default_well_capacity" value="60000" />
+            <param name="default_dead_volume" value="20000" />
+            <param name="num_replicates" value="2" />
             <repeat name="rep">
-                <param name="optimize_well_volumes" value="RBS" />
+                <param name="component_name" value="Hela lysate" />
+                <param name="well_capacity" value="3000" />
+                <param name="dead_volumes" value="30" />
             </repeat>
             <repeat name="rep">
-                <param name="optimize_well_volumes" value="Promoter" />
+                <param name="component_name" value="Access prot 50%" />
+                <param name="well_capacity" value="4000" />
+                <param name="dead_volumes" value="5" />
             </repeat>
-            <output_collection name="output_source_dest" type="list" count="4">
-                <element name="destination_plate_1.tsv" file="plates_generator_destination_plate_1.test-2.tsv" ftype="tabular" compare="diff" />
-            </output_collection>
+            <repeat name="rep">
+                <param name="component_name" value="Reaction mix" />
+                <param name="well_capacity" value="3000" />
+                <param name="dead_volumes" value="10" />
+            </repeat>
+            <repeat name="rep">
+                <param name="component_name" value="RNA 1ug/uL" />
+                <param name="well_capacity" value="2000" />
+                <param name="dead_volumes" value="20" />
+            </repeat>
+            <output name="output_source_plate" file="plates_designer.source_plate.test-2.csv" ftype="csv" compare="diff" />
+            <output name="output_destination_plate" file="plates_designer.destination_plate.test-2.csv" ftype="csv" compare="diff" />
         </test>
     </tests>
     <help><![CDATA[
 Plates Generator
 ================
 
-This module generates a list of source and destination plates according to the set of samples to test.
-
-Input
------
-* **CFPS Parameters File**: The first column is the parameter (or factor) names. The second column is the maxValue of the parameter that will be used in the sampling. The third column is the concnetration of the stock. The fourth column is the deadVolume of the parameter. This is used to calculate the volume of the parameter that will not be pipetted by the robot (because of viscosity). The fifth column is the specific ratios we want to have for this parameter. If nothing defined, then take ratios given in program options. If one single number is given, then take this number as a const value.
-* Volume File**: File containing volumes
-
-Advanced Options:
------------------
-* **Sample Volume**: Final sample volume in each well in nL (default: 10000)
-* **Source Plate Dead Volume**: dead volume to add in the source plate in nL (default: 15000)
-* **Destination Plate Dead Volume**: dead volume to add in the dest plate in nL (default: 15000)
-* **Destination Starting Well**: starter well of destination plate to begin filling the 384 well-plate. (default: A1)
-* **Source Starting Well**: starter well of source plate to begin filling the 384 well-plate. (default: A1)
-* **Number of replicate**: Numbers of copies of volume sets (default: 3)
-* **Keep nil volumes**: Keep nil volumes in instructions or not (default: yes)
-* **Source Plate Well Capacity**: Maximum volume capacity of the source plate in nL (default: 60000)
-* **Destiantion Plate Well Capacity**: Maximum volume capacity of the dest plate in nL (default: 60000)
-* **Optimize Well Volumes**: Save volumes in source plate for all factors. It may trigger more volume pipetting warnings. If list of factors is given (separated by blanks), save: only for these ones (default: []).
-* **Plate Dimensions**: Dimensions of plate separated by a 'x', e.g. nb_rows x nb_cols (default: 16x24).
-
-Output
-------
-* **Collection**: Collection of files describing source/destination plates/wells
+Prepare source and destination well-plate mappings with advanced options.
     ]]></help>
     <expand macro="creator"/>
     <expand macro="citation"/>