Added version info to stdout for NGS tools

This commit is contained in:
Kelly Vincent
2010-11-24 12:35:49 -05:00
parent 3a5caa755c
commit d149382f05
16 changed files with 253 additions and 11 deletions
+20 -2
View File
@@ -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__()
if __name__=="__main__": __main__()
+20 -1
View File
@@ -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__()
if __name__=="__main__": __main__()
+20 -1
View File
@@ -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__()
if __name__=="__main__": __main__()
+15
View File
@@ -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:
+2 -2
View File
@@ -350,8 +350,8 @@
<!-- Test using test data: paired-end reads, index from history. -->
<test>
<!-- TopHat commands:
bowtie-build -f test-data/tophat_in4.fasta tophat_in4
tophat -o tmp_dir -p 1 -r 20 tophat_in4 test-data/tophat_in2.fastqsanger test-data/tophat_in3.fastqsanger
bowtie-build -f test-data/tophat_in1.fasta tophat_in1
tophat -o tmp_dir -p 1 -r 20 tophat_in1 test-data/tophat_in2.fastqsanger test-data/tophat_in3.fastqsanger
-->
<param name="genomeSource" value="history" />
<param name="ownFile" ftype="fasta" value="tophat_in1.fasta" />
+19
View File
@@ -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:
+18
View File
@@ -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:
+18
View File
@@ -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 )
+19
View File
@@ -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 )
+2 -1
View File
@@ -1,10 +1,11 @@
<tool id="PerM" name="Map with PerM" version="1.1.0">
<tool id="PerM" name="Map with PerM" version="1.1.1">
<description>for SOLiD and Illumina</description>
<!-- works with PerM version 0.2.6 -->
<requirements>
<requirement type="package">perm</requirement>
</requirements>
<command>
echo -n "PerM "; PerM 2>&amp;1 | grep "Version";
PerM
#if $s.sourceOfRef.refSource == "history"
$s.sourceOfRef.ref
+19
View File
@@ -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
+19
View File
@@ -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)
+20
View File
@@ -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()
+20 -1
View File
@@ -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:
+19
View File
@@ -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:
+3 -3
View File
@@ -1,4 +1,4 @@
<tool id="lastz_wrapper_2" name="Lastz" version="1.2.0">
<tool id="lastz_wrapper_2" name="Lastz" version="1.2.1">
<description> map short reads against reference sequence</description>
<command interpreter="python">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.
-->
<param name="input2" value="b1.fasta" ftype="fasta" dbkey="phiX" />
<param name="input2" value="b1.fasta" ftype="fasta" />
<param name="ref_source" value="cached" />
<!-- this is the backwards-compatible "unique value" for this file, not an actual path -->
<param name="input1_2bit" value="/galaxy/data/phiX/seq/phiX.2bit" />
@@ -226,7 +226,7 @@
</tests>
<help>
**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_.