Commit 9e887666 authored by Takadonet's avatar Takadonet

current smalt version that produces bam instead of sam outputs using samtools 0.1.18.

parent d334b0ed
<tool id="smalt_index" name="smalt index" version="1.0.0">
<requirements>
<requirement type="package" version="0.7.5">smalt</requirement>
</requirements>
<command>
smalt index
#if $k:
-k "$k"
#end if
#if $s:
-s "$s"
#end if
'temp' "$reference"
</command>
<description>Index a reference </description>
<inputs>
<param name="reference" type="data" format="fasta" label="Fasta reference file"/>
<param name="k" type="integer" value="13" label="K-mer size" help="Specifies the word length. [wordlen] is an integer within the limits. between 3 and 20. The default word length is 13" max="20" min="3"/>
<param name="s" type="integer" optional="true" label="Step size" help="Specifies how many bases are skipped between indexed words."/>
</inputs>
<outputs>
<data name="output" label="SMI" from_work_dir="temp.smi"/>
<data name="output2" label="SMA" from_work_dir="temp.sma"/>
</outputs>
<stdio>
<exit_code range="1:" level="fatal" description="Unknown error" />
</stdio>
<help>
**What it does**
Generates an index of k-mer words for the genomic reference sequences. The words are of fixed length &#060;wordlen&#062; and are sampled at equidistant steps &#060;stepsiz&#062; bases apart. The reference sequences are provided in a single file &#060;reference_file&#062; in FASTA or FASTQ format. Two binary files are output. The file &#060;index_name&#062;.sma contains the reference sequences in compressed form. The file &#060;index_name&#062;.smi contains the k-mer word index.
------
Please cite the website "http://www.sanger.ac.uk/resources/software/smalt/".
------
-k &#060;wordlen&#062;
Specifies the word length. &#060;wordlen&#062; is an integer within the limits
3 &#060; wordlen &#060;= 20. The default word length is 13.
-s &#060;stepsiz&#062;
Specifies how many bases are skipped between indexed words. With '-s 1'
every k-mer word along the reference sequences is indexed. With '-s 2'
every other word is indexed etc. By default the step size is set equal
to the word length (tiling words).
</help>
</tool>
<?xml version="1.0"?>
<tool_dependency>
<package name="smalt" version="0.7.5">
<repository name="package_smalt_0_7_5" owner="jen-cabral" />
</package>
</tool_dependency>
#/bin/bash
smi=$1
shift
sma=$1
shift
#get format type so we can do extra work if it is a bam file
format=$1
shift
#get working directory so we can find the output files
CUR_DIR=`pwd`
cp "$smi" "$CUR_DIR/temp.smi"
cp "$sma" "$CUR_DIR/temp.sma"
#determine if we have 1 or 2
num_inputs=$1
shift
inputs=()
#determine how many fasta/fastq were given. Needs to be provided by user
if [ $num_inputs -eq 1 ]; then
inputs+=$1
shift
elif [ $num_inputs -eq 2 ]; then
inputs+=$1
shift
inputs+=' '
inputs+=$1
shift
else
exit 1
fi
smaltout=$2
smalt map $@ 'temp' $inputs
if [ "$format" == "bam" ]; then
samtools sort $smaltout 'temp2'
mv 'temp2.bam' $smaltout
fi
#remove index files
rm "$CUR_DIR/temp.smi"
rm "$CUR_DIR/temp.sma"
exit 0
This diff is collapsed.
<?xml version="1.0"?>
<tool_dependency>
<package name="smalt" version="0.7.5">
<repository name="package_smalt_0_7_5" owner="jen-cabral" />
</package>
<package name="samtools" version="0.1.18">
<repository name="package_samtools_0_18" owner="phil"/>
</package>
</tool_dependency>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment