comparison sra.py @ 16:93a60318b9ca draft

updates to SRA datatype
author Matt Shirley <mdshw5@gmail.com>
date Mon, 17 Jun 2013 20:30:16 -0400
parents b77840618b8f
children a1255154fa3f
comparison
equal deleted inserted replaced
15:078b8e168b0c 16:93a60318b9ca
1 """ 1 """
2 Sra class 2 Sra class
3 """ 3 """
4 import logging
5 import binascii
6 from galaxy.datatypes.data import *
7 from galaxy.datatypes.sniff import *
8 from galaxy.datatypes.binary import *
9 from galaxy.datatypes.metadata import *
4 10
5 import binascii 11 log = logging.getLogger(__name__)
6 from galaxy.datatypes.binary import Binary
7 from galaxy.datatypes.data import Data
8 from galaxy.datatypes.metadata import MetadataElement
9 from galaxy.datatypes.sniff import *
10 12
11 class Sra( Binary ): 13 class SRA( Binary ):
12 """ Sequence Read Archive (SRA) """ 14 """ Sequence Read Archive (SRA) """
13 file_ext = 'sra' 15 file_ext = 'sra'
14 16
15 def __init__( self, **kwd ): 17 def __init__( self, **kwd ):
16 Binary.__init__( self, **kwd ) 18 Binary.__init__( self, **kwd )
35 dataset.blurb = 'file purged from disk' 37 dataset.blurb = 'file purged from disk'
36 def display_peek(self, dataset): 38 def display_peek(self, dataset):
37 try: 39 try:
38 return dataset.peek 40 return dataset.peek
39 except: 41 except:
40 return 'Binary sra file (%s)' % ( data.nice_size(dataset.get_size())) 42 return 'Binary SRA file (%s)' % ( data.nice_size(dataset.get_size()))
43
44 if hasattr(Binary, 'register_sniffable_binary_format'):
45 Binary.register_sniffable_binary_format('SRA', 'SRA', SRA)