def read_fasta_sequences(filename): """ Function to parse text from the given FASTA file into a screed database """ import openscreed # Will raise an exception if the file doesn't exist iterfunc = openscreed.open(filename) # Create the screed db create_db(filename, fasta.FieldTypes, iterfunc) return ScreedDB(filename)
def read_hava_sequences(filename): """ Function to parse text from the given HAVA file into a screed database """ # Will raise an exception if the file doesn't exist theFile = open(filename, "rb") # Setup the iterator function iterfunc = hava.hava_iter(theFile) # Create the screed db create_db(filename, hava.FieldTypes, iterfunc) theFile.close() return ScreedDB(filename)
def read_fastq_sequences(filename): """ Function to parse text from the given FASTQ file into a screed database """ # Will raise an exception if the file doesn't exist theFile = open(filename, 'rb') # Setup the iterator function iterfunc = fastq.fastq_iter(theFile) # Create the screed db create_db(filename, fastq.FieldTypes, iterfunc) theFile.close() return ScreedDB(filename)