view bismark_methyl_extractor/bismark_methylation_extractor.xml @ 7:fcadce4d9a06 draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/bismark commit b'e6ee273f75fff61d1e419283fa8088528cf59470\n'
author bgruening
date Sat, 06 May 2017 13:18:09 -0400
parents
children
line wrap: on
line source

<tool id="bismark_methylation_extractor" name="Bismark Meth. Extractor" version="0.16.3">

    <description>Reports on methylation status of reads mapped by Bismark</description>
    <!--<version_command>bismark_methylation_extractor version</version_command>-->

    <requirements>
        <requirement type="package" version="0.1.19">samtools</requirement>
        <requirement type="package" version="2.1.0">bowtie2</requirement>
    </requirements>

    <parallelism method="basic"></parallelism>

    <command interpreter="python">
<![CDATA[
        bismark_methylation_extractor.py

        --infile "$input"

        ##--bismark_path \$SCRIPT_PATH
        --bismark_path "$__tool_directory__"

        #if $singlePaired.sPaired == "single":
            --single-end
        #else:
            --paired-end
            $singlePaired.no_overlap
        #end if

        #if str( $singlePaired['ignore_r1'] ) != "0":
          --ignore $singlePaired['ignore_r1']
        #end if
        #if str( $singlePaired['ignore_3prime_r1'] ) != "0":
          --ignore_3prime $singlePaired['ignore_3prime_r1']
        #end if

        #if $singlePaired.sPaired == "paired":
          #if str( $singlePaired['ignore_r2'] ) != "0":
            --ignore_r2 $singlePaired['ignore_r2']
          #end if
          #if str( $singlePaired['ignore_3prime_r2'] ) != "0":
            --ignore_3prime_r2 $singlePaired['ignore_3prime_r2']
          #end if
        #end if

        #if $splitting_report:
            --splitting_report "$output_splitting_report"
        #end if

        #if $mbias_report:
          --mbias_report "$output_mbias_report"
        #end if

        #if $cytosine_report['cytosine_report_selector']:
          --cytosine_report "$output_cytosine_report"
          --genome_file "${cytosine_report.built_in_fasta.fields.path}"
          #if not $cytosine_report['cpg_context']:
            --cx_context
          #end if
        #end if

        #if $output_settings['comprehensive']:
            --comprehensive
        #end if

        #if $output_settings['merge_non_cpg']:
            --merge-non-cpg
        #end if

        --compress "$compressed_output"
]]>
    </command>

    <inputs>
        <!-- Input Parameters -->
        <param name="input" type="data" format="sam,bam" label="SAM/BAM file from Bismark bisulfite mapper" />
        <conditional name="singlePaired">
            <param name="sPaired" type="select" label="Is this library mate-paired?">
              <option value="single">Single-end</option>
              <option value="paired">Paired-end</option>
            </param>
            <when value="single">
              <param name="ignore_r1" type="integer" value="0" label="Ignore the first N bp from the 5’ end of single-end read when processing the methylation call string." />
              <param name="ignore_3prime_r1" type="integer" value="0" label="Ignore the last N bp from the 3' end of single-end read when processing the methylation call string."/>
            </when>
            <when value="paired">
                <param name="ignore_r1" type="integer" value="0" label="Ignore the first N bp from the 5’ end of Read 1 when processing the methylation call string." />
                <param name="ignore_3prime_r1" type="integer" value="0" label="Ignore the last N bp from the 3' end of Read 1 when processing the methylation call string."/>
                <param name="ignore_r2" type="integer" value="0" label="Ignore the first N bp from the 5' end of Read 2 of paired-end sequencing results" />
                <param name="ignore_3prime_r2" type="integer" value="0" label="Ignore the last N bp from the 3' end of Read 2 of paired-end sequencing results"/>
                <param name="no_overlap" type="boolean" truevalue="--no-overlap" falsevalue="" checked="False" label="This option avoids scoring overlapping methylation calls twice, in case of overlapping read one and read two" help="" />
            </when>
        </conditional>
        <param name="splitting_report" type="boolean" truevalue="true" falsevalue="false" checked="True" label="Short methylation summary output (Splitting Report)" />
        <param name="mbias_report" type="boolean" truevalue="true" falsevalue="false" checked="True" label="Methylation proportion report for each possible position in the read (Mbias Report)" />
        <conditional name="cytosine_report">
          <param name="cytosine_report_selector" type="boolean" truevalue="true" falsevalue="false" checked="True" label="Genome-wide methylation report for all cytosines in the genome (Cytosine Report)" />
          <when value="true">
            <param name="built_in_fasta" type="select" label="Select  the Reference Genome (fasta) used for the mapping">
              <options from_data_table="all_fasta">
                <filter type="sort_by" column="name"/>
                <validator type="no_options" message="No genomes in fasta are available for the selected input dataset"/>
              </options>
            </param>
            <param name="cpg_context" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Reports Cpg Context only" />
          </when>
          <when value="false"></when>
        </conditional>
        <section name="output_settings" title="Advanced output settings" expanded="False">
          <param name="comprehensive" type="boolean" truevalue="true" falsevalue="false" checked="True" label="Merge all four possible strand-specific methylation info
