view bamtobed.xml @ 1:fef10ad6ee15 draft

Uploaded
author geoffrey.dintilhac
date Sat, 21 Dec 2019 13:00:33 -0500
parents
children
line wrap: on
line source

 <tool id="bam_to_bed_convert" name="BAM-to-BED" version="1.0"> <!-- tool's name displayed on Galaxy --> 
      <description>converter</description>
      
      <requirements> <!-- package required -->
		  <requirement type="package" version="2.29.0">bedtools</requirement>
	  </requirements>
      
      <command interpreter="python">bamtobed.py
      -i $input 
      -o $output
      -oot $conditional.selector
			
      #if $conditional.selector =="Y":
			-f $conditional.format_output_chosen
      #end if
      
      -sc $score_calcul_selector.score_calcul_BED
      #if $score_calcul_selector.score_calcul_BED =="tag":
			-tag $score_calcul_selector.calcul_BED_tag
      #end if
      
      #if $split_boolean =="Y":
			-spt
      #end if
      
      #if $cigar_boolean =="Y":
			-cgr
      #end if
      </command>


      <inputs>
		  
		  <param format="bam" name="input" type="data" label="Source file"/> <!-- input file -->

        <conditional name="conditional"> <!-- Output file format different from BED ? -->	 
			<param name="selector" type="select" label="Output file format different from BED">
				<option value="N">No</option>
				<option value="Y">Yes</option>
			</param>
			
	

			<when value="N"/>
			<when value="Y"> <!-- format output chosen = not BED -->
				<param name="format_output_chosen" type="select" label="Output file format chosen" help="use BEDPE only with paired-end input (and sorted by read name) dataset"> <!-- choice of output file format -->
					<option value="BEDPE">BEDPE : add fields (chrom2, star2, end2, strand2) for paired-end sequence alignments</option> 
					<option value="BED12">BED12 : each feature is described by all 12 columns</option>
				</param>	
			</when>
		</conditional> 	
		
		<conditional name="score_calcul_selector"> <!-- choice of the score calculation -->
             <param name="score_calcul_BED" type="select" label="Select a calculation for BED score">
				<option value="mapq">Use mapping quality (default)</option>
				<option value="ed">Use alignment's edit-distance for BED score</option>
				<option value="tag">Use other BAM alignment tag for BED score</option>
			</param>
			<when value="tag">
				<param name="calcul_BED_tag" type="text" label="Enter other BAM alignment tag as the BED score" help ="/!\ Choice of another tag for score calculation is disallowed with BEDPE output /!\"/>
			</when>
		</conditional>
		
		<!-- option split and cigar : -->
		<param name="split_boolean" type="boolean" truevalue="Y" falsevalue="N" checked="false" label="To split or not to split ?" help="Report each portion of a “split” BAM while obeying both “N” CIGAR and “D” operation. Be careful : -split is disallowed with edit-distance as a calculation for BED score."></param>
		<param name="cigar_boolean" type="boolean" truevalue="Y" falsevalue="N" checked="false" label="CIGAR string ?" help="Add the CIGAR string to the BED entry as a 7th column. Be careful : -cigar is not displayed with -splits, and disallowed with edit-distance as a calculation for BED score."></param>

      </inputs>						

     
      <outputs>
        <data format="bed" name="output"/>
      </outputs>


     <tests>
       <test>
         <param name="input" value="bam_to_bed_convert.bam"/>
         <output name="out_file" file="bam_to_bed_convert.bed"/>
       </test>
     </tests>
   
   
     <help>
**What it does**: this tool converts sequence alignments in BAM format into BED, BED12 or BEDPE format running the command "bamtobed" of bedtools. 

.. class:: warningmark

If you want a **BEDPE output**, your input has to be paired-end and sorted by read name.

.. class:: warningmark

About **score calculation** : the option "another tag" is disallowed with BEDPE output.

.. class:: warningmark

About the options **-split** and **-cigar** : -split is disallowed with edit-distance as a calculation for BED score. -cigar is not displayed with -splits, and disallowed with edit-distance as a calculation for BED score.

.. class:: infomark

For more information, please refer to this link : https://bedtools.readthedocs.io/en/latest/content/tools/bamtobed.html

This wrapper is available to install into other Galaxy Instances via the Galaxy
Tool Shed at https://toolshed.g2.bx.psu.edu/view/geoffrey.dintilhac/bam_to_bed/68f7b5a4b1e2

**If you use this tool in Galaxy, please cite:**

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