view histogram2.xml @ 3:d0b9dd19e919 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/histogram commit e67a9cc9a7b253ba46df745f5fd6bf26282e97cd
author devteam
date Fri, 07 Feb 2025 21:26:17 +0000
parents 6f134426c2b0
children
line wrap: on
line source

<tool id="histogram_rpy" name="Histogram" version="1.0.5">
  <description>of a numeric column</description>
  <requirements>
    <requirement type="package" version="3.3.2">rpy2</requirement>
    <requirement type="package" version="3.6.0">R</requirement>
  </requirements>
  <command>
python '$__tool_directory__/histogram.py'
    '$input'
    '$out_file1'
    $numerical_column
    '$title'
    '$xlab'
    $breaks
    $density
    $frequency
</command>
  <inputs>
    <param name="input" type="data" format="tabular" label="Dataset" help="Dataset missing? See TIP below"/>
    <conditional name="cols">
        <param name="header" type="select" label="Does the table have a header?" refresh_on_change="true" help="If the table has a header, the column can be selected using the name instead of the index.">
            <option value="yes">yes</option>
            <option value="no">no</option>
        </param>
        <when value="yes">
          <param name="numerical_column" type="data_column" data_ref="input" numerical="True" use_header_names="true" label="Numerical column for x axis" />
        </when>
        <when value="no">
          <param name="numerical_column" type="data_column" data_ref="input" numerical="True" label="Numerical column for x axis" />
        </when>
    </conditional>
    <param name="breaks" type="integer" value="0" label="Number of breaks (bars)"/>
    <param name="title" type="text" value="Histogram" label="Plot title"/>
    <param name="xlab" type="text" value="V1" label="Label for x axis"/>
    <param name="density" type="boolean" checked="yes" label="Include smoothed density"/>
    <param name="frequency" type="boolean" checked="no" label="Plot as frequency (counts)"/>
  </inputs>
  <outputs>
    <data format="pdf" name="out_file1" />
  </outputs>
  <tests>
    <test>
      <param name="input" value="histogram_in1.tabular" ftype="tabular"/>
      <param name="numerical_column" value="2"/>
      <param name="breaks" value="0"/>
      <param name="title" value="Histogram"/>
      <param name="xlab" value="V1"/>
      <param name="density" value="true"/>
      <param name="frequency" value="false"/>
      <output name="out_file1" file="histogram_out1.pdf" compare="sim_size"/>
    </test>
  </tests>
  <help>

.. class:: infomark

**TIP:** To remove comment lines that do not begin with a *#* character, use *Text Manipulation-&gt;Remove beginning*

 .. class:: infomark

**TIP:** If your data is not TAB delimited, use *Text Manipulation-&gt;Convert*

-----

**Syntax**

This tool computes a histogram of the numerical values in a column of a dataset.

- All invalid, blank and comment lines in the dataset are skipped.  The number of skipped lines is displayed in the resulting history item.
- **Column for x axis** - only numerical columns are possible.
- **Number of breaks(bars)** - breakpoints between histogram cells. Value of '0' will determine breaks automatically.
- **Plot title** - the histogram title.
- **Label for x axis** - the label of the x axis for the histogram.
- **Include smoothed density** - if checked, the resulting graph will join the given corresponding points with line segments.

-----

**Example**

- Input file::

    1	68	4.1
    2	71	4.6
    3	62	3.8
    4	75	4.4
    5	58	3.2
    6	60	3.1
    7	67	3.8
    8	68	4.1
    9	71	4.3
    10	69	3.7 

- Create a histogram on column 2 of the above dataset. 

.. image:: histogram2.png

</help>
<citations>
  <citation type="doi">10.1145/3386334</citation>
</citations>
</tool>