into context-dependent output files" help="" />
          <param name="merge_non_cpg" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Merge all non-CpG contexts into one file" help="This will produce eight strand-specific output files, or two output files in comprehensive mode." />
        </section>
    </inputs>
    <outputs>
        <!--
            OT – original top strand
            CTOT – complementary to original top strand
            OB – original bottom strand
            CTOB – complementary to original bottom strand
        -->
        <data format="tabular" name="output_splitting_report" label="${tool.name} on ${on_string}: Splitting Report">
          <filter> ( splitting_report is True ) </filter>
        </data>
        <data format="txt" name="output_mbias_report" label="${tool.name} on ${on_string}: Mbias Report">
          <filter> ( mbias_report is True ) </filter>
        </data>
         <data format="txt" name="output_cytosine_report" label="${tool.name} on ${on_string}: Genome-wide methylation report.">
          <filter> ( cytosine_report['cytosine_report_selector'] ) </filter>
        </data>
        <data format="gzipped" name="compressed_output" label="${tool.name} on ${on_string}: Result archive.">
          <filter> ( output_settings['compress'] ) </filter>
        </data>
    </outputs>

    <tests>
    </tests>

    <help>
<![CDATA[

**What it does**

  | The following is a brief description of all options to control the Bismark_methylation extractor. The script reads in a bisulfite read alignment results file produced by the Bismark bisulfite mapper and extracts the methylation information for individual cytosines. This information is found in the methylation call field which can contain the following characters:
  |


  - X = for methylated C in CHG context (was protected)
  - x = for not methylated C CHG (was converted)
  - H = for methylated C in CHH context (was protected)
  - h = for not methylated C in CHH context (was converted)
  - Z = for methylated C in CpG context (was protected)
  - z = for not methylated C in CpG context (was converted)
  - . = for any bases not involving cytosines

  | The methylation extractor outputs result files for cytosines in CpG, CHG and CHH context (this distinction is actually already made in Bismark itself). As the methylation information for every C analysed can produce files which easily have tens or even hundreds of millions of lines, file sizes can become very large and more difficult to handle. The C methylation info additionally splits cytosine methylation calls up into one of the four possible strands a given bisulfite read aligned against:
  |

  - OT = original top strand
  - CTOT = complementary to original top strand

  - OB = original bottom strand
  - CTOB = complementary to original bottom strand

  | Thus, by default twelve individual output files are being generated per input file (unless --comprehensive is specified, see below). The output files can be imported into a genome viewer, such as SeqMonk, and re-combined into a single data group if desired (in fact unless the bisulfite reads were generated preserving directionality it doesn't make any sense to look at the data in a strand-specific manner). Strand-specific output files can optionally be skipped, in which case only three output files for CpG, CHG or CHH context will be generated. For both the strand-specific and comprehensive outputs there is also the option to merge both non-CpG contexts (CHG and CHH) into one single non-CpG context.
  |
  | It is developed by Krueger F and Andrews SR. at the Babraham Institute. Krueger F, Andrews SR. (2011) Bismark: a flexible aligner and methylation caller for Bisulfite-Seq applications. Bioinformatics, 27, 1571-2.

.. _Bismark: http://www.bioinformatics.babraham.ac.uk/projects/bismark/

----

**Outputs**

- The output files are in the following format (tab delimited)::


      Column  Description
    --------  --------------------------------------------------------
        1     seq-ID
        2     strand
        3     chromosome
        4     position
        5     methylation call


- Methylated cytosines receive a '+' orientation,
- Unmethylated cytosines receive a '-' orientation.

----

**Note on Bismark settings**

  | All of the options have a default value. You can change any of them. If any Bismark function is missing please contact the tool author or your Galaxy admin.

----

**Settings**

* **If Single-End Reads**

  * **Ignore the first N bp from the 5’ end of single-end read when processing the methylation call string.**

      | This can remove e.g. a restriction enzyme site at the start of each read or any other source of bias (e.g. PBAT-Seq data).
      |
      | *Input option --ignore <INT>*

  * **Ignore the last N bp from the 3' end of single-end read when processing the methylation call string.**

      | This can remove unwanted biases from the end of reads.
      |
      | *Input option --ignore_3prime <INT>* 

* **If Paired-End Reads**

  * **Ignore the first N bp from the 5’ end of Read 1 when processing the methylation call string**

      | This can remove e.g. a restriction enzyme site at the start of each read or any other source of bias (e.g. PBAT-Seq data).
      |
      | *Input option --ignore <INT>*

  * **Ignore the last N bp from the 3’ end of Read 1 when processing the methylation call string**

      | This can remove unwanted biases from the end of reads.
      |
      | *Input option --ignore_3prime <INT>*

  * **Ignore the first N bp from the 5' end of Read 2 of paired-end sequencing results**

      | Since the first couple of bases in Read 2 of BS-Seq experiments show a severe bias towards non-methylation as a result of end-repairing sonicated fragments with unmethylated cytosines (see M-bias plot), it is recommended that the first couple of bp of Read 2 are removed before starting downstream analysis. Please see the section on M-bias plots in the Bismark User Guide for more details. The options --ignore <int> and --ignore_r2 <int> can be combined in any desired way.
      |
      | *Input option --ignore_r2*

  * **Ignore the last N bp from the 3' end of Read 2 of paired-end sequencing results**

      | This can remove unwanted biases from the end of reads.
      |
      | *Input option --ignore_3prime_r2*

  * **This option avoids scoring overlapping methylation calls twice, in case of overlapping read one and read two**

      | For paired-end reads it is theoretically possible that read_1 and read_2 overlap. This option avoids scoring overlapping methylation calls twice (only methylation calls of read 1 are used for in the process since read 1 has historically higher quality basecalls than read 2). Whilst this option removes a bias towards more methylation calls in the center of sequenced fragments it may de facto remove a sizable proportion of the data. This option is highly recommended for paired-end data.
      |
      | *Input option --no_overlap*

* **Short methylation summary output (Splitting Report)**

    | Prints out a short methylation summary as well as the paramaters used to run this script.
    |
    | *Output option --report*

* **Methylation proportion report for each possible position in the read (Mbias Report)**

    | This report shows the methylation proportion across each possible position in the read (described in further detail in:Hansen et al., Genome Biology, 2012, 13:R83). The data for the M-bias plot is also written into a text file and is in the following format:
    |
    | <read position> <count methylated> <count unmethylated> <% methylation> <total coverage>
    |
    | This allows generating nice graphs by alternative means, e.g. using R or Excel

* **Genome-wide methylation report for all cytosines in the genome**

    | the option --cytosine_report produces a genome-wide methylation report for all cytosines in the genome. 

  * **If CpG Context only**

      | the output uses 1-based chromosome coordinates (zero-based cords are optional) and reports CpG context only (all cytosine context is optional). The output considers all Cs on both forward and reverse strands and reports their position, strand, trinucleotide content and methylation state (counts are 0 if not covered).
      |
      | *Genome-wide cytosine methylation report specific option --bedgraph --cytosine_report --genome_folder <path>*

  * **If not CpG Context only**

      | The output file contains information on every single cytosine in the genome irrespective of its context. This applies to both forward and reverse strands. Please be aware that this will generate output files with > 1.1 billion lines for a mammalian genome such as human or mouse. Default: OFF (i.e. Default = CpG context only).
      |
      | *Genome-wide cytosine methylation report specific option --bedgraph --CX_context --cytosine_report --CX_context --genome_folder <path>*

* **Merge all four possible strand-specific methylation info into context-dependent output files**

    | Specifying this option will merge all four possible strand-specific methylation info into context-dependent output files. The default contexts are:
    |  - CpG context
    |  - CHG context
    |  - CHH context
    |
    | *Output option --comprehensive*

* **Merge all non-CpG contexts into one file**

    | This will produce two output files (in --comprehensive mode) or eight strand-specific output files (default) for Cs in
    | - CpG context
    | - non-CpG context
    |
    | *Output option --merge_non_CpG*

* **Compress all result files and output one single file**

    | The methylation extractor files (CpG_OT..., CpG_OB... etc) will be written out in a GZIP compressed form to save disk space. This option does not work on bedGraph and genome-wide cytosine reports as they are 'tiny' anyway.
    |
    | *Output option --gzip*

]]>
  </help>

  <citations>
      <citation type="doi">10.1093/bioinformatics/btr167</citation>
  </citations>
</tool>