changeset 0:839e36b39c3f draft

Uploaded
author yufei-luo
date Mon, 12 Aug 2013 08:44:05 -0400
parents
children 53987fecf8c7
files bwa_0_7_5/README bwa_0_7_5/bwa_0_7_5.py bwa_0_7_5/bwa_0_7_5.xml bwa_0_7_5/tool-data/bwa_index.loc
diffstat 4 files changed, 500 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bwa_0_7_5/README	Mon Aug 12 08:44:05 2013 -0400
@@ -0,0 +1,4 @@
+This tool is just a wrapper of bwa for the 0.7.5 version. 
+Only for BWA-MEM usage.
+
+If you have problems with wrapper files, please contact me: luoyufei@gmail.com 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bwa_0_7_5/bwa_0_7_5.py	Mon Aug 12 08:44:05 2013 -0400
@@ -0,0 +1,272 @@
+#!/usr/bin/env python
+## yufei.luo@gustave.roussy 22/07/2013
+
+"""
+Runs BWA on single-end or paired-end data.
+Produces a SAM file containing the mappings.
+Works with BWA version 0.7.5. 
+NOTICE: In this wrapper, we only use 'mem' for mapping step.
+
+usage: bwa_0_7_5.py [args]
+
+See below for args
+"""
+
+import optparse, os, shutil, subprocess, sys, tempfile
+import argparse
+
+def stop_err( msg ):
+    sys.stderr.write( '%s\n' % msg )
+    sys.exit()
+
+def check_is_double_encoded( fastq ):
+    # check that first read is bases, not one base followed by numbers
+    bases = [ 'A', 'C', 'G', 'T', 'a', 'c', 'g', 't', 'N' ]
+    nums = [ '0', '1', '2', '3' ]
+    for line in file( fastq, 'rb'):
+        if not line.strip() or line.startswith( '@' ):
+            continue
+        if len( [ b for b in line.strip() if b in nums ] ) > 0:
+            return False
+        elif line.strip()[0] in bases and len( [ b for b in line.strip() if b in bases ] ) == len( line.strip() ):
+            return True
+        else:
+            raise Exception, 'First line in first read does not appear to be a valid FASTQ read in either base-space or color-space'
+    raise Exception, 'There is no non-comment and non-blank line in your FASTQ file'
+
+def __main__():
+
+    descr = "bwa_0_7_5.py: version 1.0. Map the reads(long length) against the genome reference with BWA MEM. \n"
+    descr += "Usage: BWA mem -t thread -R groupInfo refSequence read.R1.fastq (read.R2.fastq) > out.sam"
+    parser = argparse.ArgumentParser(description=descr)
+    parser.add_argument( '-t', '--threads', default=1, help='The number of threads to use [1]' )
+    parser.add_argument( '--color-space', default=False, help='If the input files are SOLiD format' )    
+    parser.add_argument( '--ref', help='The reference genome to use or index' )
+    parser.add_argument( '-f', '--fastq', help='The (forward) fastq file to use for the mapping' )
+    parser.add_argument( '-F', '--rfastq', help='The reverse fastq file to use for mapping if paired-end data' )
+    parser.add_argument( '-u', '--output', help='The file to save the output (SAM format)' )
+    parser.add_argument( '-g', '--genAlignType',  help='The type of pairing (single or paired)' )
+    parser.add_argument( '--params', help='Parameter setting to use (pre_set or full)' )
+    parser.add_argument( '-s', '--fileSource', help='Whether to use a previously indexed reference sequence or one form history (indexed or history)' )
+    parser.add_argument( '-D', '--dbkey', help='Dbkey for reference genome' )
+
+    parser.add_argument( '-k', '--minEditDistSeed', default=19, type=int, help='Minimum edit distance to the seed [19]' )
+    parser.add_argument( '-w', '--bandWidth', default=100, type=int, help='Band width for banded alignment [100]' )
+    parser.add_argument( '-d', '--offDiagonal', default=100, type=int, help='off-diagonal X-dropoff [100]' )
+    parser.add_argument( '-r', '--internalSeeds', default=1.5, type=float, help='look for internal seeds inside a seed longer than {-k} * FLOAT [1.5]' )
+    parser.add_argument( '-c', '--seedsOccurrence', default=10000, type=int, help='skip seeds with more than INT occurrences [10000]' )
+    parser.add_argument( '-S', '--mateRescue', default=False, help='skip mate rescue' )
+    parser.add_argument( '-P', '--skipPairing', default=False, help='skpe pairing, mate rescue performed unless -S also in use' )
+    parser.add_argument( '-A', '--seqMatch', default=1, type=int, help='score of a sequence match' )
+    parser.add_argument( '-B', '--mismatch', default=4,type=int, help='penalty for a mismatch' )
+    parser.add_argument( '-O', '--gapOpen', default=6, type=int, help='gap open penalty' )
+    parser.add_argument( '-E', '--gapExtension', default=None, help='gap extension penalty; a gap of size k cost {-O} + {-E}*k [1]' )
+    parser.add_argument( '-L', '--clipping', default=5, type=int, help='penalty for clipping [5]' )
+    parser.add_argument( '-U', '--unpairedReadpair', default=17, type=int, help='penalty for an unpaired read pair [17]' )
+    parser.add_argument( '-p', '--interPairEnd', default=False, help='first query file consists of interleaved paired-end sequences' )
+    parser.add_argument( '--rgid', help='Read group identifier' )
+    parser.add_argument( '--rgsm', help='Sample' )
+    parser.add_argument( '--rgpl', choices=[ 'CAPILLARY', 'LS454', 'ILLUMINA', 'SOLID', 'HELICOS', 'IONTORRENT' and 'PACBIO' ], help='Platform/technology used to produce the reads' )
+    parser.add_argument( '--rglb', help='Library name' )
+    parser.add_argument( '--rgpu', help='Platform unit (e.g. flowcell-barcode.lane for Illumina or slide for SOLiD)' )
+    parser.add_argument( '--rgcn', help='Sequencing center that produced the read' )
+    parser.add_argument( '--rgds', help='Description' )
+    parser.add_argument( '--rgdt', help='Date that run was produced (ISO8601 format date or date/time, like YYYY-MM-DD)' )
+    parser.add_argument( '--rgfo', help='Flow order' )
+    parser.add_argument( '--rgks', help='The array of nucleotide bases that correspond to the key sequence of each read' )
+    parser.add_argument( '--rgpg', help='Programs used for processing the read group' )
+    parser.add_argument( '--rgpi', help='Predicted median insert size' )
+    parser.add_argument( '-T', '--minScore', default=30, type=int, help='minimum score to output [30]' )
+    parser.add_argument( '-M', '--mark', default=False, help='mark shorter split hits as secondary (for Picard/GATK compatibility)' )
+    args = parser.parse_args()
+
+
+    # output version # of tool
+    try:
+        tmp = tempfile.NamedTemporaryFile().name
+        tmp_stdout = open( tmp, 'wb' )
+        proc = subprocess.Popen( args='bwa 2>&1', shell=True, stdout=tmp_stdout )
+        tmp_stdout.close()
+        returncode = proc.wait()
+        stdout = None
+        for line in open( tmp_stdout.name, 'rb' ):
+            if line.lower().find( 'version' ) >= 0:
+                stdout = line.strip()
+                break
+        if stdout:
+            sys.stdout.write( 'BWA %s\n' % stdout )
+        else:
+            raise Exception
+    except:
+        sys.stdout.write( 'Could not determine BWA version\n' )
+
+    # check for color space fastq that's not double-encoded and exit if appropriate
+#    if args.color_space:
+#        if not check_is_double_encoded( args.fastq ):
+#            stop_err( 'Your file must be double-encoded (it must be converted from "numbers" to "bases"). See the help section for details' )
+#        if args.genAlignType == 'paired':
+#            if not check_is_double_encoded( args.rfastq ):
+#                stop_err( 'Your reverse reads file must also be double-encoded (it must be converted from "numbers" to "bases"). See the help section for details' )
+
+    fastq = args.fastq
+    if args.rfastq:
+         rfastq = args.rfastq
+
+    # set color space variable
+#    if args.color_space:
+#        color_space = '-c'
+#    else:
+#        color_space = ''
+
+    # make temp directory for placement of indices
+    tmp_index_dir = tempfile.mkdtemp()
+    tmp_dir = tempfile.mkdtemp()
+    # index if necessary
+    if args.fileSource == 'history' and not args.do_not_build_index:
+        ref_file = tempfile.NamedTemporaryFile( dir=tmp_index_dir )
+        ref_file_name = ref_file.name
+        ref_file.close()
+        os.symlink( args.ref, ref_file_name )
+        # determine which indexing algorithm to use, based on size
+        try:
+            size = os.stat( args.ref ).st_size
+            if size <= 2**30: 
+                indexingAlg = 'is'
+            else:
+                indexingAlg = 'bwtsw'
+        except:
+            indexingAlg = 'is'
+        #indexing_cmds = '%s -a %s' % ( color_space, indexingAlg )
+        indexing_cmds = '-a %s' % indexingAlg
+        cmd1 = 'bwa index %s %s' % ( indexing_cmds, ref_file_name )
+        try:
+            tmp = tempfile.NamedTemporaryFile( dir=tmp_index_dir ).name
+            tmp_stderr = open( tmp, 'wb' )
+            proc = subprocess.Popen( args=cmd1, shell=True, cwd=tmp_index_dir, stderr=tmp_stderr.fileno() )
+            returncode = proc.wait()
+            tmp_stderr.close()
+            # get stderr, allowing for case where it's very large
+            tmp_stderr = open( tmp, 'rb' )
+            stderr = ''
+            buffsize = 1048576
+            try:
+                while True:
+                    stderr += tmp_stderr.read( buffsize )
+                    if not stderr or len( stderr ) % buffsize != 0:
+                        break
+            except OverflowError:
+                pass
+            tmp_stderr.close()
+            if returncode != 0:
+                raise Exception, stderr
+        except Exception, e:
+            # clean up temp dirs
+            if os.path.exists( tmp_index_dir ):
+                shutil.rmtree( tmp_index_dir )
+            if os.path.exists( tmp_dir ):
+                shutil.rmtree( tmp_dir )
+            stop_err( 'Error indexing reference sequence. ' + str( e ) )
+    else:
+        ref_file_name = args.ref
+    # if args.illumina13qual:
+    #     illumina_quals = "-I"
+    # else:
+    #     illumina_quals = ""
+
+    # set up aligning and generate aligning command args
+    start_cmds = '-t %s ' % args.threads
+    if args.params == 'pre_set':
+        # aligning_cmds = '-t %s %s %s' % ( args.threads, color_space, illumina_quals )
+        #start_cmds = '-t %s ' % args.threads 
+        end_cmds = ' '
+        print start_cmds, end_cmds
+
+    else:
+        end_cmds = '-k %s -w %s -d %s -r %s -c %s -A %s -B %s -O %s -L %s -U %s -T %s ' % (args.minEditDistSeed, args.bandWidth, args.offDiagonal, args.internalSeeds, args.seedsOccurrence, args.seqMatch, args.mismatch, args.gapOpen, args.clipping, args.unpairedReadpair, args.minScore)
+        if args.mateRescue:
+            end_cmds += '-S '
+            if args.skipPairing:
+                end_cmds += '-P '
+        else:
+            if args.skipPairing:
+                print "Option Error and will not be considered, you should also choose 'skip mate rescue -S' option! "
+        if args.gapExtension != None:
+            end_cmds += '-E %s ' % args.gapExtension
+
+        if args.rgid:
+            if not args.rglb or not args.rgpl or not args.rgsm or not args.rglb:
+                stop_err( 'If you want to specify read groups, you must include the ID, LB, PL, and SM tags.' )
+            # readGroup = '@RG\tID:%s\tLB:%s\tPL:%s\tSM:%s' % ( args.rgid, args.rglb, args.rgpl, args.rgsm )
+            readGroup = '@RG\tID:%s\tLB:%s\tPL:%s\tSM:%s' % ( args.rgid, args.rglb, args.rgpl, args.rgsm )
+            if args.rgpu:
+                readGroup += '\tPU:%s' % args.rgpu
+            if args.rgcn:
+                readGroup += '\tCN:%s' % args.rgcn
+            if args.rgds:
+                readGroup += '\tDS:%s' % args.rgds
+            if args.rgdt:
+                readGroup += '\tDT:%s' % args.rgdt
+            if args.rgfo:
+                readGroup += '\tFO:%s' % args.rgfo
+            if args.rgks:
+                readGroup += '\tKS:%s' % args.rgks
+            if args.rgpg:
+                readGroup += '\tPG:%s' % args.rgpg
+            if args.rgpi:
+                readGroup += '\tPI:%s' % args.rgpi
+            end_cmds += ' -R "%s" ' % readGroup
+
+        if args.interPairEnd:
+            end_cmds += '-p %s ' % args.interPairEnd
+        if args.mark:
+            end_cmds += '-M '
+
+
+    if args.genAlignType == 'paired':
+        cmd = 'bwa mem %s %s %s %s %s > %s' % ( start_cmds, ref_file_name, fastq, rfastq, end_cmds, args.output )
+    else:
+        cmd = 'bwa mem %s %s %s > %s' % ( start_cmds, ref_file_name, fastq, end_cmds, args.output )
+
+  # perform alignments
+    buffsize = 1048576
+    try:
+        # need to nest try-except in try-finally to handle 2.4
+        try:
+            try:
+                tmp = tempfile.NamedTemporaryFile( dir=tmp_dir ).name
+                tmp_stderr = open( tmp, 'wb' )
+		print "The cmd is %s" % cmd
+                proc = subprocess.Popen( args=cmd, shell=True, cwd=tmp_dir, stderr=tmp_stderr.fileno() )
+                returncode = proc.wait()
+                tmp_stderr.close()
+                # get stderr, allowing for case where it's very large
+                tmp_stderr = open( tmp, 'rb' )
+                stderr = ''
+                try:
+                    while True:
+                        stderr += tmp_stderr.read( buffsize )
+                        if not stderr or len( stderr ) % buffsize != 0:
+                            break
+                except OverflowError:
+                    pass
+                tmp_stderr.close()
+                if returncode != 0:
+                    raise Exception, stderr
+            except Exception, e:
+                raise Exception, 'Error generating alignments. ' + str( e ) 
+
+            # check that there are results in the output file
+            if os.path.getsize( args.output ) > 0:
+                sys.stdout.write( 'BWA run on %s-end data' % args.genAlignType )
+            else:
+                raise Exception, 'The output file is empty. You may simply have no matches, or there may be an error with your input file or settings.'
+        except Exception, e:
+            stop_err( 'The alignment failed.\n' + str( e ) )
+    finally:
+        # clean up temp dir
+        if os.path.exists( tmp_index_dir ):
+            shutil.rmtree( tmp_index_dir )
+        if os.path.exists( tmp_dir ):
+            shutil.rmtree( tmp_dir )
+
+if __name__=="__main__": __main__()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bwa_0_7_5/bwa_0_7_5.xml	Mon Aug 12 08:44:05 2013 -0400
@@ -0,0 +1,186 @@
+<tool id="bwa_0_7_5" name="Map with BWA (Version 0.7.5)" version="0.7.5">
+  <requirements>
+    <requirement type="package" version="0.7.5">bwa</requirement>
+  </requirements>
+  <description>This new version BWA (0.7.5) use 'mem' algorithm for mapping, dosen't need 'aln', 'samse', 'sampe' and picard AddOrReplace anymore.</description>
+  <parallelism method="basic"></parallelism>
+  <command interpreter="python">
+    bwa_0_7_5.py 
+      --threads="1"
+      --fileSource="${genomeSource.refGenomeSource}"
+      #if $genomeSource.refGenomeSource == "history":
+        ##build index on the fly
+        --ref="${genomeSource.ownFile}"
+        --dbkey="${dbkey}"
+      #else:
+        ##use precomputed indexes
+        --ref="${genomeSource.indices.fields.path}"
+      #end if
+
+      ## input file(s)
+      --fastq="${paired.fastq}"
+      #if $paired.sPaired == "paired":
+        --rfastq="${paired.rfastq}"
+      #end if
+
+      ## output file
+      --output="${output}"
+
+      ## run parameters
+      --genAlignType="${paired.sPaired}"
+      --params="${params.source_select}"
+      #if $params.source_select != "pre_set":
+        --minEditDistSeed="${params.minEditDistSeed}"
+        --bandWidth="${params.bandWidth}"
+        --offDiagonal="${params.offDiagonal}"
+        --internalSeeds="${params.internalSeeds}"
+        --seedsOccurrence="${params.seedsOccurrence}"
+        --mateRescue="${params.mateRescue}"
+        --skipPairing="${params.skipPairing}"
+        --seqMatch="${params.seqMatch}"
+        --mismatch="${params.mismatch}"
+        --gapOpen="${params.gapOpen}"
+        --gapExtension="${params.gapExtension}"
+        --clipping="${params.clipping}"
+        --unpairedReadpair="${params.unpairedReadpair}"
+        --interPairEnd="${params.interPairEnd}"
+        --minScore="${params.minScore}"
+        --mark="${params.mark}"
+
+        #if $params.readGroup.specReadGroup == "yes"
+          --rgid="${params.readGroup.rgid}"
+          --rgsm="${params.readGroup.rgsm}"
+          --rgpl="${params.readGroup.rgpl}"
+          --rglb="${params.readGroup.rglb}"
+          --rgpu="${params.readGroup.rgpu}"
+          --rgcn="${params.readGroup.rgcn}"
+          --rgds="${params.readGroup.rgds}"
+          --rgdt="${params.readGroup.rgdt}"
+          --rgfo="${params.readGroup.rgfo}"
+          --rgks="${params.readGroup.rgks}"
+          --rgpg="${params.readGroup.rgpg}"
+          --rgpi="${params.readGroup.rgpi}"
+        #end if
+      #end if
+  </command>
+
+  <inputs>
+    <conditional name="genomeSource">
+      <param name="refGenomeSource" type="select" label="Will you select a reference genome from your history or use a built-in index?">
+        <option value="indexed">Use a built-in index</option>
+        <option value="history">Use one from the history</option>
+      </param>
+      <when value="indexed">
+        <param name="indices" type="select" label="Select a reference genome">
+          <options from_data_table="bwa_indexes">
+            <filter type="sort_by" column="2" />
+            <validator type="no_options" message="No indexes are available" />
+          </options>
+        </param>
+      </when>
+      <when value="history">
+        <param name="ownFile" type="data" format="fasta" metadata_name="dbkey" label="Select a reference from history" />
+      </when>
+    </conditional>
+    <conditional name="paired">
+      <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="fastq" type="data" format="fastqsanger,fastqillumina" label="FASTQ file" help="FASTQ with either Sanger-scaled quality values (fastqsanger) or Illumina-scaled quality values (fastqillumina)" />
+      </when>
+      <when value="paired">
+        <param name="fastq" type="data" format="fastqsanger,fastqillumina" label="Forward FASTQ file" help="FASTQ with either Sanger-scaled quality values (fastqsanger) or Illumina-scaled quality values (fastqillumina)" />
+        <param name="rfastq" type="data" format="fastqsanger,fastqillumina" label="Reverse FASTQ file" help="FASTQ with either Sanger-scaled quality values (fastqsanger) or Illumina-scaled quality values (fastqillumina)" />
+      </when>
+    </conditional>
+    <conditional name="params">
+      <param name="source_select" type="select" label="BWA settings to use" help="For most mapping needs use Commonly Used settings. If you want full control use Full Parameter List">
+        <option value="pre_set">Commonly Used</option>
+        <option value="full">Full Parameter List</option>
+      </param>
+      <when value="pre_set" />
+      <when value="full">
+        <param name="minEditDistSeed" type="integer" value="19" label="Minimum seed length" />
+        <param name="bandWidth" type="integer" value="100" label="Band width for banded alignment" />
+        <param name="offDiagonal" type="integer" value="100" label="off-diagonal X-dropoff" />
+        <param name="internalSeeds" type="float" value="1.5" label="look for internal seeds inside a seed longer than {-k} * FLOAT [1.5]" />
+        <param name="seedsOccurrence" type="integer" value="10000" label="skip seeds with more than INT occurrences" />
+        <param name="mateRescue" type="boolean" truevalue="True" falsevalue="False" checked="False" label="skip seeds with more than INT occurrences" />
+        <param name="skipPairing" type="boolean" truevalue="True" falsevalue="False" checked="False" label="skpe pairing, mate rescue performed unless -S also in use" />
+        <param name="seqMatch" type="integer" value="1" label="score of a sequence match" />
+        <param name="mismatch" type="integer" value="4" label="penalty for a mismatch" />
+        <param name="gapOpen" type="integer" value="6" label="gap open penalty" />
+        <param name="gapExtension" type="text" value="None" label="gap extension penalty; a gap of size k cost {-O} + {-E}*k [1]" />
+        <param name="clipping" type="integer" value="5" label="penalty for clipping" />
+        <param name="unpairedReadpair" type="integer" value="17" label="penalty for an unpaired read pair" />
+        <param name="interPairEnd" type="boolean" truevalue="True" falsevalue="False" checked="False" label="first query file consists of interleaved paired-end sequences" />
+        <param name="minScore" type="integer" value="30" label="minimum score to output" />
+        <param name="mark" type="boolean" truevalue="True" falsevalue="False" checked="False" label="mark shorter split hits as secondary (for Picard/GATK compatibility)" />
+
+        <conditional name="readGroup">
+          <param name="specReadGroup" type="select" label="Specify the read group for this file? (samse/sampe -r)">
+            <option value="yes">Yes</option>
+            <option value="no" selected="True">No</option>
+          </param>
+          <when value="yes">
+            <param name="rgid" type="text" size="25" label="[Essential]Read group identifier (ID). Each @RG line must have a unique ID. The value of ID is used in the RG 
+tags of alignment records. Must be unique among all read groups in header section." help="Required if RG specified. Read group 
+IDs may be modified when merging SAM files in order to handle collisions." />
+            <param name="rgpl" type="text" size="25" label="[Essential]Platform/technology used to produce the reads (PL)" help="Required if RG specified. Valid values : CAPILLARY, LS454, ILLUMINA, 
+SOLID, HELICOS, IONTORRENT and PACBIO" />
+            <param name="rglb" type="text" size="25" label="[Essential]Library name (LB)" help="Required if RG specified" />
+            <param name="rgsm" type="text" size="25" label="[Essential]Sample (SM)" help="Required if RG specified. Use pool name where a pool is being sequenced" />
+            <param name="rgpu" type="text" size="25" label="Platform unit (PU)" help="Optional. Unique identifier (e.g. flowcell-barcode.lane for Illumina or slide for SOLiD)" />
+            <param name="rgcn" type="text" size="25" label="Sequencing center that produced the read (CN)" help="Optional" />
+            <param name="rgds" type="text" size="25" label="Description (DS)" help="Optional" />
+            <param name="rgdt" type="text" size="25" label="Date that run was produced (DT)" help="Optional. ISO8601 format date or date/time, like YYYY-MM-DD" />
+            <param name="rgfo" type="text" size="25" label="Flow order (FO). The array of nucleotide bases that correspond to the nucleotides used for each 
+flow of each read." help="Optional. Multi-base flows are encoded in IUPAC format, and non-nucleotide flows by 
+various other characters. Format : /\*|[ACMGRSVTWYHKDBN]+/" />
+            <param name="rgks" type="text" size="25" label="The array of nucleotide bases that correspond to the key sequence of each read (KS)" help="Optional" />
+            <param name="rgpg" type="text" size="25" label="Programs used for processing the read group (PG)" help="Optional" />
+            <param name="rgpi" type="text" size="25" label="Predicted median insert size (PI)" help="Optional" />
+          </when>
+          <when value="no" />
+        </conditional>
+      </when>
+    </conditional>
+  </inputs>
+
+  <outputs>
+    <data format="sam" name="output" label="${tool.name} on ${on_string}: mapped reads">
+      <actions>
+        <conditional name="genomeSource.refGenomeSource">
+          <when value="indexed">
+            <action type="metadata" name="dbkey">
+              <option type="from_data_table" name="bwa_indexes" column="1">
+                <filter type="param_value" column="0" value="#" compare="startswith" keep="False"/>
+                <filter type="param_value" ref="genomeSource.indices" column="0"/>
+              </option>
+            </action>
+          </when>
+          <when value="history">
+            <action type="metadata" name="dbkey">
+              <option type="from_param" name="genomeSource.ownFile" param_attribute="dbkey" />
+            </action>
+          </when>
+        </conditional>
+      </actions>
+    </data>
+  </outputs>
+
+  <tests>
+    <test>
+    </test>
+    <test>
+    </test>
+    <test>
+    </test>
+  </tests> 
+  
+
+</tool>
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bwa_0_7_5/tool-data/bwa_index.loc	Mon Aug 12 08:44:05 2013 -0400
@@ -0,0 +1,38 @@
+#This is a sample file distributed with Galaxy that enables tools
+#to use a directory of BWA indexed sequences data files. You will need
+#to create these data files and then create a bwa_index.loc file
+#similar to this one (store it in this directory) that points to
+#the directories in which those files are stored. The bwa_index.loc
+#file has this format (longer white space characters are TAB characters):
+#
+#<unique_build_id>   <dbkey>   <display_name>   <file_path>
+#
+#So, for example, if you had phiX indexed stored in 
+#/depot/data2/galaxy/phiX/base/, 
+#then the bwa_index.loc entry would look like this:
+#
+#phiX174   phiX   phiX Pretty   /depot/data2/galaxy/phiX/base/phiX.fa
+#
+#and your /depot/data2/galaxy/phiX/base/ directory
+#would contain phiX.fa.* files:
+#
+#-rw-r--r--  1 james    universe 830134 2005-09-13 10:12 phiX.fa.amb
+#-rw-r--r--  1 james    universe 527388 2005-09-13 10:12 phiX.fa.ann
+#-rw-r--r--  1 james    universe 269808 2005-09-13 10:12 phiX.fa.bwt
+#...etc...
+#
+#Your bwa_index.loc file should include an entry per line for each
+#index set you have stored. The "file" in the path does not actually
+#exist, but it is the prefix for the actual index files.  For example:
+#
+#phiX174				phiX	phiX174			/depot/data2/galaxy/phiX/base/phiX.fa
+#hg18canon				hg18	hg18 Canonical	/depot/data2/galaxy/hg18/base/hg18canon.fa
+#hg18full				hg18	hg18 Full		/depot/data2/galaxy/hg18/base/hg18full.fa
+#/orig/path/hg19.fa		hg19	hg19			/depot/data2/galaxy/hg19/base/hg19.fa
+#...etc...
+#
+#Note that for backwards compatibility with workflows, the unique ID of
+#an entry must be the path that was in the original loc file, because that
+#is the value stored in the workflow for that parameter. That is why the
+#hg19 entry above looks odd. New genomes can be better-looking.
+#