comparison proteomics.py @ 4:09b89b345de2

Update
author Ira Cooke <iracooke@gmail.com>
date Sun, 09 Jun 2013 08:16:08 -0500
parents c10a62c886b8
children df8b867ab71a
comparison
equal deleted inserted replaced
3:463328a6967f 4:09b89b345de2
5 import re 5 import re
6 from galaxy.datatypes.data import * 6 from galaxy.datatypes.data import *
7 from galaxy.datatypes.xml import * 7 from galaxy.datatypes.xml import *
8 from galaxy.datatypes.sniff import * 8 from galaxy.datatypes.sniff import *
9 from galaxy.datatypes.binary import * 9 from galaxy.datatypes.binary import *
10 from galaxy.datatypes.interval import *
10 11
11 log = logging.getLogger(__name__) 12 log = logging.getLogger(__name__)
13
14 class ProtGff( Gff ):
15 """Tab delimited data in Gff format"""
16 file_ext = "prot_gff"
17 def set_peek( self, dataset, is_multi_byte=False ):
18 """Set the peek and blurb text"""
19 if not dataset.dataset.purged:
20 dataset.peek = data.get_file_peek( dataset.file_name, is_multi_byte=is_multi_byte )
21 dataset.blurb = 'Proteogenomics GFF'
22 else:
23 dataset.peek = 'file does not exist'
24 dataset.blurb = 'file purged from disk'
25
26 def sniff( self, filename ):
27 handle = open(filename)
28 xmlns_re = re.compile("^##gff-version")
29 for i in range(3):
30 line = handle.readline()
31 if xmlns_re.match(line.strip()):
32 handle.close()
33 return True
34
35 handle.close()
36 return False
12 37
13 38
14 class Xls( Binary ): 39 class Xls( Binary ):
15 """Class describing a binary excel spreadsheet file""" 40 """Class describing a binary excel spreadsheet file"""
16 file_ext = "xls" 41 file_ext = "xls"