<tool id="BECorrelation" name="BEC" version="1.0.0">
  <description>Binding-Expression-Correlation</description>
  <command interpreter="perl">genecentrico.pl $expr $chip_gff ${prom_choice.prom_start} ${prom_choice.type} $result $output ${prom_choice.prom_end}</command>
  <inputs>
    <param format="tabular" name="expr" type="data" label="expression file"/>
    <param format="bed" name="chip_gff" type="data" label="ChIP on chip GFF results"/>
    <conditional name="prom_choice">
   		<param name="type" type="select" label="Analysis type">
    	  <option value="promoter">only promoter</option>
    	  <option value="all">all gene</option>
   	    </param>
   	    <when value="promoter">
   	    		<param name="prom_start" type="integer" size="10" value="-2000" label="Promoter start"/>
   				<param name="prom_end" type="integer" size="10" value="1000" label="Promoter end"/>
   		</when>
   		<when value="all">
   				<param name="prom_start" type="integer" size="10" value="-2000" label="Promoter start"/>
   				<param name="prom_end" type="text" size="12" value="NOT-NEEDED" label="Promoter end"/>
   		</when>		
   </conditional>
   <param name="result" type="select" label="result output">
      <option value="number"># of matches</option>
      <option value="max_value">max value</option>
     </param> 
  </inputs>
  <outputs>
    <data format="tabular" name="output" />
  </outputs>
	<help>
 .. class:: infomark

**What it does**

BEC integrates the results of expression analysis and ChIP-chip analysis. For each transcript the number of peaks matching in the promoter and/or within the gene body is calculated.

PLEASE, for more detailed information refer to the CARPET user Manual:
click to download_ it.

.. _download: /static/example_file/CARPET_userManual.zip

-----

**Parameters:**

- **Analysis type:** 
                     - **promoter:** only the peaks matching in the promoter region (defined by user) are associated with the transcript
                     - **all gene:** peaks matching in the promoter and within the gene body are associated with the transcript
- **result output:** 
	- **# of matches:** the number of matching peaks are reported
	- **max value:** the highest score among all matching peaks is reported
                     
--------

.. class:: warningmark

If a peak matches with more than one transcript, it is associated with both.

-----

**INPUT FILES**

- Expression file: file created by TEA
- ChIP on chip GFF results: file create by PeakPicker (or any GFF file)

**OUTPUT FILES**

.. image:: static/images/CARPET/bec_output.png

.. class:: infomark

This results table can be used again as input expression file, to add another ChIP-chip experiment.

	</help>

</tool>
