Beispiel #1
0
 def sniff(self, filename):
     """Determine if the file is in RNA dot plot format."""
     if check_image_type(filename, ['EPS']):
         seq = False
         coor = False
         pairs = False
         with open(filename) as handle:
             for line in handle:
                 line = line.strip()
                 if line:
                     if line.startswith('/sequence'):
                         seq = True
                     elif line.startswith('/coor'):
                         coor = True
                     elif line.startswith('/pairs'):
                         pairs = True
                 if seq and coor and pairs:
                     return True
     return False
Beispiel #2
0
 def sniff(self, filename):
     """Determine if the file is in RNA dot plot format."""
     if check_image_type( filename, ['EPS'] ):
         seq = False
         coor = False
         pairs = False
         with open( filename ) as handle:
             for line in handle:
                 line = line.strip()
                 if line:
                     if line.startswith('/sequence'):
                         seq = True
                     elif line.startswith('/coor'):
                         coor = True
                     elif line.startswith('/pairs'):
                         pairs = True
                 if seq and coor and pairs:
                     return True
     return False
Beispiel #3
0
 def sniff(self, filename, image=None):
     """Determine if the file is in bmp format."""
     return check_image_type( filename, ['BMP'], image )
Beispiel #4
0
 def sniff(self, filename, image=None):
     """Determine if the file is in rast format"""
     return check_image_type( filename, ['RAST'], image )
Beispiel #5
0
 def sniff( self, filename ):
     """Determine if the file is in this format"""
     return check_image_type( filename, self.image_formats )