Changeset 1470:78e84936b7a3
- 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
| r1451 |
r1470 |
|
| 1 | 1 | #!/usr/bin/env python |
|---|
| 2 | 2 | """ |
|---|
| 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 |
|---|
| | 3 | usage: %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 |
|---|
| 5 | 8 | """ |
|---|
| 6 | 9 | from galaxy import eggs |
|---|
| … | … | |
| 11 | 14 | import bx.seq.nib |
|---|
| 12 | 15 | import bx.seq.twobit |
|---|
| | 16 | from galaxy.tools.util.galaxyops import * |
|---|
| 13 | 17 | |
|---|
| 14 | 18 | assert sys.version_info[:2] >= ( 2, 4 ) |
|---|
| … | … | |
| 55 | 59 | |
|---|
| 56 | 60 | def __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 |
|---|
| 60 | 72 | 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] |
|---|
| 83 | 73 | nibs = {} |
|---|
| 84 | 74 | twobits = {} |
|---|
| r1451 |
r1470 |
|
| 1 | 1 | <tool id="Extract genomic DNA 1" name="Extract Genomic DNA" version="2.1.0"> |
|---|
| 2 | 2 | <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> |
|---|
| 4 | 4 | <inputs> |
|---|
| 5 | 5 | <param format="interval" name="input" type="data" label="Fetch sequences corresponding to Query"> |
|---|