mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-28 02:58:18 +08:00
Revert 2715.
This commit is contained in:
@@ -55,7 +55,7 @@ def exec_after_process(app, inp_data, out_data, param_dict, tool=None, stdout=No
|
||||
#check for missing meta data, if all there, comment first line and process file
|
||||
if not data.missing_meta():
|
||||
line_ctr = -1
|
||||
temp = tempfile.NamedTemporaryFile( mode='w', dir=app.config.tmp_file_path )
|
||||
temp = tempfile.NamedTemporaryFile('w')
|
||||
temp_filename = temp.name
|
||||
temp.close()
|
||||
temp = open(temp_filename,'w')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
#Retreives data from GMOD and stores in a file. GBrowse parameters are provided in the input/output file.
|
||||
import urllib, sys
|
||||
import urllib, sys, os, gzip, tempfile, shutil
|
||||
from galaxy import eggs
|
||||
from galaxy.datatypes import data
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ def exec_after_process(app, inp_data, out_data, param_dict, tool=None, stdout=No
|
||||
#check for missing meta data, if all there, comment first line and process file
|
||||
if not data.missing_meta():
|
||||
line_ctr = -1
|
||||
temp = tempfile.NamedTemporaryFile( mode='w', dir=app.config.tmp_file_path )
|
||||
temp = tempfile.NamedTemporaryFile('w')
|
||||
temp_filename = temp.name
|
||||
temp.close()
|
||||
temp = open(temp_filename,'w')
|
||||
|
||||
@@ -20,7 +20,6 @@ def check_gzip( filename ):
|
||||
|
||||
def __main__():
|
||||
filename = sys.argv[1]
|
||||
GALAXY_TMP_FILE_DIR = sys.argv[2]
|
||||
params = {}
|
||||
|
||||
for line in open(filename, 'r'):
|
||||
@@ -50,7 +49,7 @@ def __main__():
|
||||
out.write( chunk )
|
||||
out.close()
|
||||
if check_gzip( filename ):
|
||||
fd, uncompressed = tempfile.mkstemp( dir=GALAXY_TMP_FILE_DIR )
|
||||
fd, uncompressed = tempfile.mkstemp()
|
||||
gzipped_file = gzip.GzipFile( filename )
|
||||
while 1:
|
||||
try:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<description>table browser</description>
|
||||
|
||||
<command interpreter="python">ucsc_tablebrowser.py $output ${GALAXY_TMP_FILE_DIR}</command>
|
||||
<command interpreter="python">ucsc_tablebrowser.py $output</command>
|
||||
|
||||
<inputs action="http://genome.ucsc.edu/cgi-bin/hgTables" check_values="false" method="get">
|
||||
<display>go to UCSC Table Browser $GALAXY_URL</display>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<description>table browser</description>
|
||||
|
||||
<command interpreter="python">ucsc_tablebrowser.py $output ${GALAXY_TMP_FILE_DIR}</command>
|
||||
<command interpreter="python">ucsc_tablebrowser.py $output</command>
|
||||
|
||||
<inputs action="http://archaea.ucsc.edu/cgi-bin/hgTables" check_values="false" method="get">
|
||||
<display>go to UCSC Table Browser $GALAXY_URL</display>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<description>table browser</description>
|
||||
|
||||
<command interpreter="python">ucsc_tablebrowser.py $output ${GALAXY_TMP_FILE_DIR}</command>
|
||||
<command interpreter="python">ucsc_tablebrowser.py $output</command>
|
||||
|
||||
<inputs action="http://genome-test.cse.ucsc.edu/cgi-bin/hgTables" check_values="false" method="get">
|
||||
<display>go to UCSC Table Browser $GALAXY_URL</display>
|
||||
|
||||
@@ -14,14 +14,13 @@ from galaxy.util.odict import odict
|
||||
def __main__():
|
||||
input_filename = sys.argv[1]
|
||||
output_filename = sys.argv[2]
|
||||
tmp_file_dir = sys.argv[3]
|
||||
species = odict()
|
||||
cur_size = 0
|
||||
for components in iter_fasta_alignment( input_filename ):
|
||||
species_not_written = species.keys()
|
||||
for component in components:
|
||||
if component.species not in species:
|
||||
species[component.species] = tempfile.TemporaryFile( dir=tmp_file_dir )
|
||||
species[component.species] = tempfile.TemporaryFile()
|
||||
species[component.species].write( "-" * cur_size )
|
||||
species[component.species].write( component.text )
|
||||
try:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<tool id="fasta_concatenate0" name="Concatenate" version="0.0.0">
|
||||
<description>FASTA alignment by species</description>
|
||||
<command interpreter="python">fasta_concatenate_by_species.py $input1 $out_file1 ${GALAXY_TMP_FILE_DIR}</command>
|
||||
<command interpreter="python">fasta_concatenate_by_species.py $input1 $out_file1</command>
|
||||
<inputs>
|
||||
<param name="input1" type="data" format="fasta" label="FASTA alignment"/>
|
||||
</inputs>
|
||||
|
||||
+13
-16
@@ -12,8 +12,8 @@ import optparse, os, sys, tempfile, struct
|
||||
import psyco_full
|
||||
|
||||
class OffsetList:
|
||||
def __init__( self, filesize=0, fmt=None, directory=None ):
|
||||
self.file = tempfile.NamedTemporaryFile( mode='w+b', dir=directory )
|
||||
def __init__( self, filesize = 0, fmt = None ):
|
||||
self.file = tempfile.NamedTemporaryFile( 'w+b' )
|
||||
if fmt:
|
||||
self.fmt = fmt
|
||||
elif filesize and filesize <= sys.maxint * 2:
|
||||
@@ -59,12 +59,11 @@ class OffsetList:
|
||||
self.file = temp_file
|
||||
|
||||
class SortedOffsets( OffsetList ):
|
||||
def __init__( self, indexed_filename, column, tmp_file_dir, split = None ):
|
||||
OffsetList.__init__( self, filesize=os.stat( indexed_filename ).st_size, directory=tmp_file_dir )
|
||||
def __init__( self, indexed_filename, column, split = None ):
|
||||
OffsetList.__init__( self, os.stat( indexed_filename ).st_size )
|
||||
self.indexed_filename = indexed_filename
|
||||
self.indexed_file = open( indexed_filename, 'rb' )
|
||||
self.column = column
|
||||
self.tmp_file_dir = tmp_file_dir
|
||||
self.split = split
|
||||
self.last_identifier = None
|
||||
self.last_identifier_merged = None
|
||||
@@ -75,7 +74,7 @@ class SortedOffsets( OffsetList ):
|
||||
keys.sort()
|
||||
identifier2 = keys.pop( 0 )
|
||||
|
||||
result_offsets = OffsetList( fmt=self.fmt, directory=self.tmp_file_dir )
|
||||
result_offsets = OffsetList( fmt = self.fmt )
|
||||
offsets1 = enumerate( self.get_offsets() )
|
||||
try:
|
||||
index1, offset1 = offsets1.next()
|
||||
@@ -125,11 +124,10 @@ class SortedOffsets( OffsetList ):
|
||||
|
||||
#indexed set of offsets, index is built on demand
|
||||
class OffsetIndex:
|
||||
def __init__( self, filename, column, tmp_file_dir, split = None, index_depth = 3 ):
|
||||
def __init__( self, filename, column, split = None, index_depth = 3 ):
|
||||
self.filename = filename
|
||||
self.file = open( filename, 'rb' )
|
||||
self.column = column
|
||||
self.tmp_file_dir = tmp_file_dir
|
||||
self.split = split
|
||||
self._offsets = {}
|
||||
self._index = None
|
||||
@@ -194,7 +192,7 @@ class OffsetIndex:
|
||||
while True:
|
||||
if not keys:
|
||||
if first_char not in self._offsets:
|
||||
self._offsets[first_char] = SortedOffsets( self.filename, self.column, self.tmp_file_dir, split=self.split )
|
||||
self._offsets[first_char] = SortedOffsets( self.filename, self.column, self.split )
|
||||
self._offsets[first_char].merge_with_dict( temp )
|
||||
return
|
||||
identifier = keys.pop( 0 )
|
||||
@@ -202,14 +200,14 @@ class OffsetIndex:
|
||||
temp[identifier] = d[identifier]
|
||||
else:
|
||||
if first_char not in self._offsets:
|
||||
self._offsets[first_char] = SortedOffsets( self.filename, self.column, self.tmp_file_dir, split=self.split )
|
||||
self._offsets[first_char] = SortedOffsets( self.filename, self.column, self.split )
|
||||
self._offsets[first_char].merge_with_dict( temp )
|
||||
temp = { identifier: d[identifier] }
|
||||
first_char = identifier[0]
|
||||
|
||||
class BufferedIndex:
|
||||
def __init__( self, filename, column, tmp_file_dir, split = None, buffer = 1000000, index_depth = 3 ):
|
||||
self.index = OffsetIndex( filename, column, tmp_file_dir, split=split, index_depth=index_depth )
|
||||
def __init__( self, filename, column, split = None, buffer = 1000000, index_depth = 3 ):
|
||||
self.index = OffsetIndex( filename, column, split, index_depth )
|
||||
self.buffered_offsets = {}
|
||||
f = open( filename, 'rb' )
|
||||
offset = f.tell()
|
||||
@@ -237,7 +235,7 @@ class BufferedIndex:
|
||||
for offset in self.buffered_offsets[identifier]:
|
||||
yield self.index.get_line_by_offset( offset )
|
||||
|
||||
def join_files( filename1, column1, filename2, column2, out_filename, tmp_file_dir, split = None, buffer = 1000000, keep_unmatched = False, keep_partial = False, index_depth = 3 ):
|
||||
def join_files( filename1, column1, filename2, column2, out_filename, split = None, buffer = 1000000, keep_unmatched = False, keep_partial = False, index_depth = 3 ):
|
||||
#return identifier based upon line
|
||||
def get_identifier_by_line( line, column, split = None ):
|
||||
if isinstance( line, str ):
|
||||
@@ -246,7 +244,7 @@ def join_files( filename1, column1, filename2, column2, out_filename, tmp_file_d
|
||||
return fields[column]
|
||||
return None
|
||||
out = open( out_filename, 'w+b' )
|
||||
index = BufferedIndex( filename2, column2, tmp_file_dir, split=split, buffer=buffer, index_depth=index_depth )
|
||||
index = BufferedIndex( filename2, column2, split, buffer, index_depth )
|
||||
for line1 in open( filename1, 'rb' ):
|
||||
identifier = get_identifier_by_line( line1, column1, split )
|
||||
if identifier:
|
||||
@@ -295,7 +293,6 @@ def main():
|
||||
column1 = int( args[2] ) - 1
|
||||
column2 = int( args[3] ) - 1
|
||||
out_filename = args[4]
|
||||
tmp_file_dir = args[5]
|
||||
except:
|
||||
print >> sys.stderr, "Error parsing command line."
|
||||
sys.exit()
|
||||
@@ -303,6 +300,6 @@ def main():
|
||||
#Character for splitting fields and joining lines
|
||||
split = "\t"
|
||||
|
||||
return join_files( filename1, column1, filename2, column2, out_filename, tmp_file_dir, split, options.buffer, options.keep_unmatched, options.keep_partial, options.index_depth )
|
||||
return join_files( filename1, column1, filename2, column2, out_filename, split, options.buffer, options.keep_unmatched, options.keep_partial, options.index_depth )
|
||||
|
||||
if __name__ == "__main__": main()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<tool id="join1" name="Join two Queries" version="2.0.0">
|
||||
<description>side by side on a specified field</description>
|
||||
<command interpreter="python">join.py $input1 $input2 $field1 $field2 $out_file1 ${GALAXY_TMP_FILE_DIR} $unmatched $partial --index_depth=3 --buffer=50000000</command>
|
||||
<command interpreter="python">join.py $input1 $input2 $field1 $field2 $out_file1 $unmatched $partial --index_depth=3 --buffer=50000000</command>
|
||||
<inputs>
|
||||
<param format="tabular" name="input1" type="data" label="Join"/>
|
||||
<param name="field1" label="using column" type="data_column" data_ref="input1" />
|
||||
|
||||
@@ -4,8 +4,6 @@ import os, sys
|
||||
from galaxy import eggs
|
||||
from galaxy.tools.util import hyphy_util
|
||||
|
||||
# Directory to be used when creating temporary files
|
||||
tmp_file_dir = sys.argv.pop()
|
||||
#Retrieve hyphy path, this will need to be the same across the cluster
|
||||
tool_data = sys.argv.pop()
|
||||
HYPHY_PATH = os.path.join( tool_data, "HYPHY" )
|
||||
@@ -21,7 +19,7 @@ model_options = sys.argv[6].strip()
|
||||
|
||||
#Set up Temporary files for hyphy run
|
||||
#set up tree file
|
||||
tree_filename = hyphy_util.get_filled_temp_filename( tree_contents, directory=tmp_file_dir )
|
||||
tree_filename = hyphy_util.get_filled_temp_filename(tree_contents)
|
||||
|
||||
#Guess if this is a single or multiple FASTA input file
|
||||
found_blank = False
|
||||
@@ -35,10 +33,10 @@ for line in open(input_filename):
|
||||
else: found_blank = False
|
||||
|
||||
#set up BranchLengths file
|
||||
BranchLengths_filename = hyphy_util.get_filled_temp_filename( hyphy_util.BranchLengths, directory=tmp_file_dir )
|
||||
BranchLengths_filename = hyphy_util.get_filled_temp_filename(hyphy_util.BranchLengths)
|
||||
if is_multiple:
|
||||
os.unlink(BranchLengths_filename)
|
||||
BranchLengths_filename = hyphy_util.get_filled_temp_filename( hyphy_util.BranchLengthsMF, directory=tmp_file_dir )
|
||||
BranchLengths_filename = hyphy_util.get_filled_temp_filename(hyphy_util.BranchLengthsMF)
|
||||
print "Multiple Alignment Analyses"
|
||||
else: print "Single Alignment Analyses"
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<description>Estimation</description>
|
||||
|
||||
<command interpreter="python">hyphy_branch_lengths_wrapper.py $input1 $out_file1 "$tree" "$model" "$base_freq" "Global" ${GALAXY_DATA_INDEX_DIR} ${GALAXY_TMP_FILE_DIR}</command>
|
||||
<command interpreter="python">hyphy_branch_lengths_wrapper.py $input1 $out_file1 "$tree" "$model" "$base_freq" "Global" ${GALAXY_DATA_INDEX_DIR}</command>
|
||||
|
||||
<inputs>
|
||||
<page>
|
||||
|
||||
@@ -4,8 +4,6 @@ import os, sys
|
||||
from galaxy import eggs
|
||||
from galaxy.tools.util import hyphy_util
|
||||
|
||||
# Directory to be used when creating temporary files
|
||||
tmp_file_dir = sys.argv.pop()
|
||||
#Retrieve hyphy path, this will need to be the same across the cluster
|
||||
tool_data = sys.argv.pop()
|
||||
HYPHY_PATH = os.path.join( tool_data, "HYPHY" )
|
||||
@@ -22,15 +20,15 @@ if tree_contents == "":
|
||||
print >> sys.stderr, "Please specify a valid tree definition."
|
||||
sys.exit()
|
||||
|
||||
tree_filename = hyphy_util.get_filled_temp_filename( tree_contents, directory=tmp_file_dir )
|
||||
tree_filename = hyphy_util.get_filled_temp_filename(tree_contents)
|
||||
|
||||
if analysis == "local":
|
||||
fitter_filename = hyphy_util.get_filled_temp_filename( hyphy_util.SimpleLocalFitter, directory=tmp_file_dir )
|
||||
fitter_filename = hyphy_util.get_filled_temp_filename(hyphy_util.SimpleLocalFitter)
|
||||
else:
|
||||
fitter_filename = hyphy_util.get_filled_temp_filename( hyphy_util.SimpleGlobalFitter, directory=tmp_file_dir )
|
||||
fitter_filename = hyphy_util.get_filled_temp_filename(hyphy_util.SimpleGlobalFitter)
|
||||
|
||||
tabwriter_filename = hyphy_util.get_filled_temp_filename( hyphy_util.TabWriter, directory=tmp_file_dir )
|
||||
FastaReader_filename = hyphy_util.get_filled_temp_filename( hyphy_util.FastaReader, directory=tmp_file_dir )
|
||||
tabwriter_filename = hyphy_util.get_filled_temp_filename(hyphy_util.TabWriter)
|
||||
FastaReader_filename = hyphy_util.get_filled_temp_filename(hyphy_util.FastaReader)
|
||||
#setup Config file
|
||||
config_filename = hyphy_util.get_dnds_config_filename(fitter_filename, tabwriter_filename, "Universal", tree_filename, input_filename, nuc_model, output_filename, FastaReader_filename)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<description>Estimation</description>
|
||||
|
||||
<command interpreter="python">hyphy_dnds_wrapper.py $input1 $out_file1 "$tree" "$model" $analysis ${GALAXY_DATA_INDEX_DIR} ${GALAXY_TMP_FILE_DIR}</command>
|
||||
<command interpreter="python">hyphy_dnds_wrapper.py $input1 $out_file1 "$tree" "$model" $analysis ${GALAXY_DATA_INDEX_DIR}</command>
|
||||
|
||||
<inputs>
|
||||
<page>
|
||||
|
||||
@@ -4,8 +4,6 @@ import os, sys
|
||||
from galaxy import eggs
|
||||
from galaxy.tools.util import hyphy_util
|
||||
|
||||
# Directory to be used when creating temporary files
|
||||
tmp_file_dir = sys.argv.pop()
|
||||
#Retrieve hyphy path, this will need to be the same across the cluster
|
||||
tool_data = sys.argv.pop()
|
||||
HYPHY_PATH = os.path.join( tool_data, "HYPHY" )
|
||||
@@ -16,7 +14,7 @@ input_filename = os.path.abspath(sys.argv[1].strip())
|
||||
output_filename1 = os.path.abspath(sys.argv[2].strip())
|
||||
output_filename2 = os.path.abspath(sys.argv[3].strip())
|
||||
distance_metric = sys.argv[4].strip()
|
||||
temp_ps_filename = hyphy_util.get_filled_temp_filename( "", directory=tmp_file_dir )
|
||||
temp_ps_filename = hyphy_util.get_filled_temp_filename("")
|
||||
|
||||
#Guess if this is a single or multiple FASTA input file
|
||||
found_blank = False
|
||||
@@ -29,16 +27,16 @@ for line in open(input_filename):
|
||||
break
|
||||
else: found_blank = False
|
||||
|
||||
NJ_tree_shared_ibf = hyphy_util.get_filled_temp_filename( hyphy_util.NJ_tree_shared_ibf, directory=tmp_file_dir )
|
||||
NJ_tree_shared_ibf = hyphy_util.get_filled_temp_filename(hyphy_util.NJ_tree_shared_ibf)
|
||||
|
||||
#set up NJ_tree file
|
||||
NJ_tree_filename = hyphy_util.get_filled_temp_filename( hyphy_util.get_NJ_tree( NJ_tree_shared_ibf ), directory=tmp_file_dir )
|
||||
NJ_tree_filename = hyphy_util.get_filled_temp_filename(hyphy_util.get_NJ_tree(NJ_tree_shared_ibf))
|
||||
#setup Config file
|
||||
config_filename = hyphy_util.get_nj_tree_config_filename(input_filename, distance_metric, output_filename1, temp_ps_filename, NJ_tree_filename)
|
||||
if is_multiple:
|
||||
os.unlink(NJ_tree_filename)
|
||||
os.unlink(config_filename)
|
||||
NJ_tree_filename = hyphy_util.get_filled_temp_filename( hyphy_util.get_NJ_treeMF( NJ_tree_shared_ibf ), directory=tmp_file_dir )
|
||||
NJ_tree_filename = hyphy_util.get_filled_temp_filename(hyphy_util.get_NJ_treeMF(NJ_tree_shared_ibf))
|
||||
config_filename = hyphy_util.get_nj_treeMF_config_filename(input_filename, output_filename1, temp_ps_filename, distance_metric, NJ_tree_filename)
|
||||
print "Multiple Alignment Analyses"
|
||||
else: print "Single Alignment Analyses"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<description>Builder</description>
|
||||
|
||||
<command interpreter="python">hyphy_nj_tree_wrapper.py $input1 $out_file1 $out_file2 $distance_metric ${GALAXY_DATA_INDEX_DIR} ${GALAXY_TMP_FILE_DIR}</command>
|
||||
<command interpreter="python">hyphy_nj_tree_wrapper.py $input1 $out_file1 $out_file2 $distance_metric ${GALAXY_DATA_INDEX_DIR}</command>
|
||||
|
||||
<inputs>
|
||||
<page>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<tool id="GeneBed_Maf_Fasta2" name="Stitch Gene blocks">
|
||||
<description>given a set of coding exon intervals</description>
|
||||
<command interpreter="python">#if $maf_source_type.maf_source == "user":#interval_maf_to_merged_fasta.py --dbkey=$dbkey --species=$maf_source_type.species --mafSource=$maf_source_type.maf_file --interval_file=$input1 --output_file=$out_file1 --mafSourceType=$maf_source_type.maf_source --geneBED --mafIndexFileDir=${GALAXY_DATA_INDEX_DIR} --mafTmpFileDir=${GALAXY_TMP_FILE_DIR}
|
||||
#else:#interval_maf_to_merged_fasta.py --dbkey=$dbkey --species=$maf_source_type.species --mafSource=$maf_source_type.maf_identifier --interval_file=$input1 --output_file=$out_file1 --mafSourceType=$maf_source_type.maf_source --geneBED --mafIndexFileDir=${GALAXY_DATA_INDEX_DIR} --mafTmpFileDir=${GALAXY_TMP_FILE_DIR}
|
||||
<command interpreter="python">#if $maf_source_type.maf_source == "user":#interval_maf_to_merged_fasta.py --dbkey=$dbkey --species=$maf_source_type.species --mafSource=$maf_source_type.maf_file --interval_file=$input1 --output_file=$out_file1 --mafSourceType=$maf_source_type.maf_source --geneBED --mafIndexFileDir=${GALAXY_DATA_INDEX_DIR}
|
||||
#else:#interval_maf_to_merged_fasta.py --dbkey=$dbkey --species=$maf_source_type.species --mafSource=$maf_source_type.maf_identifier --interval_file=$input1 --output_file=$out_file1 --mafSourceType=$maf_source_type.maf_source --geneBED --mafIndexFileDir=${GALAXY_DATA_INDEX_DIR}
|
||||
#end if
|
||||
</command>
|
||||
<inputs>
|
||||
|
||||
@@ -20,8 +20,7 @@ usage: %prog maf_file [options]
|
||||
-o, --output_file=o: Output MAF file
|
||||
-p, --species=p: Species to include in output
|
||||
-l, --indexLocation=l: Override default maf_index.loc file
|
||||
-y, --mafIndexFile=y: Directory of local maf index file ( maf_index.loc or maf_pairwise.loc )
|
||||
-z, --mafTmpFileDir=z: Directory to be used when creating temporary files
|
||||
-z, --mafIndexFile=z: Directory of local maf index file ( maf_index.loc or maf_pairwise.loc )
|
||||
"""
|
||||
|
||||
#Dan Blankenberg
|
||||
@@ -94,7 +93,7 @@ def __main__():
|
||||
print >> sys.stderr, "The MAF source specified (%s) appears to be invalid." % ( options.mafType )
|
||||
sys.exit()
|
||||
elif options.mafFile:
|
||||
index, index_filename = maf_utilities.build_maf_index( options.mafFile, species=[dbkey], directory=options.mafTmpFileDir )
|
||||
index, index_filename = maf_utilities.build_maf_index( options.mafFile, species = [dbkey] )
|
||||
if index is None:
|
||||
print >> sys.stderr, "Your MAF file appears to be malformed."
|
||||
sys.exit()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<description>given a set of genomic intervals</description>
|
||||
<command interpreter="python">
|
||||
#if $maf_source_type.maf_source == "user":#interval2maf.py --dbkey=$input1_dbkey --chromCol=$input1_chromCol --startCol=$input1_startCol --endCol=$input1_endCol --strandCol=$input1_strandCol --mafFile=$maf_source_type.mafFile --interval_file=$input1 --output_file=$out_file1 --mafIndexFile=${GALAXY_DATA_INDEX_DIR}/maf_index.loc
|
||||
#else:#interval2maf.py --dbkey=$input1_dbkey --chromCol=$input1_chromCol --startCol=$input1_startCol --endCol=$input1_endCol --strandCol=$input1_strandCol --mafType=$maf_source_type.mafType --interval_file=$input1 --output_file=$out_file1 --mafIndexFile=${GALAXY_DATA_INDEX_DIR}/maf_index.loc --mafTmpFileDir=${GALAXY_TMP_FILE_DIR}
|
||||
#else:#interval2maf.py --dbkey=$input1_dbkey --chromCol=$input1_chromCol --startCol=$input1_startCol --endCol=$input1_endCol --strandCol=$input1_strandCol --mafType=$maf_source_type.mafType --interval_file=$input1 --output_file=$out_file1 --mafIndexFile=${GALAXY_DATA_INDEX_DIR}/maf_index.loc
|
||||
#end if
|
||||
</command>
|
||||
<inputs>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<tool id="Interval2Maf_pairwise1" name="Extract Pairwise MAF blocks">
|
||||
<description>given a set of genomic intervals</description>
|
||||
<command interpreter="python">interval2maf.py --dbkey=$input1_dbkey --chromCol=$input1_chromCol --startCol=$input1_startCol --endCol=$input1_endCol --strandCol=$input1_strandCol --mafType=$mafType --interval_file=$input1 --output_file=$out_file1 --indexLocation=${GALAXY_DATA_INDEX_DIR}/maf_pairwise.loc --mafTmpFileDir=${GALAXY_TMP_FILE_DIR}</command>
|
||||
<command interpreter="python">interval2maf.py --dbkey=$input1_dbkey --chromCol=$input1_chromCol --startCol=$input1_startCol --endCol=$input1_endCol --strandCol=$input1_strandCol --mafType=$mafType --interval_file=$input1 --output_file=$out_file1 --indexLocation=${GALAXY_DATA_INDEX_DIR}/maf_pairwise.loc</command>
|
||||
<inputs>
|
||||
<param name="input1" type="data" format="interval" label="Interval File">
|
||||
<validator type="unspecified_build" />
|
||||
|
||||
@@ -18,10 +18,9 @@ usage: %prog maf_file [options]
|
||||
-i, --interval_file=i: Input interval file
|
||||
-o, --output_file=o: Output MAF file
|
||||
-p, --species=p: Species to include in output
|
||||
-y, --mafIndexFileDir=y: Directory of local maf_index.loc file
|
||||
-z, --mafTmpFileDir=z: Directory to be used when creating temporary files
|
||||
-z, --mafIndexFileDir=z: Directory of local maf_index.loc file
|
||||
|
||||
usage: %prog dbkey_of_BED comma_separated_list_of_additional_dbkeys_to_extract comma_separated_list_of_indexed_maf_files input_gene_bed_file output_fasta_file cached|user GALAXY_DATA_INDEX_DIR GALAXY_TMP_FILE_DIR
|
||||
usage: %prog dbkey_of_BED comma_separated_list_of_additional_dbkeys_to_extract comma_separated_list_of_indexed_maf_files input_gene_bed_file output_fasta_file cached|user GALAXY_DATA_INDEX_DIR
|
||||
"""
|
||||
|
||||
#Dan Blankenberg
|
||||
@@ -88,7 +87,6 @@ def __main__():
|
||||
print >>sys.stderr, "Strand column has not been specified."
|
||||
sys.exit()
|
||||
mafIndexFile = "%s/maf_index.loc" % options.mafIndexFileDir
|
||||
tmpFileDir = options.mafTmpFileDir
|
||||
#Finish parsing command line
|
||||
|
||||
#get index for mafs based on type
|
||||
@@ -101,7 +99,7 @@ def __main__():
|
||||
sys.exit()
|
||||
elif options.mafSourceType.lower() in ["user"]:
|
||||
#index maf for use here, need to remove index_file when finished
|
||||
index, index_filename = maf_utilities.build_maf_index( options.mafSource, species=[primary_species], directory=tmpFileDir )
|
||||
index, index_filename = maf_utilities.build_maf_index( options.mafSource, species = [primary_species] )
|
||||
if index is None:
|
||||
print >> sys.stderr, "Your MAF file appears to be malformed."
|
||||
sys.exit()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<tool id="Interval_Maf_Merged_Fasta2" name="Stitch MAF blocks">
|
||||
<description>given a set of genomic intervals</description>
|
||||
<command interpreter="python">#if $maf_source_type.maf_source == "user":#interval_maf_to_merged_fasta.py --dbkey=$dbkey --species=$maf_source_type.species --mafSource=$maf_source_type.maf_file --interval_file=$input1 --output_file=$out_file1 --chromCol=$input1_chromCol --startCol=$input1_startCol --endCol=$input1_endCol --strandCol=$input1_strandCol --mafSourceType=$maf_source_type.maf_source --mafIndexFileDir=${GALAXY_DATA_INDEX_DIR} --mafTmpFileDir=${GALAXY_TMP_FILE_DIR}
|
||||
#else:#interval_maf_to_merged_fasta.py --dbkey=$dbkey --species=$maf_source_type.species --mafSource=$maf_source_type.maf_identifier --interval_file=$input1 --output_file=$out_file1 --chromCol=$input1_chromCol --startCol=$input1_startCol --endCol=$input1_endCol --strandCol=$input1_strandCol --mafSourceType=$maf_source_type.maf_source --mafIndexFileDir=${GALAXY_DATA_INDEX_DIR} --mafTmpFileDir=${GALAXY_TMP_FILE_DIR}
|
||||
<command interpreter="python">#if $maf_source_type.maf_source == "user":#interval_maf_to_merged_fasta.py --dbkey=$dbkey --species=$maf_source_type.species --mafSource=$maf_source_type.maf_file --interval_file=$input1 --output_file=$out_file1 --chromCol=$input1_chromCol --startCol=$input1_startCol --endCol=$input1_endCol --strandCol=$input1_strandCol --mafSourceType=$maf_source_type.maf_source --mafIndexFileDir=${GALAXY_DATA_INDEX_DIR}
|
||||
#else:#interval_maf_to_merged_fasta.py --dbkey=$dbkey --species=$maf_source_type.species --mafSource=$maf_source_type.maf_identifier --interval_file=$input1 --output_file=$out_file1 --chromCol=$input1_chromCol --startCol=$input1_startCol --endCol=$input1_endCol --strandCol=$input1_strandCol --mafSourceType=$maf_source_type.maf_source --mafIndexFileDir=${GALAXY_DATA_INDEX_DIR}
|
||||
#end if
|
||||
</command>
|
||||
<inputs>
|
||||
|
||||
@@ -31,11 +31,10 @@ def __main__():
|
||||
else: summary = False
|
||||
|
||||
mafIndexFile = "%s/maf_index.loc" % sys.argv[9]
|
||||
tmpFileDir = sys.argv[10]
|
||||
index = index_filename = None
|
||||
if maf_source_type == "user":
|
||||
#index maf for use here
|
||||
index, index_filename = maf_utilities.build_maf_index( input_maf_filename, species=[dbkey], directory=tmpFileDir )
|
||||
index, index_filename = maf_utilities.build_maf_index( input_maf_filename, species = [dbkey] )
|
||||
if index is None:
|
||||
print >>sys.stderr, "Your MAF file appears to be malformed."
|
||||
sys.exit()
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
$maf_source_type.maf_source $maf_source_type.mafType $input1 $out_file1 $dbkey $input1_chromCol $input1_startCol $input1_endCol $summary
|
||||
#end if
|
||||
${GALAXY_DATA_INDEX_DIR}
|
||||
${GALAXY_TMP_FILE_DIR}
|
||||
</command>
|
||||
<inputs>
|
||||
<param format="interval" name="input1" label="Interval File" type="data">
|
||||
|
||||
@@ -67,7 +67,6 @@ def __main__():
|
||||
stop_err('Invalid value for mismatch numbers in the word')
|
||||
|
||||
GALAXY_DATA_INDEX_DIR = sys.argv[8]
|
||||
GALAXY_TMP_FILE_DIR = sys.argv[9]
|
||||
|
||||
all_files = []
|
||||
if source_format == '0':
|
||||
@@ -96,7 +95,7 @@ def __main__():
|
||||
all_files = [target_file]
|
||||
|
||||
for detail_file_path in all_files:
|
||||
output_tempfile = tempfile.NamedTemporaryFile( dir=GALAXY_TMP_FILE_DIR ).name
|
||||
output_tempfile = tempfile.NamedTemporaryFile().name
|
||||
command = "blat %s %s %s -oneOff=%s -tileSize=%s -minIdentity=%s -mask=lower -noHead -out=pslx 2>&1" % ( detail_file_path, query_file, output_tempfile, one_off, tile_size, min_iden )
|
||||
os.system( command )
|
||||
os.system( 'cat %s >> %s' % ( output_tempfile, output_file ) )
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#else:#blat_wrapper.py 1 $source.input_target $input_query $output1 $iden $tile_size $one_off
|
||||
#end if
|
||||
${GALAXY_DATA_INDEX_DIR}
|
||||
${GALAXY_TMP_FILE_DIR}
|
||||
</command>
|
||||
<inputs>
|
||||
<conditional name="source">
|
||||
|
||||
@@ -19,11 +19,10 @@ def __main__():
|
||||
mega_word_size = sys.argv[4] # -W
|
||||
mega_iden_cutoff = sys.argv[5] # -p
|
||||
mega_evalue_cutoff = sys.argv[6] # -e
|
||||
mega_temp_output = tempfile.NamedTemporaryFile().name
|
||||
mega_filter = sys.argv[7] # -F
|
||||
GALAXY_DATA_INDEX_DIR = sys.argv[8]
|
||||
GALAXY_TMP_FILE_DIR = sys.argv[9]
|
||||
DB_LOC = "%s/blastdb.loc" % GALAXY_DATA_INDEX_DIR
|
||||
mega_temp_output = tempfile.NamedTemporaryFile( dir=GALAXY_TMP_FILE_DIR ).name
|
||||
|
||||
# megablast parameters
|
||||
try:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<tool id="megablast_wrapper" name="Run megablast" version="1.0.0">
|
||||
<description></description>
|
||||
<command interpreter="python">megablast_wrapper.py $source_select $input_query $output1 $word_size $iden_cutoff $evalue_cutoff $filter_query ${GALAXY_DATA_INDEX_DIR} ${GALAXY_TMP_FILE_DIR}</command>
|
||||
<command interpreter="python">megablast_wrapper.py $source_select $input_query $output1 $word_size $iden_cutoff $evalue_cutoff $filter_query ${GALAXY_DATA_INDEX_DIR}</command>
|
||||
<inputs>
|
||||
<param name="source_select" type="select" display="radio" label="Choose target database">
|
||||
<options from_file="blastdb.loc">
|
||||
|
||||
@@ -19,7 +19,6 @@ def __main__():
|
||||
align_len = sys.argv[4] # -h
|
||||
mismatch = sys.argv[5] # -m
|
||||
output_file = sys.argv[6]
|
||||
GALAXY_TMP_FILE_DIR = sys.argv[7]
|
||||
|
||||
# first guess the read length
|
||||
guess_read_len = 0
|
||||
@@ -67,7 +66,7 @@ def __main__():
|
||||
stop_err("No sequences for %s are available for search, please report this error." %(target_path))
|
||||
|
||||
for detail_file_path in all_files:
|
||||
output_tempfile = tempfile.NamedTemporaryFile( dir=GALAXY_TMP_FILE_DIR ).name
|
||||
output_tempfile = tempfile.NamedTemporaryFile().name
|
||||
command = "rmap -h %s -w %s -m %s -c %s %s -o %s 2>&1" % ( align_len, read_len, mismatch, detail_file_path, infile, output_tempfile )
|
||||
#print command
|
||||
try:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<tool id="rmap_wrapper" name="RMAP" version="1.0.0">
|
||||
<description>for Solexa Short Reads Alignment</description>
|
||||
<command interpreter="python">
|
||||
#if $trim.choice=="No": #rmap_wrapper.py $database $input_seq 0 $align_len $mismatch $output1 ${GALAXY_TMP_FILE_DIR}
|
||||
#else: #rmap_wrapper.py $database $input_seq $trim.read_len $align_len $mismatch $output1 ${GALAXY_TMP_FILE_DIR}
|
||||
#if $trim.choice=="No": #rmap_wrapper.py $database $input_seq 0 $align_len $mismatch $output1
|
||||
#else: #rmap_wrapper.py $database $input_seq $trim.read_len $align_len $mismatch $output1
|
||||
#end if
|
||||
</command>
|
||||
<inputs>
|
||||
|
||||
@@ -22,7 +22,6 @@ def __main__():
|
||||
align_len = sys.argv[7] # -h
|
||||
mismatch = sys.argv[8] # -m
|
||||
output_file = sys.argv[9]
|
||||
GALAXY_TMP_FILE_DIR = sys.argv[10]
|
||||
|
||||
try:
|
||||
float(high_score)
|
||||
@@ -79,7 +78,7 @@ def __main__():
|
||||
stop_err("No sequences for %s are available for search, please report this error." %(target_path))
|
||||
|
||||
for detail_file_path in all_files:
|
||||
output_tempfile = tempfile.NamedTemporaryFile( dir=GALAXY_TMP_FILE_DIR ).name
|
||||
output_tempfile = tempfile.NamedTemporaryFile().name
|
||||
command = "rmapq -q %s -M %s -h %s -w %s -m %s -Q %s -c %s %s -o %s 2>&1" % ( high_score, high_len, align_len, read_len, mismatch, scorefile, detail_file_path, infile, output_tempfile )
|
||||
#print command
|
||||
try:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<tool id="rmapq_wrapper" name="RMAPQ" version="1.0.0">
|
||||
<description>for Solexa Short Reads Alignment with Quality Scores</description>
|
||||
<command interpreter="python">
|
||||
#if $trim.choice=="No": #rmapq_wrapper.py $database $input_seq $input_score $high_score $high_len 0 $align_len $mismatch $output1 ${GALAXY_TMP_FILE_DIR}
|
||||
#else: #rmapq_wrapper.py $database $input_seq $input_score $high_score $high_len $trim.read_len $align_len $mismatch $output1 ${GALAXY_TMP_FILE_DIR}
|
||||
#if $trim.choice=="No": #rmapq_wrapper.py $database $input_seq $input_score $high_score $high_len 0 $align_len $mismatch $output1
|
||||
#else: #rmapq_wrapper.py $database $input_seq $input_score $high_score $high_len $trim.read_len $align_len $mismatch $output1
|
||||
#end if
|
||||
</command>
|
||||
<inputs>
|
||||
|
||||
@@ -9,9 +9,9 @@ def stop_err( msg ):
|
||||
sys.stderr.write( "%s\n" % msg )
|
||||
sys.exit()
|
||||
|
||||
def unzip( filename, directory=None ):
|
||||
def unzip( filename ):
|
||||
zip_file = zipfile.ZipFile( filename, 'r' )
|
||||
tmpfilename = tempfile.NamedTemporaryFile( dir=directory ).name
|
||||
tmpfilename = tempfile.NamedTemporaryFile().name
|
||||
for name in zip_file.namelist():
|
||||
file( tmpfilename, 'a' ).write( zip_file.read( name ) )
|
||||
zip_file.close()
|
||||
@@ -20,7 +20,6 @@ def unzip( filename, directory=None ):
|
||||
def __main__():
|
||||
infile_score_name = sys.argv[1].strip()
|
||||
outfile_R_name = sys.argv[2].strip()
|
||||
GALAXY_TMP_FILE_DIR = sys.argv[3]
|
||||
|
||||
try:
|
||||
score_threshold = int( sys.argv[3].strip() )
|
||||
@@ -30,7 +29,7 @@ def __main__():
|
||||
infile_is_zipped = False
|
||||
if zipfile.is_zipfile( infile_score_name ):
|
||||
infile_is_zipped = True
|
||||
infile_name = unzip( infile_score_name, directory=GALAXY_TMP_FILE_DIR )
|
||||
infile_name = unzip( infile_score_name )
|
||||
else:
|
||||
infile_name = infile_score_name
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<tool id="hist_high_quality_score" name="Histogram">
|
||||
<description> of high quality score reads </description>
|
||||
|
||||
<command interpreter="python">short_reads_figure_high_quality_length.py $input1 $output1 $input2 ${GALAXY_TMP_FILE_DIR}</command>
|
||||
<command interpreter="python">short_reads_figure_high_quality_length.py $input1 $output1 $input2</command>
|
||||
|
||||
<inputs>
|
||||
<page>
|
||||
|
||||
@@ -17,9 +17,9 @@ def stop_err( msg ):
|
||||
sys.stderr.write( "%s\n" % msg )
|
||||
sys.exit()
|
||||
|
||||
def unzip( filename, directory=None ):
|
||||
def unzip( filename ):
|
||||
zip_file = zipfile.ZipFile( filename, 'r' )
|
||||
tmpfilename = tempfile.NamedTemporaryFile( dir=directory ).name
|
||||
tmpfilename = tempfile.NamedTemporaryFile().name
|
||||
for name in zip_file.namelist():
|
||||
file( tmpfilename, 'a' ).write( zip_file.read( name ) )
|
||||
zip_file.close()
|
||||
@@ -64,12 +64,11 @@ def merge_to_20_datapoints( score ):
|
||||
def __main__():
|
||||
infile_score_name = sys.argv[1].strip()
|
||||
outfile_R_name = sys.argv[2].strip()
|
||||
GALAXY_TMP_FILE_DIR = sys.argv[3]
|
||||
|
||||
infile_is_zipped = False
|
||||
if zipfile.is_zipfile( infile_score_name ):
|
||||
infile_is_zipped = True
|
||||
infile_name = unzip( infile_score_name, directory=GALAXY_TMP_FILE_DIR )
|
||||
infile_name = unzip( infile_score_name )
|
||||
else:
|
||||
infile_name = infile_score_name
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<tool id="quality_score_distribution" name="Build distribution of base quality">
|
||||
<description>values</description>
|
||||
|
||||
<command interpreter="python">short_reads_figure_score.py $input1 $output1 ${GALAXY_TMP_FILE_DIR}</command>
|
||||
<command interpreter="python">short_reads_figure_score.py $input1 $output1 </command>
|
||||
|
||||
<inputs>
|
||||
<page>
|
||||
|
||||
@@ -13,9 +13,9 @@ def stop_err( msg ):
|
||||
sys.stderr.write( "%s\n" % msg )
|
||||
sys.exit()
|
||||
|
||||
def unzip( filename, directory=None ):
|
||||
def unzip( filename ):
|
||||
zip_file = zipfile.ZipFile( filename, 'r' )
|
||||
tmpfilename = tempfile.NamedTemporaryFile( dir=directory ).name
|
||||
tmpfilename = tempfile.NamedTemporaryFile().name
|
||||
for name in zip_file.namelist():
|
||||
file( tmpfilename, 'a' ).write( zip_file.read( name ) )
|
||||
zip_file.close()
|
||||
@@ -90,17 +90,16 @@ def __main__():
|
||||
infile_seq_name = sys.argv[4].strip()
|
||||
infile_score_name = sys.argv[5].strip()
|
||||
arg = sys.argv[6].strip()
|
||||
GALAXY_TMP_FILE_DIR = sys.argv[7]
|
||||
|
||||
infile_seq_is_zipped = False
|
||||
if zipfile.is_zipfile( infile_seq_name ):
|
||||
infile_seq_is_zipped = True
|
||||
seq_infile_name = unzip( infile_seq_name, directory=GALAXY_TMP_FILE_DIR )
|
||||
seq_infile_name = unzip( infile_seq_name )
|
||||
else: seq_infile_name = infile_seq_name
|
||||
infile_score_is_zipped = False
|
||||
if zipfile.is_zipfile( infile_score_name ):
|
||||
infile_score_is_zipped = True
|
||||
score_infile_name = unzip( infile_score_name, directory=GALAXY_TMP_FILE_DIR )
|
||||
score_infile_name = unzip(infile_score_name)
|
||||
else: score_infile_name = infile_score_name
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<description>from short reads</description>
|
||||
|
||||
<command interpreter="python">
|
||||
short_reads_trim_seq.py $trim $length $output1 $input1 $input2 $sequencing_method_choice.input3 ${GALAXY_TMP_FILE_DIR}
|
||||
short_reads_trim_seq.py $trim $length $output1 $input1 $input2 $sequencing_method_choice.input3
|
||||
</command>
|
||||
<inputs>
|
||||
<page>
|
||||
|
||||
@@ -139,7 +139,6 @@ def main(tmpFileName):
|
||||
if __name__ == "__main__":
|
||||
# The tempfile initialization is here because while inside the main() it seems to create a condition
|
||||
# when the file is removed before gnuplot has a chance of accessing it
|
||||
GALAXY_TMP_FILE_DIR = sys.argv.pop()
|
||||
gp_data_file = tempfile.NamedTemporaryFile( mode='w', dir=GALAXY_TMP_FILE_DIR )
|
||||
gp_data_file = tempfile.NamedTemporaryFile('w')
|
||||
main(gp_data_file.name)
|
||||
|
||||
|
||||
@@ -1,57 +1,60 @@
|
||||
<tool id="barchart_gnuplot" name="Bar chart">
|
||||
<description>for multiple columns</description>
|
||||
<command interpreter="python">
|
||||
#if $xtic.userSpecified == "Yes": #bar_chart.py $input $xtic.xticColumn $colList "$title" "$ylabel" $ymin $ymax $out_file1 "$pdf_size" ${GALAXY_TMP_FILE_DIR}
|
||||
#else: #bar_chart.py $input 0 $colList "$title" "$ylabel" $ymin $ymax $out_file1 "$pdf_size" ${GALAXY_TMP_FILE_DIR}
|
||||
#end if
|
||||
<command interpreter="python">
|
||||
#if $xtic.userSpecified == "Yes": #bar_chart.py $input $xtic.xticColumn $colList "$title" "$ylabel" $ymin $ymax $out_file1 "$pdf_size"
|
||||
#else: #bar_chart.py $input 0 $colList "$title" "$ylabel" $ymin $ymax $out_file1 "$pdf_size"
|
||||
#end if
|
||||
</command>
|
||||
<inputs>
|
||||
<param name="input" type="data" format="tabular" label="Dataset" help="Query missing? See TIP below"/>
|
||||
<conditional name="xtic">
|
||||
<param name="userSpecified" type="select" label="Use X Tick labels?" help="see example below">
|
||||
<option value="Yes">Yes</option>
|
||||
<option value="No">No</option>
|
||||
</param>
|
||||
<when value="Yes">
|
||||
<param name="xticColumn" type="data_column" data_ref="input" numerical="False" label="Use this column for X Tick labels" />
|
||||
</when>
|
||||
<when value="No">
|
||||
</when>
|
||||
</conditional>
|
||||
<param name="input" type="data" format="tabular" label="Dataset" help="Query missing? See TIP below"/>
|
||||
<conditional name="xtic">
|
||||
<param name="userSpecified" type="select" label="Use X Tick labels?" help="see example below">
|
||||
<option value="Yes">Yes</option>
|
||||
<option value="No">No</option>
|
||||
</param>
|
||||
<when value="Yes">
|
||||
<param name="xticColumn" type="data_column" data_ref="input" numerical="False" label="Use this column for X Tick labels" />
|
||||
</when>
|
||||
<when value="No">
|
||||
</when>
|
||||
</conditional>
|
||||
<param name="colList" label="Numerical columns" type="data_column" numerical="True" multiple="True" data_ref="input" help="Multi-select list - hold the appropriate key while clicking to select multiple columns" />
|
||||
<param name="title" type="text" size="30" value="Bar Chart" label="Plot title"/>
|
||||
<param name="ylabel" type="text" size="30" value="V1" label="Label for Y axis"/>
|
||||
<param name="ymin" type="integer" size="4" value="0" label="Minimal value on Y axis" help="set to 0 for autoscaling"/>
|
||||
<param name="ymax" type="integer" size="4" value="0" label="Maximal value on Y axis" help="set to 0 for autoscaling"/>
|
||||
<param name="pdf_size" type="select" label="Choose chart size (inches)" help="inch = 2.54 cm">
|
||||
<option value="11,8">Normal: 11 by 8</option>
|
||||
<option value="5,3">Small: 5 by 3</option>
|
||||
<option value="17,11">Large: 17 by 11</option>
|
||||
<option value="8,11">Normal Flipped: 8 by 11</option>
|
||||
<option value="3,5">Small Flipped: 3 by 5</option>
|
||||
<option value="11,17">Large Flipped: 11 by 17</option>
|
||||
</param>
|
||||
<param name="ymin" type="integer" size="4" value="0" label="Minimal value on Y axis" help="set to 0 for autoscaling"/>
|
||||
<param name="ymax" type="integer" size="4" value="0" label="Maximal value on Y axis" help="set to 0 for autoscaling"/>
|
||||
<param name="pdf_size" type="select" label="Choose chart size (inches)" help="inch = 2.54 cm">
|
||||
<option value="11,8">Normal: 11 by 8</option>
|
||||
<option value="5,3">Small: 5 by 3</option>
|
||||
<option value="17,11">Large: 17 by 11</option>
|
||||
<option value="8,11">Normal Flipped: 8 by 11</option>
|
||||
<option value="3,5">Small Flipped: 3 by 5</option>
|
||||
<option value="11,17">Large Flipped: 11 by 17</option>
|
||||
</param>
|
||||
</inputs>
|
||||
<outputs>
|
||||
<data format="pdf" name="out_file1" />
|
||||
</outputs>
|
||||
<requirements>
|
||||
<requirement type="python-module">Gnuplot</requirement>
|
||||
<requirement type="python-module">Numeric</requirement>
|
||||
</requirements>
|
||||
<requirements>
|
||||
<requirement type="python-module">Gnuplot</requirement>
|
||||
<requirement type="python-module">Numeric</requirement>
|
||||
</requirements>
|
||||
<help>
|
||||
|
||||
**What it does**
|
||||
|
||||
This tool builds a bar chart on one or more columns. Suppose you have dataset like this one::
|
||||
|
||||
Gene1 10 15␍ Gene2 20 14␍ Gene3 67 45␍ Gene4 55 12
|
||||
|
||||
Graphing columns 2 and 3 while using column 1 for X Tick Labels will produce the following plot:
|
||||
|
||||
.. image:: ../static/images/bar_chart.png
|
||||
:height: 324
|
||||
:width: 540
|
||||
**What it does**
|
||||
|
||||
This tool builds a bar chart on one or more columns. Suppose you have dataset like this one::
|
||||
|
||||
Gene1 10 15
|
||||
Gene2 20 14
|
||||
Gene3 67 45
|
||||
Gene4 55 12
|
||||
|
||||
Graphing columns 2 and 3 while using column 1 for X Tick Labels will produce the following plot:
|
||||
|
||||
.. image:: ../static/images/bar_chart.png
|
||||
:height: 324
|
||||
:width: 540
|
||||
|
||||
</help>
|
||||
</tool>
|
||||
|
||||
@@ -50,7 +50,6 @@ def rate_estimator(win, blk_lines, wstart, wend, wspecies):
|
||||
print >>fout, "%s\t%s\t%s\t%s\t%.2e\t%.2e" %(win, wspecies, wstart, wend, irate , drate)
|
||||
|
||||
def main():
|
||||
GALAXY_TMP_FILE_DIR = sys.argv.pop()
|
||||
infile = sys.argv[1]
|
||||
for i, line in enumerate( file ( infile )):
|
||||
line = line.rstrip('\r\n')
|
||||
@@ -69,7 +68,7 @@ def main():
|
||||
blk=0
|
||||
win=0
|
||||
linestr=""
|
||||
sorted_infile = tempfile.NamedTemporaryFile( dir=GALAXY_TMP_FILE_DIR )
|
||||
sorted_infile = tempfile.NamedTemporaryFile()
|
||||
cmdline = "sort -n -k"+str(species_ind+2)+" -o "+sorted_infile.name+" "+infile
|
||||
try:
|
||||
os.system(cmdline)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<tool id="getIndelRates_3way" name="Estimate Indel Rates" version="1.0.0">
|
||||
<description> for 3-way alignments</description>
|
||||
<command interpreter="python">
|
||||
getIndelRates_3way.py $input1 $out_file1 $winsize $species ${GALAXY_TMP_FILE_DIR}
|
||||
getIndelRates_3way.py $input1 $out_file1 $winsize $species
|
||||
</command>
|
||||
<inputs>
|
||||
<page>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<tool id="aggregate_scores_in_intervals2" description="such as phastCons, GERP, binCons, and others for a set of genomic intervals" name="Aggregate datapoints" version="1.1.1">
|
||||
<description>Appends the average, min, max of datapoints per interval</description>
|
||||
<command interpreter="python">
|
||||
#if $score_source_type.score_source == "user":#aggregate_scores_in_intervals.py $score_source_type.input2 $input1 $input1_chromCol $input1_startCol $input1_endCol $out_file1 ${GALAXY_TMP_FILE_DIR} --chrom_buffer=3
|
||||
#else:#aggregate_scores_in_intervals.py $score_source_type.datasets $input1 $input1_chromCol $input1_startCol $input1_endCol $out_file1 ${GALAXY_TMP_FILE_DIR} -b
|
||||
#if $score_source_type.score_source == "user":#aggregate_scores_in_intervals.py $score_source_type.input2 $input1 $input1_chromCol $input1_startCol $input1_endCol $out_file1 --chrom_buffer=3
|
||||
#else:#aggregate_scores_in_intervals.py $score_source_type.datasets $input1 $input1_chromCol $input1_startCol $input1_endCol $out_file1 -b
|
||||
#end if
|
||||
</command>
|
||||
<inputs>
|
||||
|
||||
@@ -37,8 +37,8 @@ class PositionalScoresOnDisk:
|
||||
fmt_size = struct.calcsize( fmt )
|
||||
default_value = float( 'nan' )
|
||||
|
||||
def __init__( self, directory=None ):
|
||||
self.file = tempfile.TemporaryFile( mode='w+b', dir=directory )
|
||||
def __init__( self ):
|
||||
self.file = tempfile.TemporaryFile( 'w+b' )
|
||||
self.length = 0
|
||||
def __getitem__( self, i ):
|
||||
if i < 0: i = self.length + i
|
||||
@@ -91,7 +91,7 @@ def stop_err(msg):
|
||||
sys.stderr.write(msg)
|
||||
sys.exit()
|
||||
|
||||
def load_scores_wiggle( fname, chrom_buffer_size=3, directory=None ):
|
||||
def load_scores_wiggle( fname, chrom_buffer_size = 3 ):
|
||||
"""
|
||||
Read a wiggle file and return a dict of BinnedArray objects keyed
|
||||
by chromosome.
|
||||
@@ -104,7 +104,7 @@ def load_scores_wiggle( fname, chrom_buffer_size=3, directory=None ):
|
||||
scores_by_chrom[chrom] = BinnedArray()
|
||||
chrom_buffer_size -= 1
|
||||
else:
|
||||
scores_by_chrom[chrom] = PositionalScoresOnDisk( directory=directory )
|
||||
scores_by_chrom[chrom] = PositionalScoresOnDisk()
|
||||
scores_by_chrom[chrom][pos] = val
|
||||
except UCSCLimitException:
|
||||
# Wiggle data was truncated, at the very least need to warn the user.
|
||||
@@ -137,7 +137,6 @@ def main():
|
||||
out_file = open( args[5], 'w' )
|
||||
else:
|
||||
out_file = sys.stdout
|
||||
GALAXY_TMP_FILE_DIR = sys.argv[6]
|
||||
binned = bool( options.binned )
|
||||
mask_fname = options.mask
|
||||
except:
|
||||
@@ -163,7 +162,7 @@ def main():
|
||||
chrom_buffer = int( options.chrom_buffer )
|
||||
except:
|
||||
chrom_buffer = 3
|
||||
scores_by_chrom = load_scores_wiggle( score_fname, chrom_buffer_size=chrom_buffer, directory=GALAXY_TMP_FILE_DIR )
|
||||
scores_by_chrom = load_scores_wiggle( score_fname, chrom_buffer )
|
||||
|
||||
if mask_fname:
|
||||
masks = binned_bitsets_from_file( open( mask_fname ) )
|
||||
|
||||
@@ -11,15 +11,14 @@ def stop_err(msg):
|
||||
sys.exit()
|
||||
|
||||
def main():
|
||||
GALAXY_TMP_FILE_DIR = sys.argv[1]
|
||||
inputfile = sys.argv[3]
|
||||
inputfile = sys.argv[2]
|
||||
|
||||
ops = []
|
||||
cols = []
|
||||
rounds = []
|
||||
elems = []
|
||||
|
||||
for var in sys.argv[5:]:
|
||||
for var in sys.argv[4:]:
|
||||
ops.append(var.split()[0])
|
||||
cols.append(var.split()[1])
|
||||
rounds.append(var.split()[2])
|
||||
@@ -43,7 +42,7 @@ def main():
|
||||
stop_err( "The data in your input dataset is either missing or not formatted properly." )
|
||||
|
||||
try:
|
||||
group_col = int( sys.argv[4] )-1
|
||||
group_col = int( sys.argv[3] )-1
|
||||
except:
|
||||
stop_err( "Group column not specified." )
|
||||
|
||||
@@ -61,7 +60,7 @@ def main():
|
||||
msg = "Operation '%s' cannot be performed on non-numeric data." %ops[k]
|
||||
stop_err( msg )
|
||||
|
||||
tmpfile = tempfile.NamedTemporaryFile( dir=GALAXY_TMP_FILE_DIR )
|
||||
tmpfile = tempfile.NamedTemporaryFile()
|
||||
|
||||
try:
|
||||
"""
|
||||
@@ -87,7 +86,7 @@ def main():
|
||||
invalid_line = ''
|
||||
invalid_value = ''
|
||||
invalid_column = 0
|
||||
fout = open(sys.argv[2], "w")
|
||||
fout = open(sys.argv[1], "w")
|
||||
|
||||
for ii, line in enumerate( file( tmpfile.name )):
|
||||
if line and not line.startswith( '#' ):
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
<tool id="Grouping1" name="Group">
|
||||
<description>data by a column and perform aggregate operation on other columns.</description>
|
||||
<command interpreter="python">
|
||||
grouping.py
|
||||
${GALAXY_TMP_FILE_DIR}
|
||||
grouping.py
|
||||
$out_file1
|
||||
$input1
|
||||
$groupcol
|
||||
|
||||
@@ -23,7 +23,6 @@ def main():
|
||||
datafile = sys.argv[1]
|
||||
outfile_name = sys.argv[2]
|
||||
expression = sys.argv[3]
|
||||
GALAXY_TMP_FILE_DIR = sys.argv[4]
|
||||
except:
|
||||
stop_err( 'Usage: python gsummary.py input_file ouput_file expression' )
|
||||
|
||||
@@ -52,7 +51,7 @@ def main():
|
||||
except:
|
||||
pass
|
||||
|
||||
tmp_file = tempfile.NamedTemporaryFile( mode='w+b', dir=GALAXY_TMP_FILE_DIR )
|
||||
tmp_file = tempfile.NamedTemporaryFile( 'w+b' )
|
||||
# Write the R header row to the temporary file
|
||||
hdr_str = "\t".join( "c%s" % str( col+1 ) for col in cols )
|
||||
tmp_file.write( "%s\n" % hdr_str )
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<tool id="Summary_Statistics1" name="Summary Statistics">
|
||||
<description>for any numerical column</description>
|
||||
<command interpreter="python">gsummary.py $input $out_file1 "$cond" ${GALAXY_TMP_FILE_DIR}</command>
|
||||
<command interpreter="python">gsummary.py $input $out_file1 "$cond"</command>
|
||||
<inputs>
|
||||
<param format="tabular" name="input" type="data" label="Summary statistics on" help="Query missing? See TIP below"/>
|
||||
<param name="cond" size="30" type="text" value="c5" label="Column or expression" help="See syntax below">
|
||||
|
||||
@@ -78,6 +78,15 @@ taxRank = {
|
||||
def stop_err(msg):
|
||||
sys.stderr.write(msg)
|
||||
sys.exit()
|
||||
|
||||
|
||||
db = tempfile.NamedTemporaryFile('w')
|
||||
|
||||
try:
|
||||
con = sqlite.connect(db.name)
|
||||
cur = con.cursor()
|
||||
except:
|
||||
stop_err('Cannot connect to %s\n') % db.name
|
||||
|
||||
try:
|
||||
tax_file = open(sys.argv[1], 'r')
|
||||
@@ -91,18 +100,10 @@ try:
|
||||
else:
|
||||
stop_err('Please specify "reads" or "counts" for output format\n')
|
||||
out_file = open(sys.argv[5], 'w')
|
||||
GALAXY_TMP_FILE_DIR = sys.argv[6]
|
||||
|
||||
except:
|
||||
stop_err('Check arguments')
|
||||
|
||||
db = tempfile.NamedTemporaryFile( mode='w', dir=GALAXY_TMP_FILE_DIR )
|
||||
|
||||
try:
|
||||
con = sqlite.connect(db.name)
|
||||
cur = con.cursor()
|
||||
except:
|
||||
stop_err('Cannot connect to %s\n') % db.name
|
||||
|
||||
stop_err('Check arguments\n')
|
||||
|
||||
if taxa[0] == 'None': stop_err('Please, use checkboxes to specify taxonomic ranks.\n')
|
||||
|
||||
sql = ""
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<tool id="find_diag_hits" name="Find diagnostic hits" version="1.0.0">
|
||||
<description></description>
|
||||
<command interpreter="python">find_diag_hits.py $input1 $id_col $rank_list $out_format $out_file1 ${GALAXY_TMP_FILE_DIR}</command>
|
||||
<command interpreter="python">find_diag_hits.py $input1 $id_col $rank_list $out_format $out_file1</command>
|
||||
<inputs>
|
||||
<param format="taxonomy" name="input1" type="data" label="Find diagnostic hits in"/>
|
||||
<param name="id_col" type="data_column" data_ref="input1" numerical="False" label="Select column with sequence id" />
|
||||
@@ -58,7 +58,8 @@ When performing metagenomic analyses it is often necessary to identify sequence
|
||||
|
||||
Suppose the *Taxonomy manipulation->Fetch Taxonomic Ranks* generated the following taxonomy representation::
|
||||
|
||||
read1 2 root Eukaryota Metazoa n n Chordata Craniata Gnathostomata Mammalia n Laurasiatheria n Ruminantia n Bovidae Bovinae n n Bos n Bos taurus n␍ read2 12585 root Eukaryota Metazoa n n Chordata Craniata Gnathostomata Mammalia n Euarchontoglires Primates Haplorrhini Hominoidea Hominidae n n n Homo n Homo sapiens n
|
||||
read1 2 root Eukaryota Metazoa n n Chordata Craniata Gnathostomata Mammalia n Laurasiatheria n Ruminantia n Bovidae Bovinae n n Bos n Bos taurus n
|
||||
read2 12585 root Eukaryota Metazoa n n Chordata Craniata Gnathostomata Mammalia n Euarchontoglires Primates Haplorrhini Hominoidea Hominidae n n n Homo n Homo sapiens n
|
||||
read1 58615 root Eukaryota Metazoa n n Arthropoda n Hexapoda Insecta Neoptera Amphiesmenoptera Lepidoptera Glossata Papilionoidea Nymphalidae Nymphalinae Melitaeini Phyciodina Anthanassa n Anthanassa otanes n
|
||||
read3 56785 root Eukaryota Metazoa n n Chordata Craniata Gnathostomata Mammalia n Euarchontoglires Primates Haplorrhini Hominoidea Hominidae n n n Homo n Homo sapiens n
|
||||
|
||||
|
||||
@@ -137,7 +137,6 @@ try:
|
||||
name_col = int( sys.argv[3] ) - 1 # column containing sequence names
|
||||
out_f = sys.argv[4] # output file
|
||||
tool_data = sys.argv[5]
|
||||
GALAXY_TMP_FILE_DIR = sys.argv[6]
|
||||
except:
|
||||
stop_err('Check arguments\n')
|
||||
|
||||
@@ -162,7 +161,7 @@ g2n = gi_name_to_sorted_list(in_f, gi_col, name_col)
|
||||
if len(g2n) == 0:
|
||||
stop_err('No valid GI-containing fields. Please, check your column assignments.\n')
|
||||
|
||||
tb_F = tempfile.NamedTemporaryFile( mode='w', dir=GALAXY_TMP_FILE_DIR )
|
||||
tb_F = tempfile.NamedTemporaryFile('w')
|
||||
|
||||
get_taxId( GI2TAX, collapse_repeating_gis( g2n ), tb_F.name )
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<tool id="Fetch Taxonomic Ranks" name="Fetch taxonomic representation" version="1.1.0">
|
||||
<description></description>
|
||||
<command interpreter="python">gi2taxonomy.py $input $giField $idField $out_file1 ${GALAXY_DATA_INDEX_DIR} ${GALAXY_TMP_FILE_DIR}</command>
|
||||
<command interpreter="python">gi2taxonomy.py $input $giField $idField $out_file1 ${GALAXY_DATA_INDEX_DIR}</command>
|
||||
<inputs>
|
||||
<param format="tabular" name="input" type="data" label="Show taxonomic representation for"></param>
|
||||
<param name="giField" label="GIs column" type="data_column" data_ref="input" numerical="True" help="select column containing GI numbers"/>
|
||||
|
||||
@@ -29,27 +29,39 @@ try:
|
||||
font_size = sys.argv[4]
|
||||
max_leaves = sys.argv[5]
|
||||
dups = sys.argv[6]
|
||||
GALAXY_TMP_FILE_DIR = sys.argv[7]
|
||||
except:
|
||||
stop_err('Check arguments\n')
|
||||
|
||||
newick_file = tempfile.NamedTemporaryFile( mode='w', dir=GALAXY_TMP_FILE_DIR )
|
||||
ps_file = tempfile.NamedTemporaryFile( mode='w', dir=GALAXY_TMP_FILE_DIR )
|
||||
newick_file = tempfile.NamedTemporaryFile('w')
|
||||
ps_file = tempfile.NamedTemporaryFile('w')
|
||||
|
||||
# Execute taxonomy2tree
|
||||
|
||||
try:
|
||||
t2t_cmd = 'taxonomy2tree %s %s %s /dev/null 1 &> /dev/null' % ( tree_file, max_tree_level, newick_file.name )
|
||||
retcode = subprocess.call( t2t_cmd, shell=True )␍ if retcode < 0:␍ print >>sys.stderr, "Execution of taxonomy2tree terminated by signal", -retcode␍except OSError, e:␍ print >>sys.stderr, "Execution of taxonomy2tree failed:", e
|
||||
retcode = subprocess.call( t2t_cmd, shell=True )
|
||||
if retcode < 0:
|
||||
print >>sys.stderr, "Execution of taxonomy2tree terminated by signal", -retcode
|
||||
except OSError, e:
|
||||
print >>sys.stderr, "Execution of taxonomy2tree failed:", e
|
||||
|
||||
|
||||
# Execute tree2PS-fast
|
||||
|
||||
try:
|
||||
t2ps_cmd = 'tree2PS-fast %s %s %s %s %s %s' % ( newick_file.name, ps_file.name, max_tree_level, font_size, max_leaves, dups )
|
||||
retcode = subprocess.call( t2ps_cmd, shell=True )␍ if retcode < 0:␍ print >>sys.stderr, "Execution of tree2PS-fast terminated by signal", -retcode␍except OSError, e:␍ print >>sys.stderr, "Execution of tree2PS-fast failed:", e
|
||||
retcode = subprocess.call( t2ps_cmd, shell=True )
|
||||
if retcode < 0:
|
||||
print >>sys.stderr, "Execution of tree2PS-fast terminated by signal", -retcode
|
||||
except OSError, e:
|
||||
print >>sys.stderr, "Execution of tree2PS-fast failed:", e
|
||||
|
||||
# Convert PS to PDF
|
||||
|
||||
try:
|
||||
ps2pdf_cmd = 'ps2pdf %s %s' % ( ps_file.name, pdf_file )␍ retcode = subprocess.call( ps2pdf_cmd, shell=True )␍ if retcode < 0:␍ print >>sys.stderr, "Execution of ps2pdf terminated by signal", -retcode␍except OSError, e:␍ print >>sys.stderr, "Execution of ps2pdf failed:", e
|
||||
ps2pdf_cmd = 'ps2pdf %s %s' % ( ps_file.name, pdf_file )
|
||||
retcode = subprocess.call( ps2pdf_cmd, shell=True )
|
||||
if retcode < 0:
|
||||
print >>sys.stderr, "Execution of ps2pdf terminated by signal", -retcode
|
||||
except OSError, e:
|
||||
print >>sys.stderr, "Execution of ps2pdf failed:", e
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<tool id="Draw_phylogram" name="Draw phylogeny" version="1.0.0">
|
||||
<description></description>
|
||||
<command interpreter="python">t2ps_wrapper.py $input $out_file1 $max_tree_level $font_size $max_leaves 1 ${GALAXY_TMP_FILE_DIR}</command>
|
||||
<command interpreter="python">t2ps_wrapper.py $input $out_file1 $max_tree_level $font_size $max_leaves 1</command>
|
||||
<inputs>
|
||||
<param format="taxonomy" name="input" type="data" label="Draw phylogram for"></param>
|
||||
<param name="max_tree_level" label="show ranks from root to" type="select" help="Choosing to show entire tree may produce very large PDF file disabling your viewer">
|
||||
|
||||
Reference in New Issue
Block a user