view tools/maf/maf_to_bed.xml @ 0:9071e359b9a3

Uploaded
author xuebing
date Fri, 09 Mar 2012 19:37:19 -0500
parents
children
line wrap: on
line source

<tool id="MAF_To_BED1" name="Maf to BED" force_history_refresh="True">
  <description>Converts a MAF formatted file to the BED format</description>
  <command interpreter="python">maf_to_bed.py $input1 $out_file1 $species $complete_blocks $__new_file_path__</command>
  <inputs>
    <param format="maf" name="input1" type="data" label="MAF file to convert"/>
    <param name="species" type="select" label="Select species" display="checkboxes" multiple="true" help="a separate history item will be created for each checked species">
      <options>
        <filter type="data_meta" ref="input1" key="species" />
      </options>
    </param>
    <param name="complete_blocks" type="select" label="Exclude blocks which have a requested species missing">
      <option value="partial_allowed">include blocks with missing species</option>
      <option value="partial_disallowed">exclude blocks with missing species</option>
    </param>
  </inputs>
  <outputs>
    <data format="bed" name="out_file1" />
  </outputs>
  <tests>
    <test>
      <param name="input1" value="4.maf"/>
      <param name="species" value="hg17"/>
      <param name="complete_blocks" value="partial_disallowed"/>
      <output name="out_file1" file="cf_maf_to_bed.dat"/>
    </test>
  </tests>
  <help>

**What it does**

This tool converts every MAF block to an interval line (in BED format; scroll down for description of MAF and BED formats) describing position of that alignment block within a corresponding genome. 

The interface for this tool contains two pages (steps): 

 * **Step 1 of 2**. Choose multiple alignments from history to be converted to BED format.
 * **Step 2 of 2**. Choose species from the alignment to be included in the output and specify how to deal with alignment blocks that lack one or more species:

   *  **Choose species** - the tool reads the alignment provided during Step 1 and generates a list of species contained within that alignment. Using checkboxes you can specify taxa to be included in the output (only reference genome, shown in **bold**, is selected by default). If you select more than one species, then more than one history item will be created.
   *  **Choose to include/exclude blocks with missing species** - if an alignment block does not contain any one of the species you selected within **Choose species** menu and this option is set to **exclude blocks with missing species**, then coordinates of such a block **will not** be included in the output (see **Example 2** below).  


-----

**Example 1**: **Include only reference genome** (hg18 in this case) and **include blocks with missing species**:

For the following alignment::

  ##maf version=1
  a score=68686.000000
  s hg18.chr20     56827368 75 +  62435964 GACAGGGTGCATCTGGGAGGG---CCTGCCGGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC- 
  s panTro2.chr20  56528685 75 +  62293572 GACAGGGTGCATCTGAGAGGG---CCTGCCAGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC- 
  s rheMac2.chr10  89144112 69 -  94855758 GACAGGGTGCATCTGAGAGGG---CCTGCTGGGCCTTTG-TTCAAAACTAGATATGCCCCAACTCCAATTCTA------- 
  s mm8.chr2      173910832 61 + 181976762 AGAAGGATCCACCT------------TGCTGGGCCTCTGCTCCAGCAAGACCCACCTCCCAACTCAAATGCCC------- 
  s canFam2.chr24  46551822 67 +  50763139 CG------GCGTCTGTAAGGGGCCACCGCCCGGCCTGTG-CTCAAAGCTACAAATGACTCAACTCCCAACCGA------C 

  a score=10289.000000
  s hg18.chr20    56827443 37 + 62435964 ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG 
  s panTro2.chr20 56528760 37 + 62293572 ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG 
  s rheMac2.chr10 89144181 37 - 94855758 ATGTGCGGAAAATGTGATACAGAAACCTGCAGAGCAG 

the tool will create **a single** history item containing the following (**note** that field 4 is added to the output and is numbered iteratively: hg18_0, hg18_1 etc.)::

  chr20    56827368    56827443   hg18_0   0   +
  chr20    56827443    56827480   hg18_1   0   +

-----

**Example 2**: **Include hg18 and mm8** and **exclude blocks with missing species**:

For the following alignment::

  ##maf version=1
  a score=68686.000000
  s hg18.chr20     56827368 75 +  62435964 GACAGGGTGCATCTGGGAGGG---CCTGCCGGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC- 
  s panTro2.chr20  56528685 75 +  62293572 GACAGGGTGCATCTGAGAGGG---CCTGCCAGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC- 
  s rheMac2.chr10  89144112 69 -  94855758 GACAGGGTGCATCTGAGAGGG---CCTGCTGGGCCTTTG-TTCAAAACTAGATATGCCCCAACTCCAATTCTA------- 
  s mm8.chr2      173910832 61 + 181976762 AGAAGGATCCACCT------------TGCTGGGCCTCTGCTCCAGCAAGACCCACCTCCCAACTCAAATGCCC------- 
  s canFam2.chr24  46551822 67 +  50763139 CG------GCGTCTGTAAGGGGCCACCGCCCGGCCTGTG-CTCAAAGCTACAAATGACTCAACTCCCAACCGA------C 

  a score=10289.000000
  s hg18.chr20    56827443 37 + 62435964 ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG 
  s panTro2.chr20 56528760 37 + 62293572 ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG 
  s rheMac2.chr10 89144181 37 - 94855758 ATGTGCGGAAAATGTGATACAGAAACCTGCAGAGCAG 

the tool will create **two** history items (one for hg18 and one fopr mm8) containing the following (**note** that both history items contain only one line describing the first alignment block. The second MAF block is not included in the output because it does not contain mm8):

History item **1** (for hg18)::

   chr20    56827368    56827443   hg18_0   0   +

History item **2** (for mm8)::

   chr2    173910832   173910893    mm8_0   0   +

-------

.. class:: infomark

**About formats**

**MAF format** multiple alignment format file. This format stores multiple alignments at the DNA level between entire genomes. 

 - The .maf format is line-oriented. Each multiple alignment ends with a blank line.
 - Each sequence in an alignment is on a single line.
 - Lines starting with # are considered to be comments.
 - Each multiple alignment is in a separate paragraph that begins with an "a" line and contains an "s" line for each sequence in the multiple alignment.
 - Some MAF files may contain two optional line types: 

   - An "i" line containing information about what is in the aligned species DNA before and after the immediately preceding "s" line; 
   - An "e" line containing information about the size of the gap between the alignments that span the current block.

**BED format** Browser Extensible Data format was designed at UCSC for displaying data tracks in the Genome Browser. It has three required fields and a number of additional optional ones:

The first three BED fields (required) are::

    1. chrom - The name of the chromosome (e.g. chr1, chrY_random).
    2. chromStart - The starting position in the chromosome. (The first base in a chromosome is numbered 0.)
    3. chromEnd - The ending position in the chromosome, plus 1 (i.e., a half-open interval).

Additional (optional) fields are::

    4. name - The name of the BED line.
    5. score - A score between 0 and 1000.
    6. strand - Defines the strand - either '+' or '-'.

------

**Citation**

If you use this tool, please cite `Blankenberg D, Taylor J, Nekrutenko A; The Galaxy Team. Making whole genome multiple alignments usable for biologists. Bioinformatics. 2011 Sep 1;27(17):2426-2428. &lt;http://www.ncbi.nlm.nih.gov/pubmed/21775304&gt;`_


    </help>
    <code file="maf_to_bed_code.py"/>
</tool>