view metacyto_preprocess.xml @ 0:bf6470882a15 draft default tip

"planemo upload for repository https://github.com/AstraZeneca-Omics/immport-galaxy-tools/tree/master/flowtools/metacyto_preprocess commit c3d761b4fca140636c3f22ef0fdbb855f3ecbdb8"
author azomics
date Sun, 25 Jul 2021 10:36:03 +0000
parents
children
line wrap: on
line source

<tool id="metacyto_preprocess" name="Pre-process samples" version="1.0+galaxy0" profile="18.01">
  <description>for MetaCyto</description>
  <requirements>
    <requirement type="package" version="1.4.0">bioconductor-metacyto</requirement>
  </requirements>
  <stdio>
    <exit_code range="1:9" />
    <exit_code range="10" level="fatal" description="Please provide valid input FCS files." />
    <exit_code range="11" level="fatal" description="Please provide a label for FCS files sets." />
    <exit_code range="12" level="fatal" description="FCS files in a same group MUST have the same set of markers." />
    <exit_code range="13" level="fatal" description="All groups needs to have different labels"/>
    <exit_code range="14:" />
  </stdio>
  <command><![CDATA[
    Rscript --slave --vanilla '$__tool_directory__/metacyto_preprocess.R'
      '${sampling}'
      'preprocessed_fcs'
      '${output_file}'
      '${excluded_param}'
      '${g1_name}'
      '${g1_format}'
      '${g1_scaling_factor}'
    #for $f in $group1
    '${f}' '${f.name}'
    #end for
    #for $panel in $fcs_set
      'new_panel'
      '${panel.gp_name}'
      '${panel.gp_format}'
      '${panel.gp_scaling_factor}'
      #for $ff in $panel.group
        '${ff}' '${ff.name}'
      #end for
    #end for
    ]]>
  </command>
  <inputs>
    <param name="sampling" type="integer" label="Number of events to sample FCS files to." help="0 will use all events from input files, default value is 5000." value="5000"/>
    <param name="excluded_param" type="text" label="Parameters to exclude from the transformation." help="By default FSC, SSC, Time and Cell Length channels are excluded. Providing markers to exclude overrides the default setting. i.e.:FSC, SSC, CD88"/>
    <param name="g1_name" type="text" label="Label for the first set of FCS files." value="group 1"/>
    <param format="fcs" name="group1" type="data_collection" collection_type="list" label="FCS files Collection."/>
    <param name="g1_format" type="select" label="Assay type for the first set of FCS files." help="If files are compensated already, please select CyTOF.">
      <option value="FCM" selected="true">Standard Flow Cytometry data</option>
      <option value="CyTOF">CyTOF data</option>
    </param>
    <param name="g1_scaling_factor" type="integer" min="0" max="200" value="150" label="Scaling factor b for arcsinh transform for the first set of files." help="The default value is 150 for standard FCM data. The recommended value for CyTOF data is 5. If data is transformed already, please select 0."/>
    <repeat name="fcs_set" title="Set of FCS files">
      <param name="gp_name" type="text" label="Label for this set of FCS files." help="For example: group 2"/>
      <param format="fcs" name="group" type="data_collection" collection_type="list" label="FCS files Collection."/>
      <param name="gp_format" type="select" label="Assay type for the first set of FCS files." help="If files are compensated already, please select CyTOF.">
        <option value="FCM" selected="true">Standard Flow Cytometry data</option>
        <option value="CyTOF">CyTOF data</option>
      </param>
      <param name="gp_scaling_factor" type="integer" min="1" max="200" value="150" label="Scaling factor b for arcsinh transform for the first set of files." help="The default value is 150 for standard FCM data. The recommended value for cyTOF data is 5. If data is transformed already, please select 0."/>
    </repeat>
  </inputs>
  <outputs>
    <data format="metacyto_summary.txt" name="output_file" label="${tool.name} on ${on_string}: samples summary"/>
    <collection type="list" label="${tool.name} on ${on_string}: processed samples" name="preprocessed">
      <discover_datasets directory="preprocessed_fcs" pattern="__name_and_ext__" ext="fcs" />
    </collection>
  </outputs>
  <tests>
    <test>
      <param name="sampling" value="1000"/>
      <param name="excluded_param" value="FSC-A,FSC-W,FSC-H,Time,Cell_length"/>
      <param name="g1_name" value="SDY376"/>
      <param name="group1">
        <collection type="list">
          <element name="inputflow1" value="inputflow1.fcs"/>
          <element name="inputflow2" value="inputflow2.fcs"/>
          <element name="inputflow3" value="inputflow3.fcs"/>
          <element name="inputflow4" value="inputflow4.fcs"/>
          <element name="inputflow5" value="inputflow5.fcs"/>
          <element name="inputflow6" value="inputflow6.fcs"/>
        </collection>
      </param>
      <param name="g1_format" value="FCM"/>
      <param name="g1_scaling_factor" value="150"/>
      <repeat name="fcs_set">
        <param name="gp_name" value="SDY376-2"/>
        <param name="group">
          <collection type="list">
            <element name="inputcytof1" value="inputcytof1.fcs"/>
            <element name="inputcytof2" value="inputcytof2.fcs"/>
            <element name="inputcytof3" value="inputcytof3.fcs"/>
            <element name="inputcytof4" value="inputcytof4.fcs"/>
          </collection>
        </param>
        <param name="gp_format" value="CyTOF"/>
        <param name="gp_scaling_factor" value="8"/>
      </repeat>
      <output name="output_file">
        <assert_contents>
          <has_n_lines n="11" />
        </assert_contents>
      </output>
      <output_collection name="preprocessed" type="list">
        <element name="SDY376" ftype="fcs">
          <assert_contents>
            <has_text_matching expression="^FCS3.0" />
          </assert_contents>
        </element>
        <element name="SDY376-2" ftype="fcs">
          <assert_contents>
            <has_text_matching expression="^FCS3.0" />
          </assert_contents>
        </element>
      </output_collection>
    </test>
  </tests>
  <help><![CDATA[
    Pre-process samples
    -------------------

    This tool uses MetaCyto's preprocessing function to prepare sets of FCS files for a MetaCyto analysis.

    **Input**
    This tool requires one or more sets of FCS files.
    .. class:: infomark
    The number provided for sub-sampling corresponds to the number of events randomly sampled from each FCS files.
    **Output**
    This tool generates one or more FCS files containing optionally sub-sampled data from the input FCS data sets. The FCS data can optionally be compensated and/or transformed. A summary of the operations is also generated.
    .. class:: infomark
    This tool uses the arcsinh transformation. If you would like to use another transformation algorithm, sets of files can be prepared independantly by using the following tools:
    - Merge and downsample FCS files with FlowSOM
    - Transform FCS data with optional compensation and automated gating with flowDensity.
    .. class:: warningmark
    The workflow to use MetaCyto in R vs. ImmPort Galaxy are slightly different - please use the following tool in FCS File Tools to harmonize FCS files before MetaCyto pre-processing:
    - Edit markers or channels in FCS files

    **Example**

    *File1*: 20K events::

    Marker1 Marker2 Marker3 ...
    34      45      12      ...
    33      65      10      ...
    87      26      76      ...
    24      56      32      ...
    95      83      53      ...
    ...     ...     ...     ...

    *File2*: 20K events::

    Marker1 Marker2 Marker3 ...
    19      62      98      ...
    12      36      58      ...
    41      42      68      ...
    76      74      53      ...
    62      34      45      ...
    ...     ...     ...     ...

    *Output*: 5K events::

    Marker1 Marker2 Marker3 ...
    34      45      12      ...
    87      26      76      ...
    12      36      58      ...
    62      34      45      ...
    ...     ...     ...     ...

    *Output* - Summary Table::

    study_id antibodies                  filenames
    group1   Marker1|Marker2|Marker3|... file1.fcs
    group2   Marker1|Marker2|Marker3|... file2.fcs
    ]]>
  </help>
</tool>