comparison repenrich.xml @ 4:d359ec9f0fe1 draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/repenrich commit 0ec9810f3c05456fa8f19329a56eb1db32e218e5
author drosofff
date Tue, 30 May 2017 19:52:36 -0400
parents 1805b262c12d
children ea5bba2c569f
comparison
equal deleted inserted replaced
3:1805b262c12d 4:d359ec9f0fe1
1 <tool id="repenrich" name="RepEnrich" version="1.1.0"> 1 <tool id="repenrich" name="RepEnrich" version="1.2.0">
2 <description>Repeat Element Profiling</description> 2 <description>Repeat Element Profiling</description>
3 <requirements> 3 <requirements>
4 <requirement type="package" version="1.2.0">bowtie</requirement> 4 <requirement type="package" version="1.2.0">bowtie</requirement>
5 <requirement type="package" version="0.1.19">samtools</requirement> 5 <requirement type="package" version="0.1.19">samtools</requirement>
6 <requirement type="package" version="2.20.1">bedtools</requirement> 6 <requirement type="package" version="2.20.1">bedtools</requirement>
9 <stdio> 9 <stdio>
10 <exit_code range="1:" level="fatal" description="Tool exception" /> 10 <exit_code range="1:" level="fatal" description="Tool exception" />
11 </stdio> 11 </stdio>
12 <command detect_errors="exit_code"><![CDATA[ 12 <command detect_errors="exit_code"><![CDATA[
13 #import re 13 #import re
14 #set input_base = re.sub('\.fastq$', '', str($input_fastq.element_identifier)) 14 #set input_base = 'Sample'
15 #set baseReference = re.sub('[^\w\-]', '_', str($genome.element_identifier)) 15 #set baseReference = 'Genome'
16 #set baseReference = re.sub('.fa$', '', $baseReference)
17 ln -f -s '$genome' '${baseReference}.fa' && 16 ln -f -s '$genome' '${baseReference}.fa' &&
18 ln -f -s '$input_fastq' '${input_base}.fastq' && 17 ln -f -s '$input_fastq' '${input_base}.fastq' &&
18 #if $seq_method.seq_method_list == "paired-end":
19 ln -f -s '$input2_fastq' '${input_base}_2.fastq' &&
20 #end if
19 bowtie-build '$genome' ${baseReference} && 21 bowtie-build '$genome' ${baseReference} &&
20 python $__tool_directory__/RepEnrich_setup.py $repeatmasker ${baseReference}.fa setup_folder_${baseReference} && 22 python $__tool_directory__/RepEnrich_setup.py $repeatmasker ${baseReference}.fa setup_folder_${baseReference} &&
21 bowtie $baseReference -p \${GALAXY_SLOTS:-4} -t -m 1 -S --max ${input_base}_multimap.fastq ${input_base}.fastq ${input_base}_unique.sam 2>bowtie_alignments.txt && 23 #if $seq_method.seq_method_list == "single-read":
22 ALIGNED=\$(grep 'reads with at least one' bowtie_alignments.txt | cut -d ' ' -f 9) && 24 bowtie $baseReference -p \${GALAXY_SLOTS:-4} -t -m 1 -S --max ${input_base}_multimap.fastq ${input_base}.fastq ${input_base}_unique.sam 2>bowtie_alignments.txt &&
23 NONALIGNED=\$(grep 'reads that failed to align:' bowtie_alignments.txt | cut -d ' ' -f 7) && 25 TOTAL=\$(grep 'reads processed:' bowtie_alignments.txt | cut -d ' ' -f 4) &&
24 echo \$((\$ALIGNED-\$NONALIGNED)) > bowtie_aligned.numb && 26 NONALIGNED=\$(grep 'reads that failed to align:' bowtie_alignments.txt | cut -d ' ' -f 7) &&
27 echo \$((\$TOTAL-\$NONALIGNED)) > bowtie_aligned.numb &&
28 #else:
29 bowtie $baseReference -p \${GALAXY_SLOTS:-4} -t -m 1 -S --max ${input_base}_multimap.fastq -1 ${input_base}.fastq -2 ${input_base}_2.fastq ${input_base}_unique.sam 2>bowtie_alignments.txt &&
30 TOTAL=\$(grep 'reads processed:' bowtie_alignments.txt | cut -d ' ' -f 4) &&
31 NONALIGNED=\$(grep 'reads that failed to align:' bowtie_alignments.txt | cut -d ' ' -f 7) &&
32 echo \$((\$TOTAL-\$NONALIGNED)) > bowtie_aligned.numb &&
33 #end if
25 samtools view -bS ${input_base}_unique.sam > ${input_base}_unique.bam && 34 samtools view -bS ${input_base}_unique.sam > ${input_base}_unique.bam &&
26 samtools sort ${input_base}_unique.bam ${input_base}_unique_sorted && 35 samtools sort ${input_base}_unique.bam ${input_base}_unique_sorted &&
27 mv ${input_base}_unique_sorted.bam ${input_base}_unique.bam && 36 mv ${input_base}_unique_sorted.bam ${input_base}_unique.bam &&
28 samtools index ${input_base}_unique.bam && 37 samtools index ${input_base}_unique.bam &&
29 rm ${input_base}_unique.sam && 38 rm ${input_base}_unique.sam &&
30 python $__tool_directory__/RepEnrich.py $repeatmasker ${input_base} ${input_base} setup_folder_${baseReference} ${input_base}_multimap.fastq ${input_base}_unique.bam --cpus "\${GALAXY_SLOTS:-4}" && 39 #if $seq_method.seq_method_list == "single-read":
40 python $__tool_directory__/RepEnrich.py $repeatmasker ${input_base} ${input_base} setup_folder_${baseReference} ${input_base}_multimap.fastq ${input_base}_unique.bam --cpus "\${GALAXY_SLOTS:-4}" &&
41 #else:
42 python $__tool_directory__/RepEnrich.py $repeatmasker ${input_base} ${input_base} setup_folder_${baseReference} ${input_base}_multimap_1.fastq --fastqfile2 ${input_base}_multimap_2.fastq ${input_base}_unique.bam --cpus "\${GALAXY_SLOTS:-4}" --pairedend TRUE &&
43 #end if
31 cp $input_base/${input_base}_class_fraction_counts.txt class_fraction_counts.tabular && 44 cp $input_base/${input_base}_class_fraction_counts.txt class_fraction_counts.tabular &&
32 cp $input_base/${input_base}_family_fraction_counts.txt family_fraction_counts.tabular && 45 cp $input_base/${input_base}_family_fraction_counts.txt family_fraction_counts.tabular &&
33 cp $input_base/${input_base}_fraction_counts.txt fraction_counts.tabular 46 cp $input_base/${input_base}_fraction_counts.txt fraction_counts.tabular
34
35 ]]></command> 47 ]]></command>
36 <!-- basic error handling --> 48 <!-- basic error handling -->
37 <inputs> 49 <inputs>
50 <conditional name="seq_method">
51 <param help="Paired-end or single-read sequencing" label="Sequencing method" name="seq_method_list" type="select">
52 <option selected="True" value="single-read">Single-read sequencing</option>
53 <option value="paired-end">Paired-end sequencing</option>
54 </param>
55 <when value="single-read">
56 <param format="fastq,fastqsanger" label="Single-reads" name="input_fastq" type="data" help="accepted formats: fastq, fastqsanger" />
57 </when>
58 <when value="paired-end">
59 <param format="fastq,fastqsanger" label="1st paired-end sequencing dataset" name="input_fastq" type="data" help="accepted formats: fastq, fastqsanger" />
60 <param format="fastq,fastqsanger" label="2nd paired-end sequencing dataset" name="input2_fastq" type="data" help="accepted formats: fastq, fastqsanger" />
61 </when>
62 </conditional>
38 <param format="fasta" label="Reference genome in fasta format" name="genome" type="data" /> 63 <param format="fasta" label="Reference genome in fasta format" name="genome" type="data" />
39 <param format="fastq,fastqsanger" label="Single-reads sequencing dataset" name="input_fastq" type="data" help="accepted formats: fastq, fastqsanger" />
40 <param format="txt" label="RepeatMasker description file" name="repeatmasker" type="data" help="see help section"/> 64 <param format="txt" label="RepeatMasker description file" name="repeatmasker" type="data" help="see help section"/>
41 </inputs> 65 </inputs>
42 66
43 <outputs> 67 <outputs>
44 <data format="tabular" name="bowtie_alignments" label="RepEnrich on ${on_string}: reads aligned" from_work_dir="bowtie_aligned.numb"> 68 <data format="tabular" name="bowtie_alignments" label="RepEnrich on ${on_string}: reads aligned" from_work_dir="bowtie_aligned.numb">
47 </data> 71 </data>
48 <data format="tabular" name="family_fraction_counts" label="RepEnrich on ${on_string}: family fraction counts" from_work_dir="family_fraction_counts.tabular"> 72 <data format="tabular" name="family_fraction_counts" label="RepEnrich on ${on_string}: family fraction counts" from_work_dir="family_fraction_counts.tabular">
49 </data> 73 </data>
50 <data format="tabular" name="fraction_counts" label="RepEnrich on ${on_string}: fraction counts" from_work_dir="fraction_counts.tabular"> 74 <data format="tabular" name="fraction_counts" label="RepEnrich on ${on_string}: fraction counts" from_work_dir="fraction_counts.tabular">
51 </data> 75 </data>
52 </outputs> 76 <data format="tabular" name="bowtieoutput" label="bowtie aligments" from_work_dir="bowtie_alignments.txt">
77 </data>
78 </outputs>
53 79
54 <tests> 80 <tests>
55 <test> 81 <test>
82 <param name="seq_method_list" value="single-read"/>
56 <param name="input_fastq" value="Samp.fastq" ftype="fastq"/> 83 <param name="input_fastq" value="Samp.fastq" ftype="fastq"/>
57 <param name="genome" value="chrM.fa" ftype="fasta"/> 84 <param name="genome" value="chrM.fa" ftype="fasta"/>
58 <param name="repeatmasker" value="chrM_repeatmasker.txt" ftype="txt"/> 85 <param name="repeatmasker" value="chrM_repeatmasker.txt" ftype="txt"/>
59 <output name="bowtie_alignments" file="aligned_reads.tab" ftype="tabular"/> 86 <output name="bowtie_alignments" file="aligned_reads.tab" ftype="tabular"/>
60 <output name="class_fraction_counts" file="Samp_class_fraction_counts.tabular" ftype="tabular"/> 87 <output name="class_fraction_counts" file="Samp_class_fraction_counts.tabular" ftype="tabular"/>