Changeset 1470:78e84936b7a3

Show
Ignore:
Timestamp:
08/12/08 09:18:47 (3 months ago)
Author:
Greg Von Kuster <greg@bx.psu.edu>
branch:
default
Message:

Fix for Extract Genomic DNA when input file metadata missing strand column value.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tools/extract/extract_genomic_dna.py

    r1451 r1470  
    11#!/usr/bin/env python 
    22""" 
    3 usage: extract_genomic_dna.py $input $out_file1 ${input.metadata.chromCol} ${input.metadata.startCol} ${input.metadata.endCol} ${input.metadata.strandCol} $dbkey $out_format GALAXY_DATA_INDEX_DIR 
    4 by Wen-Yu Chung 
     3usage: %prog $input $out_file1 
     4    -1, --cols=N,N,N,N: Columns for start, end, strand in input file 
     5    -d, --dbkey=N: Genome build of input file 
     6    -o, --output_format=N: the data type of the output file 
     7    -g, --GALAXY_DATA_INDEX_DIR=N: the directory containing alignseq.loc and twobit.loc 
    58""" 
    69from galaxy import eggs 
     
    1114import bx.seq.nib 
    1215import bx.seq.twobit 
     16from galaxy.tools.util.galaxyops import * 
    1317 
    1418assert sys.version_info[:2] >= ( 2, 4 ) 
     
    5559         
    5660def __main__(): 
    57     input_filename = sys.argv[1] 
    58     output_filename = sys.argv[2] 
    59     includes_strand_col = False 
     61    options, args = doc_optparse.parse( __doc__ ) 
     62    try: 
     63        chrom_col, start_col, end_col, strand_col = parse_cols_arg( options.cols ) 
     64        dbkey = options.dbkey 
     65        output_format = options.output_format 
     66        GALAXY_DATA_INDEX_DIR = options.GALAXY_DATA_INDEX_DIR 
     67        input_filename, output_filename = args 
     68    except: 
     69        doc_optparse.exception() 
     70 
     71    includes_strand_col = strand_col >= 0 
    6072    strand = None 
    61     # If any of the following exceptions are thrown, we need to improve the metadata validator. 
    62     try: 
    63         chrom_col = int( sys.argv[3] ) - 1 
    64     except: 
    65         stop_err( "Chrom column not properly set, click the pencil icon in your history item to set it." ) 
    66     try: 
    67         start_col = int( sys.argv[4] ) - 1 
    68     except: 
    69         stop_err( "Start column not properly set, click the pencil icon in your history item to set it." ) 
    70     try: 
    71         end_col = int( sys.argv[5] ) - 1 
    72     except: 
    73         stop_err( "End column not properly set, click the pencil icon in your history item to set it." ) 
    74     try: 
    75         strand_col = int( sys.argv[6] ) - 1 
    76         if strand_col >= 0: 
    77             includes_strand_col = True 
    78     except: 
    79         pass 
    80     dbkey = sys.argv[7] 
    81     output_format = sys.argv[8] 
    82     GALAXY_DATA_INDEX_DIR = sys.argv[9] 
    8373    nibs = {} 
    8474    twobits = {} 
  • tools/extract/extract_genomic_dna.xml

    r1451 r1470  
    11<tool id="Extract genomic DNA 1" name="Extract Genomic DNA" version="2.1.0"> 
    22  <description>using coordinates from assembled/unassembled genomes</description> 
    3   <command interpreter="python">extract_genomic_dna.py $input $out_file1 ${input.metadata.chromCol} ${input.metadata.startCol} ${input.metadata.endCol} ${input.metadata.strandCol} $dbkey $out_format ${GALAXY_DATA_INDEX_DIR}</command> 
     3  <command interpreter="python">extract_genomic_dna.py $input $out_file1 -1 ${input.metadata.chromCol},${input.metadata.startCol},${input.metadata.endCol},${input.metadata.strandCol} -d $dbkey -o $out_format -g ${GALAXY_DATA_INDEX_DIR}</command> 
    44  <inputs> 
    55    <param format="interval" name="input" type="data" label="Fetch sequences corresponding to Query">