Mercurial > repos > kellrott > matrix_manipulate
view matrix_manipulate/matrix_flatten.xml @ 0:eeaa112c9ee0 draft
Uploaded
author | kellrott |
---|---|
date | Fri, 21 Dec 2012 16:43:16 -0500 |
parents | |
children |
line wrap: on
line source
<tool id="matrix_flatten" name="Matrix Flatten" version="1.0.0"> <description> using a state column</description> <command interpreter="python">matrix_flatten.py $input_tabular </command> <inputs> <param name="input_tabular" type="data" label="Matrix File"/> <param name="pivot_column" type="text" size="90" label="Pivot Column" value="c1"/> <repeat name="flatten" title="Flatten Columns Rule" min="1"> <param name="column" type="text" size="90" label="Flatten Column" value="c2"/> </repeat> <param name="missing" type="text" label="Missing Value String" value=""/> </inputs> <outputs> <data name="out" format="tabular" label="Flattened Matrix"/> </outputs> <help> Use the state of one column to flatten out other columns into descrete columns. The first column is the primary key, with the next column starting as c1. (So in the example below, c1 is DrugType). columns can be referenced by the cN value or their proper name (ie 'c1' or 'DrugType') Example File +--------+----------+-----------+ |#sample | DrugType| DrugDose | +--------+----------+-----------+ |sample_1| DrugA | 1 | +--------+----------+-----------+ |sample_1| DrugB | 2 | +--------+----------+-----------+ |sample_2| DrugA | 3 | +--------+----------+-----------+ |sample_2| DrugC | 5 | +--------+----------+-----------+ One might want to flatten the DrugDose column (c2), using the DrugType column (c1). Using Matrix Flatten, the matrix would becomes +--------+---------------+----------------+----------------+ |#sample |DrugA:DrugDose |DrugB:DrugDose |DrugC:DrugDose | +--------+---------------+----------------+----------------+ |sample_1| 1 | 2 | | +--------+---------------+----------------+----------------+ |sample_2| 3 | | 5 | +--------+---------------+----------------+----------------+ </help> </tool>