Changeset 1354:0000247a6bd8

Show
Ignore:
Timestamp:
06/03/08 16:29:54 (7 months ago)
Author:
Greg Von Kuster <greg@bx.psu.edu>
branch:
default
convert_revision:
svn:9bcadc22-80f8-0310-8a53-c8f022958886/galaxy/trunk@2715
Message:

Requires config change, temporary files are now created in a configurable location - affects many tools.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lib/galaxy/config.py

    r1301 r1354  
    3232        self.file_path = resolve_path( kwargs.get( "file_path", "database/files" ), self.root ) 
    3333        self.new_file_path = resolve_path( kwargs.get( "new_file_path", "database/tmp" ), self.root ) 
     34        # Directory to be used when creating temporary files ( generally from tools ) 
     35        self.tmp_file_path = resolve_path( kwargs.get( "tmp_file_path", "/tmp" ), self.root ) 
    3436        self.tool_path = resolve_path( kwargs.get( "tool_path", "tools" ), self.root ) 
    3537        self.tool_data_path = resolve_path( kwargs.get( "tool_data_path", "tool-data" ), os.getcwd() ) 
  • lib/galaxy/datatypes/data.py

    r1304 r1354  
    224224class Text( Data ): 
    225225 
    226     def write_from_stream(self, dataset, stream): 
     226    def write_from_stream( self, dataset, stream, directory=None ): 
    227227        """Writes data from a stream""" 
    228228        # write it twice for now  
    229         fd, temp_name = tempfile.mkstemp(
     229        fd, temp_name = tempfile.mkstemp( dir=directory
    230230        while 1: 
    231231            chunk = stream.read(1048576) 
     
    242242        fp.close() 
    243243 
    244     def set_raw_data(self, dataset, data): 
     244    def set_raw_data( self, dataset, data, directory=None ): 
    245245        """Saves the data on the disc""" 
    246         fd, temp_name = tempfile.mkstemp(
     246        fd, temp_name = tempfile.mkstemp( dir=directory
    247247        os.write(fd, data) 
    248248        os.close(fd) 
  • lib/galaxy/datatypes/sniff.py

    r1335 r1354  
    1313    return full_path 
    1414 
    15 def stream_to_file(stream): 
     15def stream_to_file( stream, directory=None ): 
    1616    """ 
    1717    Writes a stream to a temporary file, returns the temporary file's name 
    1818    """ 
    19     fd, temp_name = tempfile.mkstemp(
     19    fd, temp_name = tempfile.mkstemp( dir=directory
    2020    while 1: 
    2121        chunk = stream.read(1048576) 
     
    2626    return temp_name 
    2727 
    28 def convert_newlines( fname ): 
     28def convert_newlines( fname, directory=None ): 
    2929    """ 
    3030    Converts in place a file from universal line endings  
     
    3838    '1 2\\n3 4\\n' 
    3939    """ 
    40     fd, temp_name = tempfile.mkstemp(
     40    fd, temp_name = tempfile.mkstemp( dir=directory
    4141    fp = os.fdopen( fd, "wt" ) 
    4242    for i, line in enumerate( file( fname, "U" ) ): 
     
    4747    return i + 1 
    4848 
    49 def sep2tabs(fname, patt="\\s+"): 
     49def sep2tabs( fname, patt="\\s+", directory=None ): 
    5050    """ 
    5151    Transforms in place a 'sep' separated file to a tab separated one 
     
    5959    """ 
    6060    regexp = re.compile( patt ) 
    61     fd, temp_name = tempfile.mkstemp(
     61    fd, temp_name = tempfile.mkstemp( dir=directory
    6262    fp = os.fdopen( fd, "wt" ) 
    6363    for i, line in enumerate( file( fname ) ): 
     
    7070    return i + 1 
    7171 
    72 def convert_newlines_sep2tabs( fname, patt="\\s+" ): 
     72def convert_newlines_sep2tabs( fname, patt="\\s+", directory=None ): 
    7373    """ 
    7474    Combines above methods: convert_newlines() and sep2tabs() 
     
    8383    """ 
    8484    regexp = re.compile( patt ) 
    85     fd, temp_name = tempfile.mkstemp(
     85    fd, temp_name = tempfile.mkstemp( dir=directory
    8686    fp = os.fdopen( fd, "wt" ) 
    8787    for i, line in enumerate( file( fname, "U" ) ): 
  • lib/galaxy/model/__init__.py

    r1304 r1354  
    175175                    ERROR = 'error', 
    176176                    DELETED = 'deleted') 
     177    # The following is used for functional tests 
    177178    file_path = "/tmp/" 
    178179    engine = None 
  • lib/galaxy/tools/__init__.py

    r1331 r1354  
    986986        # The following points to location (xxx.loc) files which are pointers to locally cached data 
    987987        param_dict['GALAXY_DATA_INDEX_DIR'] = self.app.config.tool_data_path 
     988        # Directory to be used when creating temporary files ( generally from tools ) 
     989        param_dict['GALAXY_TMP_FILE_DIR'] = self.app.config.tmp_file_path 
    988990        # Return the dictionary of parameters 
    989991        return param_dict 
  • lib/galaxy/tools/actions/upload.py

    r1335 r1354  
    8080    def add_file( self, trans, file_obj, file_name, file_type, dbkey, info=None, space_to_tab=False ): 
    8181        data_type = None 
    82         temp_name = sniff.stream_to_file( file_obj ) 
     82        tmp_file_path = trans.app.config.tmp_file_path 
     83        temp_name = sniff.stream_to_file( file_obj, directory=tmp_file_path ) 
    8384         
    8485        # See if we have an empty file 
     
    9394            #We need to decompress the temp_name file 
    9495            CHUNK_SIZE = 2**20 # 1Mb    
    95             fd, uncompressed = tempfile.mkstemp()    
     96            fd, uncompressed = tempfile.mkstemp( dir=tmp_file_path )    
    9697            gzipped_file = gzip.GzipFile( temp_name ) 
    9798            while 1: 
     
    147148        if data_type != 'binary' and data_type != 'zip': 
    148149            if space_to_tab: 
    149                 self.line_count = sniff.convert_newlines_sep2tabs( temp_name
     150                self.line_count = sniff.convert_newlines_sep2tabs( temp_name, directory=tmp_file_path
    150151            else: 
    151152                self.line_count = sniff.convert_newlines( temp_name ) 
  • lib/galaxy/tools/util/hyphy_util.py

    r1196 r1354  
    33import tempfile, os 
    44 
    5 def get_filled_temp_filename(contents): 
    6     fh = tempfile.NamedTemporaryFile('w'
     5def get_filled_temp_filename( contents, directory=None ): 
     6    fh = tempfile.NamedTemporaryFile( mode='w', dir=directory
    77    filename = fh.name 
    88    fh.close() 
  • lib/galaxy/tools/util/maf_utilities.py

    r1338 r1354  
    144144 
    145145#builds and returns (index, index_filename) for specified maf_file 
    146 def build_maf_index( maf_file, species = None ): 
     146def build_maf_index( maf_file, species=None, directory=None ): 
    147147    indexes = bx.interval_index_file.Indexes() 
    148148    try: 
     
    157157                    continue 
    158158                indexes.add( c.src, c.forward_strand_start, c.forward_strand_end, pos ) 
    159         fd, index_filename = tempfile.mkstemp(
     159        fd, index_filename = tempfile.mkstemp( dir=directory
    160160        out = os.fdopen( fd, 'w' ) 
    161161        indexes.write( out ) 
  • tools/data_source/biomart_filter.py

    r1335 r1354  
    5656        if not data.missing_meta(): 
    5757            line_ctr = -1 
    58             temp = tempfile.NamedTemporaryFile('w'
     58            temp = tempfile.NamedTemporaryFile( mode='w', dir=app.config.tmp_file_path
    5959            temp_filename = temp.name 
    6060            temp.close() 
  • tools/data_source/gbrowse_datasource.py

    r1303 r1354  
    11#!/usr/bin/env python 
    22#Retreives data from GMOD and stores in a file. GBrowse parameters are provided in the input/output file. 
    3 import urllib, sys, os, gzip, tempfile, shutil 
     3import urllib, sys 
    44from galaxy import eggs 
    55from galaxy.datatypes import data 
  • tools/data_source/hbvar_filter.py

    r835 r1354  
    5151        if not data.missing_meta(): 
    5252            line_ctr = -1 
    53             temp = tempfile.NamedTemporaryFile('w'
     53            temp = tempfile.NamedTemporaryFile( mode='w', dir=app.config.tmp_file_path
    5454            temp_filename = temp.name 
    5555            temp.close() 
  • tools/data_source/ucsc_tablebrowser.py

    r1181 r1354  
    2121def __main__(): 
    2222    filename = sys.argv[1] 
     23    GALAXY_TMP_FILE_DIR = sys.argv[2] 
    2324    params = {} 
    2425     
     
    5051    out.close() 
    5152    if check_gzip( filename ): 
    52         fd, uncompressed = tempfile.mkstemp(
     53        fd, uncompressed = tempfile.mkstemp( dir=GALAXY_TMP_FILE_DIR
    5354        gzipped_file = gzip.GzipFile( filename ) 
    5455        while 1: 
  • tools/data_source/ucsc_tablebrowser.xml

    r1129 r1354  
    44        <description>table browser</description> 
    55         
    6         <command interpreter="python">ucsc_tablebrowser.py $output</command> 
     6        <command interpreter="python">ucsc_tablebrowser.py $output ${GALAXY_TMP_FILE_DIR}</command> 
    77         
    88        <inputs action="http://genome.ucsc.edu/cgi-bin/hgTables" check_values="false" method="get"> 
  • tools/data_source/ucsc_tablebrowser_archaea.xml

    r1129 r1354  
    44        <description>table browser</description> 
    55         
    6         <command interpreter="python">ucsc_tablebrowser.py $output</command> 
     6        <command interpreter="python">ucsc_tablebrowser.py $output ${GALAXY_TMP_FILE_DIR}</command> 
    77         
    88        <inputs action="http://archaea.ucsc.edu/cgi-bin/hgTables" check_values="false" method="get"> 
  • tools/data_source/ucsc_tablebrowser_test.xml

    r1129 r1354  
    44        <description>table browser</description> 
    55         
    6         <command interpreter="python">ucsc_tablebrowser.py $output</command> 
     6        <command interpreter="python">ucsc_tablebrowser.py $output ${GALAXY_TMP_FILE_DIR}</command> 
    77         
    88        <inputs action="http://genome-test.cse.ucsc.edu/cgi-bin/hgTables" check_values="false" method="get"> 
  • tools/fasta_tools/fasta_concatenate_by_species.py

    r1172 r1354  
    1515    input_filename = sys.argv[1] 
    1616    output_filename = sys.argv[2] 
     17    tmp_file_dir = sys.argv[3] 
    1718    species = odict() 
    1819    cur_size = 0 
     
    2122        for component in components: 
    2223            if component.species not in species: 
    23                 species[component.species] = tempfile.TemporaryFile(
     24                species[component.species] = tempfile.TemporaryFile( dir=tmp_file_dir
    2425                species[component.species].write( "-" * cur_size ) 
    2526            species[component.species].write( component.text ) 
  • tools/fasta_tools/fasta_concatenate_by_species.xml

    r1242 r1354  
    11<tool id="fasta_concatenate0" name="Concatenate" version="0.0.0"> 
    22  <description>FASTA alignment by species</description> 
    3   <command interpreter="python">fasta_concatenate_by_species.py $input1 $out_file1</command> 
     3  <command interpreter="python">fasta_concatenate_by_species.py $input1 $out_file1 ${GALAXY_TMP_FILE_DIR}</command> 
    44  <inputs> 
    55    <param name="input1" type="data" format="fasta" label="FASTA alignment"/> 
  • tools/filters/join.py

    r1012 r1354  
    1313 
    1414class OffsetList: 
    15     def __init__( self, filesize = 0, fmt = None ): 
    16         self.file = tempfile.NamedTemporaryFile( 'w+b'
     15    def __init__( self, filesize=0, fmt=None, directory=None ): 
     16        self.file = tempfile.NamedTemporaryFile( mode='w+b', dir=directory
    1717        if fmt: 
    1818            self.fmt = fmt 
     
    6060 
    6161class SortedOffsets( OffsetList ): 
    62     def __init__( self, indexed_filename, column, split = None ): 
    63         OffsetList.__init__( self, os.stat( indexed_filename ).st_size
     62    def __init__( self, indexed_filename, column, tmp_file_dir, split = None ): 
     63        OffsetList.__init__( self, filesize=os.stat( indexed_filename ).st_size, directory=tmp_file_dir
    6464        self.indexed_filename = indexed_filename 
    6565        self.indexed_file = open( indexed_filename, 'rb' ) 
    6666        self.column = column 
     67        self.tmp_file_dir = tmp_file_dir 
    6768        self.split = split 
    6869        self.last_identifier = None 
     
    7576        identifier2 = keys.pop( 0 ) 
    7677         
    77         result_offsets = OffsetList( fmt = self.fmt
     78        result_offsets = OffsetList( fmt=self.fmt, directory=self.tmp_file_dir
    7879        offsets1 = enumerate( self.get_offsets() ) 
    7980        try: 
     
    125126#indexed set of offsets, index is built on demand 
    126127class OffsetIndex: 
    127     def __init__( self, filename, column, split = None, index_depth = 3 ): 
     128    def __init__( self, filename, column, tmp_file_dir, split = None, index_depth = 3 ): 
    128129        self.filename = filename 
    129130        self.file = open( filename, 'rb' ) 
    130131        self.column = column 
     132        self.tmp_file_dir = tmp_file_dir 
    131133        self.split = split 
    132134        self._offsets = {} 
     
    193195            if not keys: 
    194196                if first_char not in self._offsets: 
    195                     self._offsets[first_char] = SortedOffsets( self.filename, self.column, self.split ) 
     197                    self._offsets[first_char] = SortedOffsets( self.filename, self.column, self.tmp_file_dir, split=self.split ) 
    196198                self._offsets[first_char].merge_with_dict( temp ) 
    197199                return 
     
    201203            else: 
    202204                if first_char not in self._offsets: 
    203                     self._offsets[first_char] = SortedOffsets( self.filename, self.column, self.split ) 
     205                    self._offsets[first_char] = SortedOffsets( self.filename, self.column, self.tmp_file_dir, split=self.split ) 
    204206                self._offsets[first_char].merge_with_dict( temp ) 
    205207                temp = { identifier: d[identifier] } 
     
    207209 
    208210class BufferedIndex: 
    209     def __init__( self, filename, column, split = None, buffer = 1000000, index_depth = 3 ): 
    210         self.index = OffsetIndex( filename, column, split, index_depth ) 
     211    def __init__( self, filename, column, tmp_file_dir, split = None, buffer = 1000000, index_depth = 3 ): 
     212        self.index = OffsetIndex( filename, column, tmp_file_dir, split=split, index_depth=index_depth ) 
    211213        self.buffered_offsets = {} 
    212214        f = open( filename, 'rb' ) 
     
    236238                yield self.index.get_line_by_offset( offset ) 
    237239 
    238 def join_files( filename1, column1, filename2, column2, out_filename, split = None, buffer = 1000000, keep_unmatched = False, keep_partial = False, index_depth = 3 ): 
     240def join_files( filename1, column1, filename2, column2, out_filename, tmp_file_dir, split = None, buffer = 1000000, keep_unmatched = False, keep_partial = False, index_depth = 3 ): 
    239241    #return identifier based upon line 
    240242    def get_identifier_by_line( line, column, split = None ): 
     
    245247        return None 
    246248    out = open( out_filename, 'w+b' ) 
    247     index = BufferedIndex( filename2, column2, split, buffer, index_depth ) 
     249    index = BufferedIndex( filename2, column2, tmp_file_dir, split=split, buffer=buffer, index_depth=index_depth ) 
    248250    for line1 in open( filename1, 'rb' ): 
    249251        identifier = get_identifier_by_line( line1, column1, split ) 
     
    294296        column2 = int( args[3] ) - 1 
    295297        out_filename = args[4] 
     298        tmp_file_dir = args[5] 
    296299    except: 
    297300        print >> sys.stderr, "Error parsing command line." 
     
    301304    split = "\t" 
    302305     
    303     return join_files( filename1, column1, filename2, column2, out_filename, split, options.buffer, options.keep_unmatched, options.keep_partial, options.index_depth ) 
     306    return join_files( filename1, column1, filename2, column2, out_filename, tmp_file_dir, split, options.buffer, options.keep_unmatched, options.keep_partial, options.index_depth ) 
    304307 
    305308if __name__ == "__main__": main() 
  • tools/filters/joiner.xml

    r1055 r1354  
    11<tool id="join1" name="Join two Queries" version="2.0.0"> 
    22  <description>side by side on a specified field</description> 
    3   <command interpreter="python">join.py $input1 $input2 $field1 $field2 $out_file1 $unmatched $partial --index_depth=3 --buffer=50000000</command> 
     3  <command interpreter="python">join.py $input1 $input2 $field1 $field2 $out_file1 ${GALAXY_TMP_FILE_DIR} $unmatched $partial --index_depth=3 --buffer=50000000</command> 
    44  <inputs> 
    55    <param format="tabular" name="input1" type="data" label="Join"/> 
  • tools/hyphy/hyphy_branch_lengths_wrapper.py

    r1196 r1354  
    55from galaxy.tools.util import hyphy_util 
    66 
     7# Directory to be used when creating temporary files 
     8tmp_file_dir = sys.argv.pop() 
    79#Retrieve hyphy path, this will need to be the same across the cluster 
    810tool_data = sys.argv.pop() 
     
    2022#Set up Temporary files for hyphy run 
    2123#set up tree file 
    22 tree_filename = hyphy_util.get_filled_temp_filename(tree_contents
     24tree_filename = hyphy_util.get_filled_temp_filename( tree_contents, directory=tmp_file_dir
    2325 
    2426#Guess if this is a single or multiple FASTA input file 
     
    3436 
    3537#set up BranchLengths file 
    36 BranchLengths_filename = hyphy_util.get_filled_temp_filename(hyphy_util.BranchLengths
     38BranchLengths_filename = hyphy_util.get_filled_temp_filename( hyphy_util.BranchLengths, directory=tmp_file_dir
    3739if is_multiple:  
    3840    os.unlink(BranchLengths_filename) 
    39     BranchLengths_filename = hyphy_util.get_filled_temp_filename(hyphy_util.BranchLengthsMF
     41    BranchLengths_filename = hyphy_util.get_filled_temp_filename( hyphy_util.BranchLengthsMF, directory=tmp_file_dir
    4042    print "Multiple Alignment Analyses" 
    4143else: print "Single Alignment Analyses" 
  • tools/hyphy/hyphy_branch_lengths_wrapper.xml

    r1196 r1354  
    44        <description>Estimation</description> 
    55         
    6         <command interpreter="python">hyphy_branch_lengths_wrapper.py $input1 $out_file1 "$tree" "$model" "$base_freq" "Global" ${GALAXY_DATA_INDEX_DIR}</command> 
     6        <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> 
    77         
    88    <inputs> 
  • tools/hyphy/hyphy_dnds_wrapper.py

    r1196 r1354  
    55from galaxy.tools.util import hyphy_util 
    66 
     7# Directory to be used when creating temporary files 
     8tmp_file_dir = sys.argv.pop() 
    79#Retrieve hyphy path, this will need to be the same across the cluster 
    810tool_data = sys.argv.pop() 
     
    2123    sys.exit() 
    2224         
    23 tree_filename = hyphy_util.get_filled_temp_filename(tree_contents
     25tree_filename = hyphy_util.get_filled_temp_filename( tree_contents, directory=tmp_file_dir
    2426 
    2527if analysis == "local": 
    26     fitter_filename = hyphy_util.get_filled_temp_filename(hyphy_util.SimpleLocalFitter
     28    fitter_filename = hyphy_util.get_filled_temp_filename( hyphy_util.SimpleLocalFitter, directory=tmp_file_dir
    2729else: 
    28     fitter_filename = hyphy_util.get_filled_temp_filename(hyphy_util.SimpleGlobalFitter
     30    fitter_filename = hyphy_util.get_filled_temp_filename( hyphy_util.SimpleGlobalFitter, directory=tmp_file_dir
    2931 
    30 tabwriter_filename = hyphy_util.get_filled_temp_filename(hyphy_util.TabWriter
    31 FastaReader_filename = hyphy_util.get_filled_temp_filename(hyphy_util.FastaReader
     32tabwriter_filename = hyphy_util.get_filled_temp_filename( hyphy_util.TabWriter, directory=tmp_file_dir
     33FastaReader_filename = hyphy_util.get_filled_temp_filename( hyphy_util.FastaReader, directory=tmp_file_dir
    3234#setup Config file 
    3335config_filename = hyphy_util.get_dnds_config_filename(fitter_filename, tabwriter_filename, "Universal", tree_filename, input_filename, nuc_model, output_filename, FastaReader_filename) 
  • tools/hyphy/hyphy_dnds_wrapper.xml

    r1196 r1354  
    44        <description>Estimation</description> 
    55         
    6         <command interpreter="python">hyphy_dnds_wrapper.py $input1 $out_file1 "$tree" "$model" $analysis ${GALAXY_DATA_INDEX_DIR}</command> 
     6        <command interpreter="python">hyphy_dnds_wrapper.py $input1 $out_file1 "$tree" "$model" $analysis ${GALAXY_DATA_INDEX_DIR} ${GALAXY_TMP_FILE_DIR}</command> 
    77         
    88    <inputs> 
  • tools/hyphy/hyphy_nj_tree_wrapper.py

    r1196 r1354  
    55from galaxy.tools.util import hyphy_util 
    66 
     7# Directory to be used when creating temporary files 
     8tmp_file_dir = sys.argv.pop() 
    79#Retrieve hyphy path, this will need to be the same across the cluster 
    810tool_data = sys.argv.pop() 
     
    1517output_filename2 = os.path.abspath(sys.argv[3].strip()) 
    1618distance_metric = sys.argv[4].strip() 
    17 temp_ps_filename = hyphy_util.get_filled_temp_filename(""
     19temp_ps_filename = hyphy_util.get_filled_temp_filename( "", directory=tmp_file_dir
    1820 
    1921#Guess if this is a single or multiple FASTA input file 
     
    2830    else: found_blank = False 
    2931 
    30 NJ_tree_shared_ibf = hyphy_util.get_filled_temp_filename(hyphy_util.NJ_tree_shared_ibf
     32NJ_tree_shared_ibf = hyphy_util.get_filled_temp_filename( hyphy_util.NJ_tree_shared_ibf, directory=tmp_file_dir
    3133 
    3234#set up NJ_tree file 
    33 NJ_tree_filename = hyphy_util.get_filled_temp_filename(hyphy_util.get_NJ_tree(NJ_tree_shared_ibf)
     35NJ_tree_filename = hyphy_util.get_filled_temp_filename( hyphy_util.get_NJ_tree( NJ_tree_shared_ibf ), directory=tmp_file_dir
    3436#setup Config file 
    3537config_filename = hyphy_util.get_nj_tree_config_filename(input_filename, distance_metric, output_filename1, temp_ps_filename, NJ_tree_filename) 
     
    3739    os.unlink(NJ_tree_filename) 
    3840    os.unlink(config_filename) 
    39     NJ_tree_filename = hyphy_util.get_filled_temp_filename(hyphy_util.get_NJ_treeMF(NJ_tree_shared_ibf)
     41    NJ_tree_filename = hyphy_util.get_filled_temp_filename( hyphy_util.get_NJ_treeMF( NJ_tree_shared_ibf ), directory=tmp_file_dir
    4042    config_filename = hyphy_util.get_nj_treeMF_config_filename(input_filename, output_filename1, temp_ps_filename, distance_metric, NJ_tree_filename) 
    4143    print "Multiple Alignment Analyses" 
  • tools/hyphy/hyphy_nj_tree_wrapper.xml

    r1224 r1354  
    44    <description>Builder</description> 
    55     
    6     <command interpreter="python">hyphy_nj_tree_wrapper.py $input1 $out_file1 $out_file2 $distance_metric ${GALAXY_DATA_INDEX_DIR}</command> 
     6    <command interpreter="python">hyphy_nj_tree_wrapper.py $input1 $out_file1 $out_file2 $distance_metric ${GALAXY_DATA_INDEX_DIR} ${GALAXY_TMP_FILE_DIR}</command> 
    77     
    88    <inputs> 
  • tools/maf/genebed_maf_to_fasta.xml

    r1338 r1354  
    11<tool id="GeneBed_Maf_Fasta2" name="Stitch Gene blocks"> 
    22  <description>given a set of coding exon intervals</description> 
    3   <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} 
    4 #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} 
     3  <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} 
     4#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} 
    55#end if 
    66  </command> 
  • tools/maf/interval2maf.py

    r1172 r1354  
    2121   -p, --species=p: Species to include in output 
    2222   -l, --indexLocation=l: Override default maf_index.loc file 
    23    -z, --mafIndexFile=z: Directory of local maf index file ( maf_index.loc or maf_pairwise.loc ) 
     23   -y, --mafIndexFile=y: Directory of local maf index file ( maf_index.loc or maf_pairwise.loc ) 
     24   -z, --mafTmpFileDir=z: Directory to be used when creating temporary files 
    2425""" 
    2526 
     
    9495            sys.exit() 
    9596    elif options.mafFile: 
    96         index, index_filename = maf_utilities.build_maf_index( options.mafFile, species = [dbkey]
     97        index, index_filename = maf_utilities.build_maf_index( options.mafFile, species=[dbkey], directory=options.mafTmpFileDir
    9798        if index is None: 
    9899            print >> sys.stderr, "Your MAF file appears to be malformed." 
  • tools/maf/interval2maf.xml

    r1338 r1354  
    33  <command interpreter="python"> 
    44    #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 
    5     #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 
     5    #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} 
    66    #end if 
    77  </command> 
  • tools/maf/interval2maf_pairwise.xml

    r1338 r1354  
    11<tool id="Interval2Maf_pairwise1" name="Extract Pairwise MAF blocks"> 
    22  <description>given a set of genomic intervals</description> 
    3   <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> 
     3  <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> 
    44  <inputs> 
    55    <param name="input1" type="data" format="interval" label="Interval File"> 
  • tools/maf/interval_maf_to_merged_fasta.py

    r1172 r1354  
    1919   -o, --output_file=o:      Output MAF file 
    2020   -p, --species=p: Species to include in output 
    21    -z, --mafIndexFileDir=z: Directory of local maf_index.loc file 
     21   -y, --mafIndexFileDir=y: Directory of local maf_index.loc file 
     22   -z, --mafTmpFileDir=z: Directory to be used when creating temporary files 
    2223 
    23 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 
     24usage: %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 
    2425""" 
    2526 
     
    8889            sys.exit() 
    8990    mafIndexFile = "%s/maf_index.loc" % options.mafIndexFileDir 
     91    tmpFileDir = options.mafTmpFileDir 
    9092    #Finish parsing command line 
    9193         
     
    100102    elif options.mafSourceType.lower() in ["user"]: 
    101103        #index maf for use here, need to remove index_file when finished 
    102         index, index_filename = maf_utilities.build_maf_index( options.mafSource, species = [primary_species]
     104        index, index_filename = maf_utilities.build_maf_index( options.mafSource, species=[primary_species], directory=tmpFileDir
    103105        if index is None: 
    104106            print >> sys.stderr, "Your MAF file appears to be malformed." 
  • tools/maf/interval_maf_to_merged_fasta.xml

    r1338 r1354  
    11<tool id="Interval_Maf_Merged_Fasta2" name="Stitch MAF blocks"> 
    22  <description>given a set of genomic intervals</description> 
    3   <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} 
    4 #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} 
     3  <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} 
     4#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} 
    55#end if 
    66  </command> 
  • tools/maf/maf_stats.py

    r1172 r1354  
    3232 
    3333    mafIndexFile = "%s/maf_index.loc" % sys.argv[9] 
     34    tmpFileDir = sys.argv[10] 
    3435    index = index_filename = None 
    3536    if maf_source_type == "user": 
    3637        #index maf for use here 
    37         index, index_filename = maf_utilities.build_maf_index( input_maf_filename, species = [dbkey]
     38        index, index_filename = maf_utilities.build_maf_index( input_maf_filename, species=[dbkey], directory=tmpFileDir
    3839        if index is None: 
    3940            print >>sys.stderr, "Your MAF file appears to be malformed." 
  • tools/maf/maf_stats.xml

    r1338 r1354  
    99    #end if 
    1010    ${GALAXY_DATA_INDEX_DIR} 
     11    ${GALAXY_TMP_FILE_DIR} 
    1112  </command> 
    1213  <inputs> 
  • tools/metag_tools/blat_wrapper.py

    r1180 r1354  
    6868         
    6969    GALAXY_DATA_INDEX_DIR = sys.argv[8] 
     70    GALAXY_TMP_FILE_DIR = sys.argv[9] 
    7071 
    7172    all_files = [] 
     
    9697         
    9798    for detail_file_path in all_files: 
    98         output_tempfile = tempfile.NamedTemporaryFile().name 
     99        output_tempfile = tempfile.NamedTemporaryFile( dir=GALAXY_TMP_FILE_DIR ).name 
    99100        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 ) 
    100101        os.system( command ) 
  • tools/metag_tools/blat_wrapper.xml

    r1224 r1354  
    66    #end if 
    77    ${GALAXY_DATA_INDEX_DIR} 
     8    ${GALAXY_TMP_FILE_DIR} 
    89  </command> 
    910        <inputs> 
  • tools/metag_tools/megablast_wrapper.py

    r1258 r1354  
    2020    mega_iden_cutoff = sys.argv[5]      # -p 
    2121    mega_evalue_cutoff = sys.argv[6]      # -e