Mercurial > repos > cmonjeau > takeabreak
changeset 0:dbd6e370c891
Imported from capsule None
author | cmonjeau |
---|---|
date | Fri, 05 Jun 2015 11:40:02 -0400 |
parents | |
children | 3ec608585f02 |
files | TakeABreak.xml TakeABreak_wrapper.py tool_dependencies.xml |
diffstat | 3 files changed, 185 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TakeABreak.xml Fri Jun 05 11:40:02 2015 -0400 @@ -0,0 +1,96 @@ +<tool id="takeabreak" name="TakeABreak" version="1.1.0"> + <description>is a tool that can detect inversion breakpoints directly from raw NGS reads</description> + <requirements> + <requirement type="package" version="1.1.0">takeabreak</requirement> + </requirements> +<command interpreter="python"> +TakeABreak_wrapper.py +#if str( $options_usage.options_usage_selector ) == "graph" +-g $options_usage.graph_file +#end if +#if str( $options_usage.options_usage_selector ) == "reads" +-i $options_usage.data_files +-k $options_usage.kmer +-S $options_usage.kmersolid +#end if +-c $complexity +-m $maxsimprct +-r $optimization_param +--output_graph $output_graph +--output_fasta $output_fasta +--output_log $output_log +</command> + + <inputs> + <!-- Input data files --> + <conditional name="options_usage"> + <param name="options_usage_selector" type="select" label="Select your usage"> + <option value="reads" selected="true">Raw reads</option> + <option value="graph">Previously generated de Bruijn graph</option> + </param> + <when value="reads"> + <param name="data_files" type="data" multiple="true" format="fasta" label="Read file" help="Raw reads as input" /> + <param name="kmer" type="integer" label="length of the k-mers" value="31" help="Set the length of used kmers" /> + <param name="kmersolid" type="integer" label="solidity threshold" value="3" help="abundance threshold for solid kmers" /> + + </when> + <when value="graph"> + <param name="graph_file" type="data" format="h5" label="Graph file" help="De Bruijn graph(s) as input" /> + </when> + </conditional> + <param name="complexity" type="integer" label="local complexity threshold" value="100" help="the local complexity threshold" /> + <param name="maxsimprct" type="integer" label="max similarity percentage" value="80" help="Inversions with a and b' (or u and v') whose longest common subsequence size is bigger than k*(this value)/100 are discarded" /> + <param name="optimization_param" type="integer" label="maximal repeat size" value="8" help="maximal repeat size at the breakpoint. Longest common suffix between a and b" /> + </inputs> + + <outputs> + <data format="fasta" name="output_fasta" label="${tool.name} on ${on_string}: TakeABreak_output.fasta"/> + <data format="h5" name="output_graph" label="${tool.name} on ${on_string}: graph.h5" > + <filter>options_usage['options_usage_selector'] == 'reads'</filter> + </data> + <data format="txt" name="output_log" label="${tool.name} on ${on_string}: log.txt" /> + + </outputs> + <help> + +**Description** + +TakeABreak is a tool that can detect inversion breakpoints directly from raw NGS reads, without the need of any reference genome and without de novo assembling the genomes. Its implementation has a very limited memory impact allowing its usage on common desktop computers and acceptable runtime (Illumina reads simulated at 2x40x coverage from human chromosome 22 can be treated in less than two hours, with less than 1GB of memory). + +------- + +**Web site** + +http://colibread.inria.fr/takeabreak/ + +------- + +**Integrated by** + +Yvan Le Bras and Cyril Monjeaud + +GenOuest Bio-informatics Core Facility + +UMR 6074 IRISA INRIA-CNRS-UR1 Rennes (France) + +support@genouest.org + +If you use this tool in Galaxy, please cite : + +`Y. Le Bras, A. Roult, C. Monjeaud, M. Bahin, O. Quenez, C. Heriveau, A. Bretaudeau, O. Sallou, O. Collin, Towards a Life Sciences Virtual Research Environment : an e-Science initiative in Western France. JOBIM 2013. <https://www.e-biogenouest.org/resources/128>`_ + + </help> +<citations> +<citation type="doi">10.1007/978-3-319-07953-0_10</citation> +<citation type="bibtex">@INPROCEEDINGS{JOBIM2013, + author = {Le Bras, Y. and ROULT, A. and Monjeaud, C. and Bahin, M. and Quenez, O. and Heriveau, C. and Bretaudeau, A. and Sallou, O. and Collin, O.}, + title = {Towards a Life Sciences Virtual Research Environment: An e-Science initiative in Western France}, + booktitle = {JOBIM 2013 Proceedings}, + year = {2013}, + url = {https://www.e-biogenouest.org/resources/128}, + pages = {97-106} + }</citation> +</citations> + +</tool> +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TakeABreak_wrapper.py Fri Jun 05 11:40:02 2015 -0400 @@ -0,0 +1,83 @@ +import sys, tempfile, subprocess, glob +import os, re, shutil +import optparse +from os.path import basename + +""" + +Created by Cyril Monjeaud +Cyril.Monjeaud@irisa.fr + +WARNING : + +TakeABreak_wrapper.py needs: + +- dbgh5 & TakeABreak binaries in your $PATH + +All these files are available after compiling the sources of TakeABreak : + +http://colibread.inria.fr/files/2014/01/TakeABreak-1.1.0-Source.tar_.gz + +or with the package_takeabreak dependency in the toolshed + +""" + +def __main__(): + + # create a special dir inside job working dir + tmp_dir = tempfile.mkdtemp() + os.chdir(tmp_dir) + + # retrieve arguments + parser = optparse.OptionParser() + parser.add_option("-i", dest="reads_files") + parser.add_option("-k", dest="kmer") + parser.add_option("-S", dest="kmersolid") + + parser.add_option("-g", dest="graph_file") + parser.add_option("-c", dest="complexity") + parser.add_option("-m", dest="maxsimprct") + parser.add_option("-r", dest="optimization") + + parser.add_option("--output_graph") + parser.add_option("--output_fasta") + parser.add_option("--output_log") + + (options, args) = parser.parse_args() + + cmd_line=[] + if options.reads_files: + # start the command line + cmd_line.append("TakeABreak") + cmd_line.extend(["-in",options.reads_files,"-kmer-size",options.kmer,"-abundance",options.kmersolid]) + else: + # start the command line + os.symlink(options.graph_file, "graph.h5") + cmd_line.append("TakeABreak") + cmd_line.extend(["-graph", "graph.h5"]) + + cmd_line.extend(["-out","galaxy","-lct",options.complexity,"-max-sim",options.maxsimprct,"-repeat",options.optimization]) + + # execute command line + p=subprocess.Popen(cmd_line, + stdout=subprocess.PIPE,stderr=subprocess.PIPE) + + stdoutput, stderror = p.communicate() + + # log file + logfile=open(options.output_log, "w") + logfile.write("[COMMAND LINE]"+' '.join(cmd_line)+"\n\n") + logfile.write(stdoutput) + logfile.write(stderror) + logfile.close() + + if options.reads_files: + + # create output h5 + shutil.copy("galaxy.h5", options.output_graph) + + # create output fasta + shutil.copy("galaxy.fasta", options.output_fasta) + +if __name__ == "__main__": __main__() +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool_dependencies.xml Fri Jun 05 11:40:02 2015 -0400 @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<tool_dependency> + <package name="takeabreak" version="1.1.0"> + <repository name="package_takeabreak" owner="cmonjeau" toolshed="https://toolshed.g2.bx.psu.edu" /> + </package> +</tool_dependency>