comparison defuse.xml @ 4:679a5c7b1294 draft

deFuse version 0.5.0 - Use tool_dependencies.xml
author Jim Johnson <jj@umn.edu>
date Fri, 04 Jan 2013 13:29:03 -0600
parents c90022a13c7c
children 3bd1087db05e
comparison
equal deleted inserted replaced
3:c90022a13c7c 4:679a5c7b1294
1 <tool id="defuse" name="DeFuse" version="1.2"> 1 <tool id="defuse" name="DeFuse" version="1.5">
2 <description>identify fusion transcripts</description> 2 <description>identify fusion transcripts</description>
3 <requirements> 3 <requirements>
4 <requirement type="binary"></requirement> 4 <requirement type="package" version="0.5.0">defuse</requirement>
5 <requirement type="package">bowtie</requirement>
6 <requirement type="package">blat</requirement>
7 <requirement type="package">fatotwobit</requirement>
5 </requirements> 8 </requirements>
6 <command interpreter="command"> /bin/bash $shscript </command> 9 <command interpreter="command"> /bin/bash $shscript </command>
7 <inputs> 10 <inputs>
8 <param name="left_pairendreads" type="data" format="fastq" label="left part of read pairs" help="The left and right reads pairs must be in the same order, and not have any unpaired reads. (FASTQ interlacer will pair reads and remove the unpaired. FASTQ de-interlacer will separate the result into left and right reads.)"/> 11 <param name="left_pairendreads" type="data" format="fastq" label="left part of read pairs" help="The left and right reads pairs must be in the same order, and not have any unpaired reads. (FASTQ interlacer will pair reads and remove the unpaired. FASTQ de-interlacer will separate the result into left and right reads.)"/>
9 <param name="right_pairendreads" type="data" format="fastq" label="right part of read pairs" help="In the same order as the left reads"/> 12 <param name="right_pairendreads" type="data" format="fastq" label="right part of read pairs" help="In the same order as the left reads"/>
67 <when value="history"> 70 <when value="history">
68 <param name="config" type="data" format="txt" label="Defuse Config file" help=""/> 71 <param name="config" type="data" format="txt" label="Defuse Config file" help=""/>
69 </when> <!-- history --> 72 </when> <!-- history -->
70 </conditional> <!-- refGenomeSource --> 73 </conditional> <!-- refGenomeSource -->
71 <param name="keep_output" type="boolean" checked="true" truevalue="yes" falsevalue="no" label="Save DeFuse working directory files"/> 74 <param name="keep_output" type="boolean" checked="true" truevalue="yes" falsevalue="no" label="Save DeFuse working directory files"/>
72 <param name="do_get_reads" type="boolean" checked="false" truevalue="yes" falsevalue="no" label="Run get_reads on each cluster"/> 75 <param name="do_get_reads" type="boolean" checked="true" truevalue="yes" falsevalue="no" label="Run get_reads on each cluster"/>
73 </inputs> 76 </inputs>
74 <configfiles> 77 <configfiles>
75 <configfile name="defuse_config"> 78 <configfile name="defuse_config">
76 #import ast 79 #import ast
77 #if $refGenomeSource.genomeSource == "history": 80 #if $refGenomeSource.genomeSource == "history":
89 # source_directory = ${__root_dir__}/tools/defuse 92 # source_directory = ${__root_dir__}/tools/defuse
90 source_directory = #slurp 93 source_directory = #slurp
91 #try 94 #try
92 $ref_dict['source_directory'] 95 $ref_dict['source_directory']
93 #except 96 #except
94 #try 97 __DEFUSE_PATH__
95 ## Try to find the defuse source dir in the galaxy tool path
96 #import Cheetah.FileUtils
97 #set $toolpath = '/'.join([$__root_dir__,'tools','defuse'])
98 #set $defuse = $Cheetah.FileUtils.findFiles($toolpath,['defuse.pl'],[],['tools','external','include','em','data'])[0]
99 $defuse.replace('/scripts/defuse.pl','')
100 #except
101 ${__root_dir__}/tools/defuse/defuse
102 #end try
103 #end try 98 #end try
104 99
105 # Directory where you want your dataset 100 # Directory where you want your dataset
106 dataset_directory = #slurp 101 dataset_directory = #slurp
107 #try 102 #try
157 # Paths to external tools 152 # Paths to external tools
158 bowtie_bin = #slurp 153 bowtie_bin = #slurp
159 #try 154 #try
160 $ref_dict['bowtie_bin'] 155 $ref_dict['bowtie_bin']
161 #except 156 #except
162 /soft/bowtie/0.12.7/bowtie 157 __BOWTIE_BIN__
163 #end try 158 #end try
164 bowtie_build_bin = #slurp 159 bowtie_build_bin = #slurp
165 #try 160 #try
166 $ref_dict['bowtie_build_bin'] 161 $ref_dict['bowtie_build_bin']
167 #except 162 #except
168 /soft/bowtie/0.12.7/bowtie-build 163 __BOWTIE_BUILD_BIN__
169 #end try 164 #end try
170 blat_bin = #slurp 165 blat_bin = #slurp
171 #try 166 #try
172 $ref_dict['blat_bin'] 167 $ref_dict['blat_bin']
173 #except 168 #except
174 /soft/blat/34/bin/blat 169 __BLAT_BIN__
175 #end try 170 #end try
176 fatotwobit_bin = #slurp 171 fatotwobit_bin = #slurp
177 #try 172 #try
178 $ref_dict['fatotwobit_bin'] 173 $ref_dict['fatotwobit_bin']
179 #except 174 #except
180 /soft/blat/34/bin/faToTwoBit 175 __FATOTWOBIT_BIN__
181 #end try 176 #end try
182 r_bin = #slurp 177 r_bin = #slurp
183 #try 178 #try
184 $ref_dict['r_bin'] 179 $ref_dict['r_bin']
185 #except 180 #except
186 /project/sdml-sles11-weblocal/R-2.12.1/bin/R 181 __R_BIN__
187 #end try 182 #end try
188 rscript_bin = #slurp 183 rscript_bin = #slurp
189 #try 184 #try
190 $ref_dict['rscript_bin'] 185 $ref_dict['rscript_bin']
191 #except 186 #except
192 /project/sdml-sles11-weblocal/R-2.12.1/bin/Rscript 187 __RSCRIPT_BIN__
193 #end try 188 #end try
194 189
195 #raw 190 #raw
196 # Dataset files 191 # Dataset files
197 dataset_prefix = $(dataset_directory)/defuse 192 dataset_prefix = $(dataset_directory)/defuse
497 </configfile> 492 </configfile>
498 <configfile name="shscript"> 493 <configfile name="shscript">
499 #!/bin/bash 494 #!/bin/bash
500 ## define some things for cheetah proccessing 495 ## define some things for cheetah proccessing
501 #set $ds = chr(36) 496 #set $ds = chr(36)
497 #set $amp = chr(38)
502 #set $gt = chr(62) 498 #set $gt = chr(62)
503 #set $lt = chr(60) 499 #set $lt = chr(60)
504 #set $echo_cmd = 'echo' 500 #set $echo_cmd = 'echo'
505 ## Find the defuse.pl in the galaxy tool path 501 ## Find the defuse.pl in the galaxy tool path
506 #import Cheetah.FileUtils 502 #import Cheetah.FileUtils
507 #set $toolpath = '/'.join([$__root_dir__,'tools','defuse'])
508 #set $defuse = $Cheetah.FileUtils.findFiles($toolpath,['defuse.pl'],[],['tools','external','include','em','data'])[0]
509 #set $get_reads = $Cheetah.FileUtils.findFiles($toolpath,['get_reads.pl'],[],['tools','external','include','em','data'])[0]
510 ## declare a bash function for converting a results tsv into html with links to the get_reads output files 503 ## declare a bash function for converting a results tsv into html with links to the get_reads output files
511 results2html() { 504 results2html() {
512 rlts=${ds}1 505 rlts=${ds}1
513 rslt_name=`basename ${ds}rlts` 506 rslt_name=`basename ${ds}rlts`
514 html=${ds}2 507 html=${ds}2
529 echo '${lt}/table${gt}' ${gt}${gt} ${ds}html 522 echo '${lt}/table${gt}' ${gt}${gt} ${ds}html
530 echo '${lt}/body${gt}${lt}/html${gt}' ${gt}${gt} ${ds}html 523 echo '${lt}/body${gt}${lt}/html${gt}' ${gt}${gt} ${ds}html
531 for i in `awk '${ds}1 ~ /[1-9][0-9]*/{print ${ds}1}' ${ds}rlts`; 524 for i in `awk '${ds}1 ~ /[1-9][0-9]*/{print ${ds}1}' ${ds}rlts`;
532 do fn=cluster_${ds}{i}_reads.txt; 525 do fn=cluster_${ds}{i}_reads.txt;
533 pn=${ds}_EFP/${ds}fn; 526 pn=${ds}_EFP/${ds}fn;
534 perl $get_reads -c $defuse_config -o output_dir -i ${ds}i ${gt} ${ds}pn; 527 perl \${DEFUSE_PATH}/scripts/get_reads.pl -c $defuse_config -o output_dir -i ${ds}i ${gt} ${ds}pn;
535 done 528 done
536 fi 529 fi
537 } 530 }
531 ## substitute pathnames into config file
532 if `grep __DEFUSE_PATH__ $defuse_config ${gt} /dev/null`;then sed -i'.tmp' "s#__DEFUSE_PATH__#\${DEFUSE_PATH}#" $defuse_config; fi
533 if `grep __SAMTOOLS_BIN__ $defuse_config ${gt} /dev/null` ${amp}${amp} SAMTOOLS_BIN=`which samtools`;then sed -i'.tmp' "s#__SAMTOOLS_BIN__#\${SAMTOOLS_BIN}#" $defuse_config; fi
534 if `grep __BOWTIE_BIN__ $defuse_config ${gt} /dev/null` ${amp}${amp} BOWTIE_BIN=`which bowtie`;then sed -i'.tmp' "s#__BOWTIE_BIN__#\${BOWTIE_BIN}#" $defuse_config; fi
535 if `grep __BOWTIE_BUILD_BIN__ $defuse_config ${gt} /dev/null` ${amp}${amp} BOWTIE_BUILD_BIN=`which bowtie-build`;then sed -i'.tmp' "s#__BOWTIE_BUILD_BIN__#\${BOWTIE_BUILD_BIN}#" $defuse_config; fi
536 if `grep __BLAT_BIN__ $defuse_config ${gt} /dev/null` ${amp}${amp} BLAT_BIN=`which blat`;then sed -i'.tmp' "s#__BLAT_BIN__#\${BLAT_BIN}#" $defuse_config; fi
537 if `grep __FATOTWOBIT_BIN__ $defuse_config ${gt} /dev/null` ${amp}${amp} FATOTWOBIT_BIN=`which faToTwoBit`;then sed -i'.tmp' "s#__FATOTWOBIT_BIN__#\${FATOTWOBIT_BIN}#" $defuse_config; fi
538 if `grep __R_BIN__ $defuse_config ${gt} /dev/null` ${amp}${amp} R_BIN=`which R`;then sed -i'.tmp' "s#__R_BIN__#\${R_BIN}#" $defuse_config; fi
539 if `grep __RSCRIPT_BIN__ $defuse_config ${gt} /dev/null` ${amp}${amp} RSCRIPT_BIN=`which Rscript`;then sed -i'.tmp' "s#__RSCRIPT_BIN__#\${RSCRIPT_BIN}#" $defuse_config; fi
540
541
538 ## copy config to output 542 ## copy config to output
539 cp $defuse_config $config_txt 543 cp $defuse_config $config_txt
540 ## make a data_dir and ln -s the input fastq 544 ## make a data_dir and ln -s the input fastq
541 mkdir -p data_dir 545 mkdir -p data_dir
542 ln -s $left_pairendreads data_dir/reads_1.fastq 546 ln -s $left_pairendreads data_dir/reads_1.fastq
547 ln -s $defuse_out.extra_files_path output_dir 551 ln -s $defuse_out.extra_files_path output_dir
548 #else 552 #else
549 mkdir -p output_dir 553 mkdir -p output_dir
550 #end if 554 #end if
551 ## run defuse.pl 555 ## run defuse.pl
552 perl $defuse -c $defuse_config -d data_dir -o output_dir -p 8 556 perl \${DEFUSE_PATH}/scripts/defuse.pl -c $defuse_config -d data_dir -o output_dir -p 8
553 ## copy primary results to output datasets 557 ## copy primary results to output datasets
554 if [ -e output_dir/log/defuse.log ]; then cp output_dir/log/defuse.log $defuse_log; fi 558 if [ -e output_dir/log/defuse.log ]; then cp output_dir/log/defuse.log $defuse_log; fi
555 if [ -e output_dir/results.tsv ]; then cp output_dir/results.tsv $results_tsv; fi 559 if [ -e output_dir/results.tsv ]; then cp output_dir/results.tsv $results_tsv; fi
556 if [ -e output_dir/results.filtered.tsv ]; then cp output_dir/results.filtered.tsv $results_filtered_tsv; fi 560 if [ -e output_dir/results.filtered.tsv ]; then cp output_dir/results.filtered.tsv $results_filtered_tsv; fi
557 if [ -e output_dir/results.classify.tsv ]; then cp output_dir/results.classify.tsv $results_classify_tsv; fi 561 if [ -e output_dir/results.classify.tsv ]; then cp output_dir/results.classify.tsv $results_classify_tsv; fi