# HG changeset patch # User crs4 # Date 1394019875 18000 # Node ID bad8a51514ddbb3986eea0ba1bf51b73cf8caf60 # Parent f77ce4f92b46593eb1f31ae3687502b4157cd758 Directly call edge.pl, remove edge_pro.py . Move minimun and maximum insert size params to paired library section. Update Orione citation. diff -r f77ce4f92b46 -r bad8a51514dd edge_pro.py --- a/edge_pro.py Fri Jan 31 05:44:03 2014 -0500 +++ b/edge_pro.py Wed Mar 05 06:44:35 2014 -0500 @@ -1,77 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Wrapper for EDGE - Gene expression in Prokaryotes -Author: Paolo Uva paolo dot uva at crs4 dot it -Date: March 18, 2013 -""" - -import glob -import optparse -import os -import shutil -import subprocess -import tempfile -import sys - -def __main__(): - # Parse Command Line - parser = optparse.OptionParser() - # Input - parser.add_option('-g', '--genome', dest="genome") - parser.add_option('-p', '--ptt', dest="ptt") - parser.add_option('-r', '--rnt', dest="rnt") - parser.add_option('-u', '--input1', dest="input1") - parser.add_option('-v', '--input2', dest="input2") - parser.add_option('-t', '--num-threads', dest="num_threads", type='int') - parser.add_option('-m', '--minInsertSize', dest="minInsertSize", type='int') - parser.add_option('-M', '--maxInsertSize', dest="maxInsertSize", type='int') - parser.add_option('-w', '--window', dest="window", type='int') - parser.add_option('-i', '--utrSize', dest="utrSize", type='int') - parser.add_option('-x', '--similarity', dest="similarity", type='float') - parser.add_option('-c', '--minCoverage', dest="minCoverage", type='int') - parser.add_option('-l', '--readLength', dest="readLength", type='int') - # Output - parser.add_option('--out-aln', dest="out_aln") - parser.add_option('--out-rpkm', dest="out_rpkm") - parser.add_option('--out-log', dest="out_log") - (options, args) = parser.parse_args() - if len(args) > 0: - parser.error('Wrong number of arguments') - - # Build command - input2_flag = '-v %s' % (options.input2) if options.input2 else '' - num_threads_flag = '-t %d' % options.num_threads if options.num_threads is not None else '' - minInsertSize_flag = '-m %d' % options.minInsertSize if options.minInsertSize is not None else '' - maxInsertSize_flag = '-M %d' % options.maxInsertSize if options.maxInsertSize is not None else '' - window_flag = '-w %d' % options.window if options.window is not None else '' - utrSize_flag = '-i %d' % options.utrSize if options.utrSize is not None else '' - similarity_flag = '-x %s' % options.similarity if options.similarity is not None else '' - readLength_flag = '-l %d' % (options.readLength) if options.readLength is not None else '' - minCoverage_flag = '-c %d' % options.minCoverage if options.minCoverage is not None else '' - - wd = tempfile.mkdtemp() - try: - prefix = os.path.join(wd, 'out') - cl = 'edge.pl -g %s -p %s -r %s -u %s -o %s %s %s %s %s %s %s %s %s %s' % (options.genome, options.ptt, options.rnt, options.input1, prefix, input2_flag, num_threads_flag, minInsertSize_flag, maxInsertSize_flag, window_flag, utrSize_flag, similarity_flag, readLength_flag, minCoverage_flag) - print "EDGE-pro command to be executed:\n %s" % (cl) - - sout = open(options.out_log, 'w') if options.out_log else sys.stdout - try: - subprocess.check_call(cl, stdout=sout, stderr=subprocess.STDOUT, shell=True) # need to redirect stderr because edge.pl calls bowtie2 and count which write some logging info there - finally: - if sout != sys.stdout: - sout.close() - - # Move alignment file - shutil.move(prefix + '.alignments', options.out_aln) - # Concatenate multiple RPKM files together - with open(options.out_rpkm, 'wb') as destination: - for filename in glob.iglob(prefix + '.rpkm_*'): - with open(filename, 'rb') as source: - shutil.copyfileobj(source, destination) - finally: - shutil.rmtree(wd) - - -if __name__ == "__main__": - __main__() diff -r f77ce4f92b46 -r bad8a51514dd edge_pro.xml --- a/edge_pro.xml Fri Jan 31 05:44:03 2014 -0500 +++ b/edge_pro.xml Wed Mar 05 06:44:35 2014 -0500 @@ -1,54 +1,52 @@ - + Gene expression in Prokaryotes bowtie2 edge-pro - - edge_pro.py - --num-threads=\${GALAXY_SLOTS:-4} - + + edge.pl -t \${GALAXY_SLOTS:-4} -o edge_out ## Mandatory input parameters - --genome $genome - --ptt $ptt - --rnt $rnt + -g $genome + -p $ptt + -r $rnt ## First input file always required - --input1 $singlePaired.input1 + -u $singlePaired.input1 ## Second input only if input is paired-end #if $singlePaired.sPaired == "paired" - --input2=$singlePaired.input2 + -v $singlePaired.input2 + #if str($singlePaired.minInsertSize) + -m $singlePaired.minInsertSize + #end if + #if str($singlePaired.maxInsertSize) + -M $singlePaired.maxInsertSize + #end if #end if ## Optional input parameters #if $params.settingsType == "full" - #if str($params.minInsertSize) - --minInsertSize=$params.minInsertSize - #end if - #if str($params.maxInsertSize) - --maxInsertSize=$params.maxInsertSize - #end if #if str($params.window) - --window=$params.window + -w $params.window #end if #if str($params.utrSize) - --utrSize=$params.utrSize + -i $params.utrSize #end if #if str($params.similarity) - --similarity=$params.similarity + -x $params.similarity #end if #if str($params.readLength) - --readLength=$params.readLength + -l $params.readLength #end if #if str($params.minCoverage) - --minCoverage=$params.minCoverage + -c $params.minCoverage #end if #end if - - ## Outputs - --out-aln $out_aln - --out-rpkm $out_rpkm - --out-log $out_log + > $out_log 2>&1 ## need to redirect stderr because edge.pl calls bowtie2 and count which write some logging info there + && cat edge_out.rpkm_* > $out_rpkm + + + @@ -61,6 +59,8 @@ + + @@ -70,25 +70,22 @@ - + - - - - + - + @@ -122,7 +119,7 @@ If you use this tool in Galaxy, please cite |Cuccuru2013|_. -.. |Cuccuru2013| replace:: Cuccuru, G., Orsini, M., Pinna, A., Sbardellati, A., Soranzo, N., Travaglione, A., Uva, P., Zanetti, G., Fotia, G. (2013) Orione, a web-based framework for NGS analysis in microbiology. *Submitted* +.. |Cuccuru2013| replace:: Cuccuru, G., Orsini, M., Pinna, A., Sbardellati, A., Soranzo, N., Travaglione, A., Uva, P., Zanetti, G., Fotia, G. (2014) Orione, a web-based framework for NGS analysis in microbiology. *Bioinformatics*, accepted .. _Cuccuru2013: http://orione.crs4.it/ This tool uses `EDGE-pro`_, which is licensed separately. Please cite |Magoc2013|_. diff -r f77ce4f92b46 -r bad8a51514dd get_edge_data.xml --- a/get_edge_data.xml Fri Jan 31 05:44:03 2014 -0500 +++ b/get_edge_data.xml Wed Mar 05 06:44:35 2014 -0500 @@ -32,7 +32,7 @@ If you use this tool in Galaxy, please cite |Cuccuru2013|_. -.. |Cuccuru2013| replace:: Cuccuru, G., Orsini, M., Pinna, A., Sbardellati, A., Soranzo, N., Travaglione, A., Uva, P., Zanetti, G., Fotia, G. (2013) Orione, a web-based framework for NGS analysis in microbiology. *Submitted* +.. |Cuccuru2013| replace:: Cuccuru, G., Orsini, M., Pinna, A., Sbardellati, A., Soranzo, N., Travaglione, A., Uva, P., Zanetti, G., Fotia, G. (2014) Orione, a web-based framework for NGS analysis in microbiology. *Bioinformatics*, accepted .. _Cuccuru2013: http://orione.crs4.it/ diff -r f77ce4f92b46 -r bad8a51514dd readme.rst --- a/readme.rst Fri Jan 31 05:44:03 2014 -0500 +++ b/readme.rst Wed Mar 05 06:44:35 2014 -0500 @@ -11,7 +11,7 @@ Configuration ------------- -EDGE-pro tool may be configured to use more than one CPU core by selecting an appropriate destination for this tool in Galaxy job_conf.xml file (see http://wiki.galaxyproject.org/Admin/Config/Jobs and http://wiki.galaxyproject.org/Admin/Config/Performance/Cluster ). +edge_pro tool may be configured to use more than one CPU core by selecting an appropriate destination for this tool in Galaxy job_conf.xml file (see https://wiki.galaxyproject.org/Admin/Config/Jobs and https://wiki.galaxyproject.org/Admin/Config/Performance/Cluster ). If you are using Galaxy release_2013.11.04 or later, this tool will automatically use the number of CPU cores allocated by the job runner according to the configuration of the destination selected for this tool. @@ -26,6 +26,7 @@ Version history --------------- +- Release 2: Directly call edge.pl, remove edge_pro.py . Move minimun and maximum insert size params to paired library section. Update Orione citation. - Release 1: Use $GALAXY_SLOTS instead of $EDGE_PRO_SITE_OPTIONS. Add dependency on bowtie2. Add readme.rst . - Release 0: Initial release in the Tool Shed.