diff --git a/tools/ngs_rna/cuffcompare_wrapper.py b/tools/ngs_rna/cuffcompare_wrapper.py index 3ec7c6b13ec..a10c9d3dea9 100644 --- a/tools/ngs_rna/cuffcompare_wrapper.py +++ b/tools/ngs_rna/cuffcompare_wrapper.py @@ -23,9 +23,27 @@ def __main__(): parser.add_option( '', '--input2-tmap-output', dest='input2_tmap_output_file', help='' ) parser.add_option( '', '--input2-refmap-output', dest='input2_refmap_output_file', help='' ) - (options, args) = parser.parse_args() + # output version # of tool + try: + tmp = tempfile.NamedTemporaryFile().name + tmp_stdout = open( tmp, 'wb' ) + proc = subprocess.Popen( args='cuffcompare 2>&1', shell=True, stdout=tmp_stdout ) + tmp_stdout.close() + returncode = proc.wait() + stdout = None + for line in open( tmp_stdout.name, 'rb' ): + if line.lower().find( 'cuffcompare v' ) >= 0: + stdout = line.strip() + break + if stdout: + sys.stdout.write( '%s\n' % stdout ) + else: + raise Exception + except: + sys.stdout.write( 'Could not determine Cuffcompare version\n' ) + # Make temp directory for output. tmp_output_dir = tempfile.mkdtemp() @@ -104,4 +122,4 @@ def __main__(): if not os.path.exists( tmp_output_dir ): shutil.rmtree( tmp_output_dir ) -if __name__=="__main__": __main__() \ No newline at end of file +if __name__=="__main__": __main__() diff --git a/tools/ngs_rna/cuffdiff_wrapper.py b/tools/ngs_rna/cuffdiff_wrapper.py index 71d9bf66c78..2fbd4078078 100644 --- a/tools/ngs_rna/cuffdiff_wrapper.py +++ b/tools/ngs_rna/cuffdiff_wrapper.py @@ -43,6 +43,25 @@ def __main__(): (options, args) = parser.parse_args() + # output version # of tool + try: + tmp = tempfile.NamedTemporaryFile().name + tmp_stdout = open( tmp, 'wb' ) + proc = subprocess.Popen( args='cuffdiff 2>&1', shell=True, stdout=tmp_stdout ) + tmp_stdout.close() + returncode = proc.wait() + stdout = None + for line in open( tmp_stdout.name, 'rb' ): + if line.lower().find( 'cuffdiff v' ) >= 0: + stdout = line.strip() + break + if stdout: + sys.stdout.write( '%s\n' % stdout ) + else: + raise Exception + except: + sys.stdout.write( 'Could not determine Cuffdiff version\n' ) + # Make temp directory for output. tmp_output_dir = tempfile.mkdtemp() @@ -125,4 +144,4 @@ def __main__(): if os.path.exists( tmp_output_dir ): shutil.rmtree( tmp_output_dir ) -if __name__=="__main__": __main__() \ No newline at end of file +if __name__=="__main__": __main__() diff --git a/tools/ngs_rna/cufflinks_wrapper.py b/tools/ngs_rna/cufflinks_wrapper.py index fc33fe7a631..3372d89f30d 100644 --- a/tools/ngs_rna/cufflinks_wrapper.py +++ b/tools/ngs_rna/cufflinks_wrapper.py @@ -32,6 +32,25 @@ def __main__(): (options, args) = parser.parse_args() + # output version # of tool + try: + tmp = tempfile.NamedTemporaryFile().name + tmp_stdout = open( tmp, 'wb' ) + proc = subprocess.Popen( args='cufflinks 2>&1', shell=True, stdout=tmp_stdout ) + tmp_stdout.close() + returncode = proc.wait() + stdout = None + for line in open( tmp_stdout.name, 'rb' ): + if line.lower().find( 'cufflinks v' ) >= 0: + stdout = line.strip() + break + if stdout: + sys.stdout.write( '%s\n' % stdout ) + else: + raise Exception + except: + sys.stdout.write( 'Could not determine Cufflinks version\n' ) + # Make temp directory for output. tmp_output_dir = tempfile.mkdtemp() @@ -109,4 +128,4 @@ def __main__(): if os.path.exists( tmp_output_dir ): shutil.rmtree( tmp_output_dir ) -if __name__=="__main__": __main__() \ No newline at end of file +if __name__=="__main__": __main__() diff --git a/tools/ngs_rna/tophat_wrapper.py b/tools/ngs_rna/tophat_wrapper.py index 21b6a74bb77..49e2645662c 100644 --- a/tools/ngs_rna/tophat_wrapper.py +++ b/tools/ngs_rna/tophat_wrapper.py @@ -67,6 +67,21 @@ def __main__(): (options, args) = parser.parse_args() + # output version # of tool + try: + tmp = tempfile.NamedTemporaryFile().name + tmp_stdout = open( tmp, 'wb' ) + proc = subprocess.Popen( args='tophat -v', shell=True, stdout=tmp_stdout ) + tmp_stdout.close() + returncode = proc.wait() + stdout = open( tmp_stdout.name, 'rb' ).readline().strip() + if stdout: + sys.stdout.write( '%s\n' % stdout ) + else: + raise Exception + except: + sys.stdout.write( 'Could not determine Tophat version\n' ) + # Creat bowtie index if necessary. tmp_index_dir = tempfile.mkdtemp() if options.own_file: diff --git a/tools/ngs_rna/tophat_wrapper.xml b/tools/ngs_rna/tophat_wrapper.xml index 9ff552ae64b..a27457fd389 100644 --- a/tools/ngs_rna/tophat_wrapper.xml +++ b/tools/ngs_rna/tophat_wrapper.xml @@ -350,8 +350,8 @@ diff --git a/tools/samtools/bam_to_sam.py b/tools/samtools/bam_to_sam.py index f80abb6ae42..c2697799a39 100644 --- a/tools/samtools/bam_to_sam.py +++ b/tools/samtools/bam_to_sam.py @@ -23,6 +23,25 @@ def __main__(): parser.add_option( '', '--output1', dest='output1', help='The output BAM dataset' ) ( options, args ) = parser.parse_args() + # output version # of tool + try: + tmp = tempfile.NamedTemporaryFile().name + tmp_stdout = open( tmp, 'wb' ) + proc = subprocess.Popen( args='samtools 2>&1', shell=True, stdout=tmp_stdout ) + tmp_stdout.close() + returncode = proc.wait() + stdout = None + for line in open( tmp_stdout.name, 'rb' ): + if line.lower().find( 'version' ) >= 0: + stdout = line.strip() + break + if stdout: + sys.stdout.write( 'Samtools %s\n' % stdout ) + else: + raise Exception + except: + sys.stdout.write( 'Could not determine Samtools version\n' ) + tmp_dir = tempfile.mkdtemp() try: diff --git a/tools/samtools/sam_merge.py b/tools/samtools/sam_merge.py index 5e5f2f5b614..fe5a30caf35 100644 --- a/tools/samtools/sam_merge.py +++ b/tools/samtools/sam_merge.py @@ -21,6 +21,24 @@ def __main__(): if len( sys.argv ) < 3: stop_err( 'There are not enough files to merge' ) filenames = sys.argv[3:] + # output version # of tool + try: + tmp = tempfile.NamedTemporaryFile().name + tmp_stdout = open( tmp, 'wb' ) + proc = subprocess.Popen( args='samtools 2>&1', shell=True, stdout=tmp_stdout ) + tmp_stdout.close() + returncode = proc.wait() + stdout = None + for line in open( tmp_stdout.name, 'rb' ): + if line.lower().find( 'version' ) >= 0: + stdout = line.strip() + break + if stdout: + sys.stdout.write( 'Samtools %s\n' % stdout ) + else: + raise Exception + except: + sys.stdout.write( 'Could not determine Samtools version\n' ) cmd = 'samtools merge %s %s %s' % ( outfile, infile, ' '.join( filenames ) ) tmp = tempfile.NamedTemporaryFile().name try: diff --git a/tools/samtools/sam_pileup.py b/tools/samtools/sam_pileup.py index 238bffa9685..50168fc2fe6 100644 --- a/tools/samtools/sam_pileup.py +++ b/tools/samtools/sam_pileup.py @@ -49,6 +49,24 @@ def __main__(): #Parse Command Line options, args = doc_optparse.parse( __doc__ ) seqPath = check_seq_file( options.dbkey, options.indexDir ) + # output version # of tool + try: + tmp = tempfile.NamedTemporaryFile().name + tmp_stdout = open( tmp, 'wb' ) + proc = subprocess.Popen( args='samtools 2>&1', shell=True, stdout=tmp_stdout ) + tmp_stdout.close() + returncode = proc.wait() + stdout = None + for line in open( tmp_stdout.name, 'rb' ): + if line.lower().find( 'version' ) >= 0: + stdout = line.strip() + break + if stdout: + sys.stdout.write( 'Samtools %s\n' % stdout ) + else: + raise Exception + except: + sys.stdout.write( 'Could not determine Samtools version\n' ) #prepare file names tmpDir = tempfile.mkdtemp() tmpf0 = tempfile.NamedTemporaryFile( dir=tmpDir ) diff --git a/tools/samtools/sam_to_bam.py b/tools/samtools/sam_to_bam.py index a724c920f12..a02a5522e44 100644 --- a/tools/samtools/sam_to_bam.py +++ b/tools/samtools/sam_to_bam.py @@ -42,6 +42,25 @@ def __main__(): parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' ) ( options, args ) = parser.parse_args() + # output version # of tool + try: + tmp = tempfile.NamedTemporaryFile().name + tmp_stdout = open( tmp, 'wb' ) + proc = subprocess.Popen( args='samtools 2>&1', shell=True, stdout=tmp_stdout ) + tmp_stdout.close() + returncode = proc.wait() + stdout = None + for line in open( tmp_stdout.name, 'rb' ): + if line.lower().find( 'version' ) >= 0: + stdout = line.strip() + break + if stdout: + sys.stdout.write( 'Samtools %s\n' % stdout ) + else: + raise Exception + except: + sys.stdout.write( 'Could not determine Samtools version\n' ) + cached_seqs_pointer_file = '%s/sam_fa_indices.loc' % options.index_dir if not os.path.exists( cached_seqs_pointer_file ): stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file ) diff --git a/tools/sr_mapping/PerM.xml b/tools/sr_mapping/PerM.xml index 601bda39a06..4f9b8166752 100644 --- a/tools/sr_mapping/PerM.xml +++ b/tools/sr_mapping/PerM.xml @@ -1,10 +1,11 @@ - + for SOLiD and Illumina perm + echo -n "PerM "; PerM 2>&1 | grep "Version"; PerM #if $s.sourceOfRef.refSource == "history" $s.sourceOfRef.ref diff --git a/tools/sr_mapping/bfast_wrapper.py b/tools/sr_mapping/bfast_wrapper.py index aa16f25d193..3fdbe1568e4 100644 --- a/tools/sr_mapping/bfast_wrapper.py +++ b/tools/sr_mapping/bfast_wrapper.py @@ -82,6 +82,25 @@ def __main__(): (options, args) = parser.parse_args() + # output version # of tool + try: + tmp = tempfile.NamedTemporaryFile().name + tmp_stdout = open( tmp, 'wb' ) + proc = subprocess.Popen( args='bfast 2>&1', shell=True, stdout=tmp_stdout ) + tmp_stdout.close() + returncode = proc.wait() + stdout = None + for line in open( tmp_stdout.name, 'rb' ): + if line.lower().find( 'version' ) >= 0: + stdout = line.strip() + break + if stdout: + sys.stdout.write( '%s\n' % stdout ) + else: + raise Exception + except: + sys.stdout.write( 'Could not determine BFAST version\n' ) + buffsize = 1048576 # make temp directory for bfast, requires trailing slash diff --git a/tools/sr_mapping/bowtie_wrapper.py b/tools/sr_mapping/bowtie_wrapper.py index 5e02fbf686e..b64d2db433d 100644 --- a/tools/sr_mapping/bowtie_wrapper.py +++ b/tools/sr_mapping/bowtie_wrapper.py @@ -123,6 +123,25 @@ def __main__(): (options, args) = parser.parse_args() stdout = '' + # output version # of tool + try: + tmp = tempfile.NamedTemporaryFile().name + tmp_stdout = open( tmp, 'wb' ) + proc = subprocess.Popen( args='bowtie --version', shell=True, stdout=tmp_stdout ) + tmp_stdout.close() + returncode = proc.wait() + stdout = None + for line in open( tmp_stdout.name, 'rb' ): + if line.lower().find( 'version' ) >= 0: + stdout = line.strip() + break + if stdout: + sys.stdout.write( '%s\n' % stdout ) + else: + raise Exception + except: + sys.stdout.write( 'Could not determine Bowtie version\n' ) + # make temp directory for placement of indices and copy reference file there if necessary tmp_index_dir = tempfile.mkdtemp() # get type of data (solid or solexa) diff --git a/tools/sr_mapping/bwa_wrapper.py b/tools/sr_mapping/bwa_wrapper.py index 246ba8705c4..ebc46e9a2e8 100644 --- a/tools/sr_mapping/bwa_wrapper.py +++ b/tools/sr_mapping/bwa_wrapper.py @@ -72,6 +72,26 @@ def __main__(): parser.add_option( '-X', '--do_not_build_index', dest='do_not_build_index', help="Don't build index" ) parser.add_option( '-H', '--suppressHeader', dest='suppressHeader', help='Suppress header' ) (options, args) = parser.parse_args() + + # output version # of tool + try: + tmp = tempfile.NamedTemporaryFile().name + tmp_stdout = open( tmp, 'wb' ) + proc = subprocess.Popen( args='bwa 2>&1', shell=True, stdout=tmp_stdout ) + tmp_stdout.close() + returncode = proc.wait() + stdout = None + for line in open( tmp_stdout.name, 'rb' ): + if line.lower().find( 'version' ) >= 0: + stdout = line.strip() + break + if stdout: + sys.stdout.write( 'BWA %s\n' % stdout ) + else: + raise Exception + except: + sys.stdout.write( 'Could not determine BWA version\n' ) + # make temp directory for placement of indices tmp_index_dir = tempfile.mkdtemp() tmp_dir = tempfile.mkdtemp() diff --git a/tools/sr_mapping/lastz_paired_reads_wrapper.py b/tools/sr_mapping/lastz_paired_reads_wrapper.py index e9ea4835a96..c8196770284 100644 --- a/tools/sr_mapping/lastz_paired_reads_wrapper.py +++ b/tools/sr_mapping/lastz_paired_reads_wrapper.py @@ -756,8 +756,27 @@ def __main__(): parser.add_option( '', '--input4', dest='input4', help='The base quality score 454 file' ) parser.add_option( '', '--output', dest='output', help='The output file' ) parser.add_option( '', '--lastz_seqs_file_dir', dest='lastz_seqs_file_dir', help='Directory of local lastz_seqs.loc file' ) - ( options, args ) = parser.parse_args() + + # output version # of tool + try: + tmp = tempfile.NamedTemporaryFile().name + tmp_stdout = open( tmp, 'wb' ) + proc = subprocess.Popen( args='lastz -v', shell=True, stdout=tmp_stdout ) + tmp_stdout.close() + returncode = proc.wait() + stdout = None + for line in open( tmp_stdout.name, 'rb' ): + if line.lower().find( 'version' ) >= 0: + stdout = line.strip() + break + if stdout: + sys.stdout.write( '%s\n' % stdout ) + else: + raise Exception + except: + sys.stdout.write( 'Could not determine Lastz version\n' ) + if options.ref_name: ref_name = '[nickname=%s]' % options.ref_name else: diff --git a/tools/sr_mapping/lastz_wrapper.py b/tools/sr_mapping/lastz_wrapper.py index 33f20b8c25b..17d2f4758a2 100644 --- a/tools/sr_mapping/lastz_wrapper.py +++ b/tools/sr_mapping/lastz_wrapper.py @@ -152,6 +152,25 @@ def __main__(): parser.add_option( '', '--lastzSeqsFileDir', dest='lastzSeqsFileDir', help='Directory of local lastz_seqs.loc file' ) ( options, args ) = parser.parse_args() + # output version # of tool + try: + tmp = tempfile.NamedTemporaryFile().name + tmp_stdout = open( tmp, 'wb' ) + proc = subprocess.Popen( args='lastz -v', shell=True, stdout=tmp_stdout ) + tmp_stdout.close() + returncode = proc.wait() + stdout = None + for line in open( tmp_stdout.name, 'rb' ): + if line.lower().find( 'version' ) >= 0: + stdout = line.strip() + break + if stdout: + sys.stdout.write( '%s\n' % stdout ) + else: + raise Exception + except: + sys.stdout.write( 'Could not determine Lastz version\n' ) + if options.unmask == 'yes': unmask = '[unmask]' else: diff --git a/tools/sr_mapping/lastz_wrapper.xml b/tools/sr_mapping/lastz_wrapper.xml index 8909acfe6e7..8c51e0f517d 100644 --- a/tools/sr_mapping/lastz_wrapper.xml +++ b/tools/sr_mapping/lastz_wrapper.xml @@ -1,4 +1,4 @@ - + map short reads against reference sequence lastz_wrapper.py #if $seq_name.how_to_name=="yes": @@ -146,7 +146,7 @@ You need to point to phiX.2bit somewhere on your system. b1.fasta is located in galaxy's test-data. You will have to replace all the pluses before the commands with 2 dashes, as double-dash can't appear in an XML comment. --> - + @@ -226,7 +226,7 @@ -**What it does** +**What it does** **LASTZ** is a high performance pairwise sequence aligner derived from BLASTZ. It is written by Bob Harris in Webb Miller's laboratory at Penn State University. Special scoring sets were derived to improve runtime performance and quality. This Galaxy version of LASTZ is geared towards aligning short (Illumina/Solexa, AB/SOLiD) and medium (Roche/454) reads against a reference sequence. There is excellent, extensive documentation on LASTZ available here_.