Changeset 1334:0cf33730c91c
- Timestamp:
- 05/28/08 15:26:42 (7 months ago)
- Files:
-
- test-data/2.lav (added)
- test-data/lav_to_bed_out2.bed (added)
- test-data/scatterplot_in1.tabular (modified) (1 diff)
- tools/filters/BedLike2Text.pl (deleted)
- tools/filters/BedLike2Text.xml (deleted)
- tools/filters/Interval2BedLike.pl (deleted)
- tools/filters/Interval2BedLike.xml (deleted)
- tools/filters/Text2BedLike.pl (deleted)
- tools/filters/Text2BedLike.xml (deleted)
- tools/filters/aggTrack.pl (deleted)
- tools/filters/aggTrack.xml (deleted)
- tools/filters/lav_to_bed.py (modified) (2 diffs)
- tools/filters/lav_to_bed.xml (modified) (5 diffs)
- tools/filters/lav_to_bed_code.py (modified) (1 diff)
- tools/filters/random_lines.py (deleted)
- tools/filters/random_lines.xml (deleted)
- tools/filters/srg2wig.pl (deleted)
- tools/filters/srg2wig.xml (deleted)
- universe_wsgi.ini.sample (modified) (1 diff)
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 q 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 S 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 Q 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 1 1 68 4.1 2 2 71 4.6 3 3 62 3.8 4 4 75 4.4 5 5 58 3.2 6 6 60 3.1 7 7 67 3.8 8 8 68 4.1 9 9 71 4.3 10 10 69 3.7 tools/filters/lav_to_bed.py
r1213 r1334 1 1 #!/usr/bin/env python 2 2 #Reads a LAV file and writes two BED files. 3 4 3 import sys 5 4 from galaxy import eggs … … 10 9 assert sys.version_info[:2] >= ( 2, 4 ) 11 10 11 def stop_err( msg ): 12 sys.stderr.write( msg ) 13 sys.exit() 14 12 15 def main(): 13 14 16 try: 15 17 lav_file = open(sys.argv[1],'r') 16 18 bed_file1 = open(sys.argv[2],'w') 17 19 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 ) ) 22 22 23 lavsRead = bedsWritten = 0 23 lavsRead = 0 24 bedsWritten = 0 24 25 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 ): 26 28 lavsRead += 1 27 28 29 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 ) 30 31 if bedsWritten < 1: 31 if len( species)==0:32 if len( species )==0: 32 33 species[spec]=bed_file1 33 elif len( species)==1:34 elif len( species )==1: 34 35 species[spec]=bed_file2 35 36 else: 36 37 continue #this is a pairwise alignment... 37 38 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 ) ) 39 40 bedsWritten += 1 40 41 41 42 42 43 for spec,file in species.items(): tools/filters/lav_to_bed.xml
r1129 r1334 1 1 <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> 5 4 <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"/> 9 6 </inputs> 10 7 <outputs> … … 12 9 <data name="bed_file2" format="bed"/> 13 10 </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> 15 19 16 20 **Syntax** … … 18 22 This tool converts a LAV formated file to the BED format. 19 23 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. 21 25 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. 33 27 34 28 ----- … … 41 35 s { 42 36 "/depot/data2/galaxy/hg16/seq/chr19.nib" 1 63811651 0 1 43 "/depot/data2/galaxy/mm5/seq/chr11.nib -" 1 121648857 0 137 "/depot/data2/galaxy/mm5/seq/chr11.nib" 1 121648857 0 1 44 38 } 45 39 h { … … 70 64 chr11 70568379 70568443 mm5_0 0 + 71 65 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"/> 74 68 </tool> tools/filters/lav_to_bed_code.py
r1012 r1334 8 8 filename_to_build[fields[1]]=fields[2].strip() 9 9 else: 10 new_stdout = new_stdout + line10 new_stdout = "%s%s" % ( new_stdout, line ) 11 11 for name,data in out_data.items(): 12 12 try: 13 data.info = new_stdout +"\n"+ stderr13 data.info = "%s\n%s" % ( new_stdout, stderr ) 14 14 data.dbkey = filename_to_build[data.file_name] 15 data.name = data.name + " ("+data.dbkey+")"15 data.name = "%s (%s)" % ( data.name, data.dbkey ) 16 16 data.flush() 17 17 except: universe_wsgi.ini.sample
r1329 r1334 185 185 jpg = galaxy.datatypes.images:Image,image/jpeg 186 186 laj = galaxy.datatypes.images:Laj 187 lav = galaxy.datatypes.sequence:Lav 187 lav = galaxy.datatypes.sequence:Lav,display_in_upload 188 188 maf = galaxy.datatypes.sequence:Maf,display_in_upload 189 189 pdf = galaxy.datatypes.images:Image,application/pdf