Mercurial > repos > crs4 > vl_import_biosample
changeset 0:c3f0da6c9ea1 draft default tip
planemo upload
author | crs4 |
---|---|
date | Fri, 16 Sep 2016 08:24:58 -0400 |
parents | |
children | |
files | biosample.xml importer.py |
diffstat | 2 files changed, 254 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/biosample.xml Fri Sep 16 08:24:58 2016 -0400 @@ -0,0 +1,247 @@ +<tool id="vl_import_biosample" name="VLI.biosample"> + <description>import BioSample definitions within omero/vl</description> + <command interpreter="python"> + #if $__app__.config.vl_import_enabled_users.split(',').count($__user_email__)==1 #importer.py + #else #unauthorized_access.py + #end if + #if $advanced_configuration.configuration_level == 'advanced' + --host=$advanced_configuration.vl_host + --user=$advanced_configuration.vl_user + --passwd=$advanced_configuration.vl_passwd + #end if + --operator=galaxy + --ifile=${input} + --ofile=${output} + --report_file=${report} + --loglevel=$__app__.config.vl_loglevel + --logfile=${logfile} + #if $blocking_validation + --blocking-validator + #end if + biosample + #if str($study) != 'use_provided' + --study ${study} + #end if + #if str($source_type) != 'use_provided' + --source-type ${source_type} + #end if + #if str($vessel_type_selector.vessel_type) != 'use_provided' + --vessel-type ${vessel_type_selector.vessel_type} + #end if + #if str($vessel_content) != 'use_provided' + --vessel-content=${vessel_content} + #end if + #if str($vessel_status) != 'use_provided' + --vessel-status=${vessel_status} + #end if + #if str($vessel_type_selector) == 'IlluminaBeadChipArray' + #if str($vessel_type_selector.assay_type) != 'use_provided' + --bead-chip-assay-type=${vessel_type_selector.assay_type} + #end if + #end if + </command> + + <inputs> + <param format="tabular" name="input" type="data" + label="A tabular dataset with the following columns ..."/> + + <param name="study" type="select" label="Context study" + help="Choose from the already defined studies. See below."> + <options from_parameter="tool.app.known_studies" + transform_lines="[ "%s%s%s:%s" + % ( l[0], self.separator, l[0], l[1][:40] ) + for l in obj ]"> + <column name="value" index="0"/> + <column name="name" index="1"/> + <filter type="sort_by" column="0"/> + <filter type="add_value" name="Records provide study labels" + value="use_provided" index="0"/> + </options> + </param> + + <param name="source_type" type="select" + label="type of the source object" + help="Choose from the legal types. See below."> + <option value="use_provided" selected="true"> + Use what provided by record</option> + <option value="Tube">Tube</option> + <option value="PlateWell">PlateWell</option> + <option value="Individual">Individual</option> + <option value="NO_SOURCE">No source provided</option> + </param> + + <conditional name="vessel_type_selector"> + <param name="vessel_type" type="select" + label="type of the vessel object" + help="Choose from the legal types. See below."> + <option value="use_provided" selected="true"> + Use what provided by record + </option> + <option value="Tube">Tube</option> + <option value="PlateWell">PlateWell</option> + <option value="IlluminaBeadChipArray">IlluminaBeadChipArray</option> + </param> + <when value="IlluminaBeadChipArray"> + <param name="assay_type" type="select" label="Illumina Bead Chip Array Assay type" + help="Choose from the following assay types"> + <options from_parameter="tool.app.known_illumina_beadchip_assay_type" + transform_lines="[ "%s%s%s" + % (o[1], self.separator, o[1]) + for o in obj ]"> + <column name="value" index="0"/> + <column name="name" index="1"/> + <filter type="sort_by" column="0"/> + <filter type="add_value" name="Records provide assay type" + value="use_provided" index="0"/> + </options> + </param> + </when> + </conditional> + + <param name="vessel_content" type="select" label="Vessel content" + help="Choose from one of the available values. See below."> + <options from_parameter="tool.app.kb.VesselContent.__enums__" + transform_lines="[ "%s%s%s" + % (e.enum_label(), + self.separator, + e.enum_label()) + for e in obj ]"> + <column name="value" index="0"/> + <column name="name" index="1"/> + <filter type="sort_by" column="0"/> + <filter type="add_value" name="Records provide vessel content" + value="use_provided" index="0"/> + </options> + </param> + <param name="vessel_status" type="select" label="Vessel status" + help="Choose from one of the available values. See below."> + <options from_parameter="tool.app.kb.VesselStatus.__enums__" + transform_lines="[ "%s%s%s" + % (e.enum_label(), + self.separator, + e.enum_label()) + for e in obj ]"> + <column name="value" index="0"/> + <column name="name" index="1"/> + <filter type="sort_by" column="0"/> + <filter type="add_value" name="Records provide vessel status" + value="use_provided" index="0"/> + </options> + </param> + + <conditional name="extra_fields"> + <param name="enabled" type="select" + label="Enable extra optional fields"> + <option value="no" selected="true">no</option> + <option value="yes">yes</option> + </param> + <when value="no"/> + <when value="yes"> + <param name="current_volume" type="float" + value="20" + help="fluid (FIXME UNITS) currently held in the vessel"> + <validator type="in_range" message="Volume must be positive" + min="0" max="inf"/> + </param> + <param name="used_volume" type="float" + value="20" + help="amount of source fluid (FIXME UNITS) used"> + <validator type="in_range" message="Volume must be positive" + min="0" max="inf"/> + </param> + </when> + </conditional> + + <!-- ************************************************** --> + <param name="blocking_validation" type="boolean" checked="false" + label="Blocking validation" + help="When this check is enabled, if at least one record doesn't pass importer's validation, the entire import procedure will be blocked"/> + + <conditional name="wait_for_trigger"> + <param name="enable_trigger" type="boolean" checked="false" + label="Wait for another tool to end before running this tool"/> + <when value="true"> + <param format="txt" name="trigger_file" type="data" + label="Select the LOG file that will be used as trigger"/> + </when> + </conditional> + + <conditional name="advanced_configuration"> + <param name="configuration_level" type="select" + label="Configuration level"> + <option value="default" selected="true">Default configuration</option> + <option value="advanced">Advanced configuration</option> + </param> + <when value="default"/> + <when value="advanced"> + <param name="vl_host" size="40" type="text" value="localhost" + label="Omero/VL host"/> + <param name="vl_user" size="20" type="text" value="root" + label="Omero/VL user"/> + <param name="vl_passwd" size="20" type="text" value="What? Me_worry?" + label="Omero/VL passwd"/> + </when> + </conditional> + </inputs> + + <outputs> + <data format="tabular" name="output" label="${tool.name}.mapping"/> + <data format="tabular" name="report" label="${tool.name}.report"/> + <data format="txt" name="logfile" label="${tool.name}.logfile"/> + </outputs> + + <help> +A biosample record will have, at least, the following fields:: + + label source + I001-bs-2 V932814892 + I002-bs-2 V932814892 + I003-bs-2 None + +Where label is the label of the biosample container. If a 'None' value +has been passed in the source column, the biosample will be imported +as a new unlinked object into the biobanks. Another example, this time +involving DNA samples:: + + label source used_volume current_volume activation_date + I001-dna V932814899 0.3 0.2 17/03/2007 + I002-dna V932814900 0.22 0.2 21/01/2004 + +A special case is when records refer to biosamples contained in plate +wells. In this case, an additional column must be present with the VID +of the corresponding TiterPlate object. For instance:: + + plate label source + V39030 A01 V932814892 + V39031 A02 V932814893 + V39032 A03 V932814894 + +where the label column is now the label of the well position. + +If row and column (optional) are provided, the program will use them; +if they are not provided, it will infer them from label (e.g., J01 -> +row=10, column=1). Missing labels will be generated as:: + + '%s%03d' % (chr(row+ord('A')-1), column) + +A badly formed label will result in the rejection of the record; the +same will happen if label, row and column are inconsistent. The well +will be filled by current_volume material produced by removing +used_volume material taken from the bio material contained in the +vessel identified by source. row and column are base 1. + +If the sample is a IlluminaBeadChipArray the plate column used in the +PlateWell case will become a illumina_array column and a new column, named +bead_chip_assay_type, is required:: + + illumina_array label source bead_chip_assay_type + V1351235 R01C01 V412441 HUMANEXOME_12V1_B + V1351235 R01C02 V351151 HUMANEXOME_12V1_B + V1351235 R02C01 V345115 HUMANEXOME_12V1_B + </help> + + <stdio> + <exit_code range="1:" level="fatal" /> + </stdio> + +</tool>