Changeset 1334:0cf33730c91c

Show
Ignore:
Timestamp:
05/28/08 15:26:42 (7 months ago)
Author:
Greg Von Kuster <greg@bx.psu.edu>
branch:
default
convert_revision:
svn:9bcadc22-80f8-0310-8a53-c8f022958886/galaxy/trunk@2695
Message:

Cleaned up lav_to_bed a bit, added functional test. Removed old, unused tools from the ~/tools/filter directory.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • test-data/scatterplot_in1.tabular

    r1154 r1334  
    1 %PDF-1.1 
    2 %âãÏÓ\r 
    3 1 0 obj 
    4 << 
    5 /CreationDate (D:20080404100027) 
    6 /ModDate (D:20080404100027) 
    7 /Title (R Graphics Output) 
    8 /Producer (R 2.6.2) 
    9 /Creator (R) 
    10 >> 
    11 endobj 
    12 2 0 obj 
    13 << 
    14 /Type /Catalog 
    15 /Pages 3 0 R 
    16 >> 
    17 endobj 
    18 5 0 obj 
    19 << 
    20 /Type /Font 
    21 /Subtype /Type1 
    22 /Name /F1 
    23 /BaseFont /ZapfDingbats 
    24 >> 
    25 endobj 
    26 6 0 obj 
    27 << 
    28 /Type /Page 
    29 /Parent 3 0 R 
    30 /Contents 7 0 R 
    31 /Resources 4 0 R 
    32 >> 
    33 endobj 
    34 7 0 obj 
    35 << 
    36 /Length 8 0 R 
    37 >> 
    38 stream 
    39 
    40 Q q 59.04 73.44 486.72 443.52 re W n 
    41 0.000 0.000 1.000 rg 
    42 0.000 0.000 1.000 RG 
    43 0.75 w 
    44 [] 0 d 
    45 1 J 
    46 1 j 
    47 10.00 M 
    48 BT 
    49 /F1 1 Tf 2 Tr 7.48 0 0 7.48 339.20 361.05 Tm (l) Tj 0 Tr 
    50 /F1 1 Tf 2 Tr 7.48 0 0 7.48 418.73 497.94 Tm (l) Tj 0 Tr 
    51 /F1 1 Tf 2 Tr 7.48 0 0 7.48 180.14 278.92 Tm (l) Tj 0 Tr 
    52 /F1 1 Tf 2 Tr 7.48 0 0 7.48 524.77 443.18 Tm (l) Tj 0 Tr 
    53 /F1 1 Tf 2 Tr 7.48 0 0 7.48 74.10 114.65 Tm (l) Tj 0 Tr 
    54 /F1 1 Tf 2 Tr 7.48 0 0 7.48 127.12 87.27 Tm (l) Tj 0 Tr 
    55 /F1 1 Tf 2 Tr 7.48 0 0 7.48 312.69 278.92 Tm (l) Tj 0 Tr 
    56 /F1 1 Tf 2 Tr 7.48 0 0 7.48 339.20 361.05 Tm (l) Tj 0 Tr 
    57 /F1 1 Tf 2 Tr 7.48 0 0 7.48 418.73 415.80 Tm (l) Tj 0 Tr 
    58 /F1 1 Tf 2 Tr 7.48 0 0 7.48 365.71 251.54 Tm (l) Tj 0 Tr 
    59 ET 
    60 Q q 
    61 0.000 0.000 0.000 RG 
    62 0.75 w 
    63 [] 0 d 
    64 1 J 
    65 1 j 
    66 10.00 M 
    67 130.09 73.44 m 527.73 73.44 l S 
    68 130.09 73.44 m 130.09 66.24 l S 
    69 262.64 73.44 m 262.64 66.24 l S 
    70 395.18 73.44 m 395.18 66.24 l S 
    71 527.73 73.44 m 527.73 66.24 l S 
    72 BT 
    73 0.000 0.000 0.000 rg 
    74 /F2 1 Tf 12.00 0.00 -0.00 12.00 123.41 47.52 Tm (60) Tj 
    75 /F2 1 Tf 12.00 0.00 -0.00 12.00 255.96 47.52 Tm (65) Tj 
    76 /F2 1 Tf 12.00 0.00 -0.00 12.00 388.51 47.52 Tm (70) Tj 
    77 /F2 1 Tf 12.00 0.00 -0.00 12.00 521.06 47.52 Tm (75) Tj 
    78 ET 
    79 59.04 199.38 m 59.04 473.16 l S 
    80 59.04 199.38 m 51.84 199.38 l S 
    81 59.04 336.27 m 51.84 336.27 l S 
    82 59.04 473.16 m 51.84 473.16 l S 
    83 BT 
    84 /F2 1 Tf 0.00 12.00 -12.00 0.00 41.76 191.04 Tm (3.5) Tj 
    85 /F2 1 Tf 0.00 12.00 -12.00 0.00 41.76 327.93 Tm (4.0) Tj 
    86 /F2 1 Tf 0.00 12.00 -12.00 0.00 41.76 464.82 Tm (4.5) Tj 
    87 ET 
    88 59.04 73.44 m 
    89 545.76 73.44 l 
    90 545.76 516.96 l 
    91 59.04 516.96 l 
    92 59.04 73.44 l 
    93 
    94 Q q 
    95 BT 
    96 0.000 0.000 0.000 rg 
    97 /F3 1 Tf 14.00 0.00 -0.00 14.00 265.84 541.45 Tm (Scatterplot) Tj 
    98 /F2 1 Tf 12.00 0.00 -0.00 12.00 295.06 18.72 Tm (V1) Tj 
    99 /F2 1 Tf 0.00 12.00 -12.00 0.00 12.96 287.86 Tm (V2) Tj 
    100 ET 
    101 
    102 endstream 
    103 endobj 
    104 8 0 obj 
    105 1743 
    106 endobj 
    107 3 0 obj 
    108 << 
    109 /Type /Pages 
    110 /Kids [ 
    111 6 0 R 
    112 
    113 /Count 1 
    114 /MediaBox [0 0 576 576] 
    115 >> 
    116 endobj 
    117 4 0 obj 
    118 << 
    119 /ProcSet [/PDF /Text] 
    120 /Font << /F1 5 0 R /F2 10 0 R /F3 11 0 R >> 
    121 /ExtGState << >> 
    122 >> 
    123 endobj 
    124 9 0 obj 
    125 << 
    126 /Type /Encoding 
    127 /BaseEncoding /WinAnsiEncoding 
    128 /Differences [ 45/minus 96/quoteleft 
    129 144/dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent 
    130 /dieresis /.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron /space] 
    131 >> 
    132 endobj 
    133 10 0 obj << 
    134 /Type /Font 
    135 /Subtype /Type1 
    136 /Name /F2 
    137 /BaseFont /Helvetica 
    138 /Encoding 9 0 R 
    139 >> endobj 
    140 11 0 obj << 
    141 /Type /Font 
    142 /Subtype /Type1 
    143 /Name /F3 
    144 /BaseFont /Helvetica-Bold 
    145 /Encoding 9 0 R 
    146 >> endobj 
    147 xref 
    148 0 12 
    149 0000000000 65535 f  
    150 0000000021 00000 n  
    151 0000000163 00000 n  
    152 0000002191 00000 n  
    153 0000002274 00000 n  
    154 0000000212 00000 n  
    155 0000000295 00000 n  
    156 0000000375 00000 n  
    157 0000002171 00000 n  
    158 0000002378 00000 n  
    159 0000002635 00000 n  
    160 0000002732 00000 n  
    161 trailer 
    162 << 
    163 /Size 12 
    164 /Info 1 0 R 
    165 /Root 2 0 R 
    166 >> 
    167 startxref 
    168 2834 
    169 %%EOF 
     11       68      4.1 
     22       71      4.6 
     33       62      3.8 
     44       75      4.4 
     55       58      3.2 
     66       60      3.1 
     77       67      3.8 
     88       68      4.1 
     99       71      4.3 
     1010      69      3.7 
  • tools/filters/lav_to_bed.py

    r1213 r1334  
    11#!/usr/bin/env python 
    22#Reads a LAV file and writes two BED files. 
    3  
    43import sys 
    54from galaxy import eggs 
     
    109assert sys.version_info[:2] >= ( 2, 4 ) 
    1110 
     11def stop_err( msg ): 
     12    sys.stderr.write( msg ) 
     13    sys.exit() 
     14 
    1215def main(): 
    13  
    1416    try: 
    1517        lav_file = open(sys.argv[1],'r') 
    1618        bed_file1 = open(sys.argv[2],'w') 
    1719        bed_file2 = open(sys.argv[3],'w') 
    18     except: 
    19         print >>sys.stderr,"Error with provided arguments" 
    20         print >>sys.stderr,"Usage: python %s input_lav output_bed1 output_bed2" % sys.argv[0] 
    21         sys.exit(0) 
     20    except Exception, e: 
     21        stop_err( str( e ) ) 
    2222         
    23     lavsRead = bedsWritten = 0 
     23    lavsRead = 0 
     24    bedsWritten = 0 
    2425    species = {} 
    25     for lavBlock in bx.align.lav.Reader(lav_file): 
     26    # TODO: this is really bad since everything is read into memory.  Can we eliminate this tool? 
     27    for lavBlock in bx.align.lav.Reader( lav_file ): 
    2628        lavsRead += 1 
    27          
    2829        for c in lavBlock.components: 
    29             spec,chrom = bx.align.lav.src_split( c.src ) 
     30            spec, chrom = bx.align.lav.src_split( c.src ) 
    3031            if bedsWritten < 1: 
    31                 if len(species)==0: 
     32                if len( species )==0: 
    3233                    species[spec]=bed_file1 
    33                 elif len(species)==1: 
     34                elif len( species )==1: 
    3435                    species[spec]=bed_file2 
    3536                else: 
    3637                    continue #this is a pairwise alignment... 
    3738            if spec in species: 
    38                 species[spec].write("%s\t%i\t%i\t%s\t%i\t%s\n" % (chrom,c.start,c.end,spec+"_"+str(bedsWritten),0,c.strand)
     39                species[spec].write( "%s\t%i\t%i\t%s_%s\t%i\t%s\n" % ( chrom, c.start, c.end, spec, str( bedsWritten ), 0, c.strand )
    3940        bedsWritten += 1 
    40  
     41         
    4142 
    4243    for spec,file in species.items(): 
  • tools/filters/lav_to_bed.xml

    r1129 r1334  
    11<tool id="lav_to_bed1" name="LAV to BED"> 
    2 <description>Converts a LAV formated file to BED format</description> 
    3 <command interpreter="python">lav_to_bed.py $lav_file $bed_file1 $bed_file2</command> 
    4  
     2  <description>Converts a LAV formated file to BED format</description> 
     3  <command interpreter="python">lav_to_bed.py $lav_file $bed_file1 $bed_file2</command> 
    54  <inputs> 
    6       <page> 
    7       <param name="lav_file" type="data" format="lav" label="LAV File" optional="False"/> 
    8       </page> 
     5    <param name="lav_file" type="data" format="lav" label="LAV File" optional="False"/> 
    96  </inputs> 
    107  <outputs> 
     
    129    <data name="bed_file2" format="bed"/> 
    1310  </outputs> 
    14     <help> 
     11  <tests> 
     12    <!-- NOTE: this tool generates 2 output files, but our functional tests currently only handle the last one generated --> 
     13    <test> 
     14      <param name="lav_file" value="2.lav" ftype="lav" /> 
     15      <output name="bed_file2" file="lav_to_bed_out2.bed" /> 
     16    </test> 
     17  </tests> 
     18  <help> 
    1519 
    1620**Syntax** 
     
    1822This tool converts a LAV formated file to the BED format. 
    1923 
    20 - **LAV format** LAV is an alignment format developed by Webb Miller's group. It is the primary output format for BLASTZ. 
     24- **LAV format** LAV is an alignment format developed by Webb Miller's group at Penn State University. It is the primary output format for BLASTZ. 
    2125 
    22 - **BED format** Browser Extensible Data format was designed at UCSC for displaying data tracks in the Genome Browser. It has three required fields and twelve additional optional ones:: 
    23  
    24     The first three BED fields (required) are: 
    25     1. chrom - The name of the chromosome (e.g. chr1, chrY_random). 
    26     2. chromStart - The starting position in the chromosome. (The first base in a chromosome is numbered 0.) 
    27     3. chromEnd - The ending position in the chromosome, plus 1 (i.e., a half-open interval). 
    28  
    29     Additional (optional) fields are: 
    30     4. name - The name of the BED line. 
    31     5. score - A score between 0 and 1000. 
    32     6. strand - Defines the strand - either '+' or '-'. 
     26- **BED format** Browser Extensible Data format was designed at UCSC for displaying data tracks in the Genome Browser. 
    3327 
    3428----- 
     
    4135    s { 
    4236      &quot;/depot/data2/galaxy/hg16/seq/chr19.nib&quot; 1 63811651 0 1 
    43       &quot;/depot/data2/galaxy/mm5/seq/chr11.nib-&quot; 1 121648857 0 1 
     37      &quot;/depot/data2/galaxy/mm5/seq/chr11.nib&quot; 1 121648857 0 1 
    4438    } 
    4539    h { 
     
    7064    chr11       70568379        70568443        mm5_0   0       + 
    7165    chr11       70573975        70574054        mm5_1   0       + 
    72     </help> 
    73     <code file="lav_to_bed_code.py"/> 
     66  </help> 
     67  <code file="lav_to_bed_code.py"/> 
    7468</tool> 
  • tools/filters/lav_to_bed_code.py

    r1012 r1334  
    88            filename_to_build[fields[1]]=fields[2].strip() 
    99        else: 
    10             new_stdout = new_stdout + line 
     10            new_stdout = "%s%s" % ( new_stdout, line ) 
    1111    for name,data in out_data.items(): 
    1212        try: 
    13             data.info = new_stdout +"\n"+ stderr 
     13            data.info = "%s\n%s" % ( new_stdout, stderr ) 
    1414            data.dbkey = filename_to_build[data.file_name] 
    15             data.name = data.name + " ("+data.dbkey+")" 
     15            data.name = "%s (%s)" % ( data.name, data.dbkey ) 
    1616            data.flush() 
    1717        except: 
  • universe_wsgi.ini.sample

    r1329 r1334  
    185185jpg = galaxy.datatypes.images:Image,image/jpeg 
    186186laj = galaxy.datatypes.images:Laj 
    187 lav = galaxy.datatypes.sequence:Lav 
     187lav = galaxy.datatypes.sequence:Lav,display_in_upload 
    188188maf = galaxy.datatypes.sequence:Maf,display_in_upload 
    189189pdf = galaxy.datatypes.images:Image,application/pdf