Skip to content

Commit

Permalink
Icfree, update to icfree-ml (#187)
Browse files Browse the repository at this point in the history
* feat(tools): icfree-ml, update  to

* tests(tools): icfree, rm tests

* tests(tools): icfree, update test

* feat(tools): icfree, update to 2.4.0

* feat(tools): icfree, update to 2.4.0

* fix(tools): icfree, mv test files

* fix(tools): icfree, mv test files

* fix(tools): icfree, misc
  • Loading branch information
guillaume-gricourt authored Jul 23, 2024
1 parent 79f2712 commit 7640e21
Show file tree
Hide file tree
Showing 29 changed files with 367 additions and 2,636 deletions.
61 changes: 0 additions & 61 deletions tools/icfree/converter.xml

This file was deleted.

124 changes: 47 additions & 77 deletions tools/icfree/instructor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,97 +6,67 @@
<expand macro="requirements"/>
<expand macro="stdio"/>
<command detect_errors="exit_code"><![CDATA[
#set sps = []
#set sws = []
#set dps = []
#set dws = []
#for $x in $plates_generator:
#set $fname = str($x.element_identifier)
echo "$fname " &&
ln -sfn '$x' '$fname' &&
#if $fname.startswith('source') and $fname.endswith('json'):
#silent sps.append($fname)
#else if $fname.startswith('source') and $fname.endswith('tsv'):
#silent sws.append($fname)
#else if $fname.startswith('destination') and $fname.endswith('json'):
#silent dps.append($fname)
#else if $fname.startswith('destination') and $fname.endswith('tsv'):
#silent dws.append($fname)
#end if
#end for
#set s_sps = '" "'.join($sps)
#set s_sws = '" "'.join($sws)
#set s_dps = '" "'.join($dps)
#set s_dws = '" "'.join($dws)
python -m icfree.instructor
--source_plates $s_sps
--source_wells $s_sws
--dest_plates $s_dps
--dest_wells $s_dws
-spt '$source_plate'
--robot '$robot'
--output-folder '.' &&
mv instructions.csv '$output_instruction' &&
#if not os.path.isfile('volumes_warnings.tsv')
touch volumes_warnings.tsv &&
#end if
mv volumes_warnings.tsv '$output_warning'
'$source_plate_file'
'$destination_plate_file'
'instructor.csv'
--source_plate_type '$source_plate_type'
--max_transfer_volume '$max_transfer_volume'
#if str($adv.split_threshold) != ''
--split_threshold '$split_threshold'
#end if
#if str($adv.split_components) != ''
--split_components '$split_components'
#end if
]]></command>
<inputs>
<param name="plates_generator" type="data_collection" collection_type="list" format="json,tabular" label="Source/Destination corresponding to plate/wells" help="Output from iCFree plates generator"/>
<param name="robot" type="select" label="Robot name">
<option value="ECHO" selected="true">ECHO</option>
</param>
<param name="source_plate" type="select" label="Source plate type">
<option value="384PP_AQ_GP3" selected="true">384PP_AQ_GP3</option>
<option value="384_AQ_CP">384_AQ_CP</option>
</param>
<param name="source_plate_file" type="data" format="csv" label="Source corresponding to plate/wells" help="Output from iCFree plates designer"/>
<param name="destination_plate_file" type="data" format="csv" label="Destination corresponding to plate/wells" help="Output from iCFree plates designer"/>
<section name="adv" title="Advanced Options" expanded="false">
<param name="source_plate_type" type="text" value="default:384PP_AQ_GP3" label="Source plate type" help="Comma-separated list of component and plate type pairs, e.g., 'Component_1:384PP_AQ_CP,Component_2:384PP_AQ_GP3'. Default for all is default:384PP_AQ_GP3." >
<validator type="empty_field" message="Source plate type is required"/>
</param>
<param argument="max_transfer_volume" type="integer" min="1" max="50000" value="500" label="Maximum transfer volume" help="Maximum volume for a single transfer. If not specified, no splitting will be performed." />
<param argument="split_threshold" type="integer" min="1" max="50000" value="500" label="Split threshold" help="Volume threshold above which transfers need to be split. If not specified, no splitting will be performed." />
<param name="split_components" type="text" optional="true" label="Split components" help="Comma-separated list of component names to create separate files for." >
</param>
</section>
</inputs>
<outputs>
<data name="output_warning" format="tabular" label="${tool.name} - Warning" />
<data name="output_instruction" format="csv" label="${tool.name} - Instruction" />
<collection name="output_instructor" type="list" label="${tool.name} - Instructor">
<discover_datasets pattern="__designation_and_ext__" format="csv" directory="."/>
</collection>
</outputs>
<tests>
<test>
<!-- test 1: check if identical outputs are produced with default parameters -->
<param name="plates_generator">
<collection type="list">
<element name="source_plate_1.json" value="plates_generator_source_plate_1.test-1.json" />
<element name="source_plate_1.tsv" value="plates_generator_source_plate_1.test-1.tsv" />
<element name="destination_plate_1.json" value="plates_generator_destination_plate_1.test-1.json" />
<element name="destination_plate_1.tsv" value="plates_generator_destination_plate_1.test-1.tsv" />
</collection>
</param>
<output name="output_warning" ftype="tabular">
<assert_contents>
<has_n_lines n="12"/>
<has_line_matching expression="^Parameter\tMin\tMax\tPlate$"/>
</assert_contents>
</output>
<output name="output_instruction" file="instructor_instructions.csv" ftype="csv" compare="diff" />
<!-- python -m icfree.instructor plates_designer.source_plate.test-2.csv plates_designer.destination_plate.test-2.csv 'instructor.test-1.csv' -source_plate_type 'default:384PP_AQ_GP3' -max_transfer_volume '500' -split_threshold '500' -->
<param name="source_plate_file" value="plates_designer.source_plate.test-2.csv" />
<param name="destination_plate_file" value="plates_designer.destination_plate.test-2.csv" />
<output_collection name="output_instructor" type="list" count="1">
<element name="instructor" file="instructor.test-1.csv" ftype="csv" compare="diff" />
</output_collection>
</test>
<test>
<!-- python -m icfree.instructor plates_designer.source_plate.test-2.csv plates_designer.destination_plate.test-2.csv 'instructor.csv' -source_plate_type 'Hela lysate:384PP_AQ_CP,Access prot 50X:384PP_AQ_GP3,Reaction mix:384PP_AQ_GP3,RNA 1ug/uL:384PP_AQ_GP3' -max_transfer_volume '500' -split_threshold '500' -split_components 'Hela lysate,Access prot 50X' -->
<param name="source_plate_file" value="plates_designer.source_plate.test-2.csv" />
<param name="destination_plate_file" value="plates_designer.destination_plate.test-2.csv" />
<param name="source_plate_type" value="Hela lysate:384PP_AQ_CP,Access prot 50%:384PP_AQ_GP3,Reaction mix:384PP_AQ_GP3,RNA 1ug/uL:384PP_AQ_GP3" />
<param name="split_components" value="Hela lysate,Access prot 50%" />
<output_collection name="output_instructor" type="list" count="3">
<element name="instructor" file="instructor.test-2.csv" ftype="csv" compare="diff" />
<element name="instructor_Hela lysate" file="instructor.hela.test-2.csv" ftype="csv" compare="diff" />
<!--
<element name="instructor_Access prot 50X" file="instructor.access.test-2.csv" ftype="csv" compare="diff" />
-->
</output_collection>
</test>
</tests>
<help><![CDATA[
Instructor
==========
The module generates a list of instructions for handling the generated plates.
The module generates a list of instructions to perform the experiment.
Input
-----
Required:
* **A collection**: a collection with source/destination plates/wells, coming from iCFree plates generator tool.
Advanced options:
-----------------
* **Robot name**: name of the robot to generate instructions for (default: "ECHO")
* **Source plate type**: type of plate used (default: "384PP_AQ_GP3")
Output
------
* **instructions**: contains the instructions to perform the experiment
* **volumes_warning**: contains the volumes that may cause issues with the chosen robot
]]></help>
]]></help>
<expand macro="creator"/>
<expand macro="citation"/>
</tool>
4 changes: 2 additions & 2 deletions tools/icfree/macros.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<macros>
<token name="@TOOL_VERSION@">2.1.2</token>
<token name="@TOOL_VERSION@">2.4.0</token>
<token name="@VERSION_SUFFIX@">0</token>
<token name="@LICENSE@">MIT</token>
<xml name="requirements">
<requirements>
<requirement type="package" version="@TOOL_VERSION@">icfree</requirement>
<requirement type="package" version="@TOOL_VERSION@">icfree-ml</requirement>
<yield/>
</requirements>
</xml>
Expand Down
118 changes: 118 additions & 0 deletions tools/icfree/plates_designer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<tool id="icfree_plates_designer" 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 well_capacity = []
#set dead_volumes = []
#for $x in $adv.rep
#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 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
--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="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="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="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="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>
<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="output_source_plate" format="csv" label="${tool.name} - Source" />
<data name="output_destination_plate" format="csv" label="${tool.name} - Destination" />
</outputs>
<tests>
<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>
<!-- 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="component_name" value="Hela lysate" />
<param name="well_capacity" value="3000" />
<param name="dead_volumes" value="30" />
</repeat>
<repeat name="rep">
<param name="component_name" value="Access prot 50%" />
<param name="well_capacity" value="4000" />
<param name="dead_volumes" value="5" />
</repeat>
<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
================
Prepare source and destination well-plate mappings with advanced options.
]]></help>
<expand macro="creator"/>
<expand macro="citation"/>
</tool>
Loading

0 comments on commit 7640e21

Please sign in to comment.