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
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
def sniff(self, filename, image=None): """Determine if the file is in bmp format.""" return check_image_type( filename, ['BMP'], image )
def sniff(self, filename, image=None): """Determine if the file is in rast format""" return check_image_type( filename, ['RAST'], image )
def sniff( self, filename ): """Determine if the file is in this format""" return check_image_type( filename, self.image_formats )