Permalink
Browse files

updated database generation code to use screed.open

  • Loading branch information...
1 parent 7da765c commit 6b84d882360d0e73b038ce0046da25f7a7437858 @ctb committed Jun 17, 2012
Showing with 6 additions and 10 deletions.
  1. +6 −10 screed/seqparse.py
View
@@ -18,31 +18,27 @@ def read_fastq_sequences(filename):
"""
Function to parse text from the given FASTQ file into a screed database
"""
+ import openscreed
+
# Will raise an exception if the file doesn't exist
- theFile = open(filename, 'rb')
-
- # Setup the iterator function
- iterfunc = fastq.fastq_iter(theFile)
+ iterfunc = openscreed.open(filename)
# Create the screed db
create_db(filename, fastq.FieldTypes, iterfunc)
- theFile.close()
return ScreedDB(filename)
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
- theFile = open(filename, "rb")
-
- # Setup the iterator function
- iterfunc = fasta.fasta_iter(theFile)
+ iterfunc = openscreed.open(filename)
# Create the screed db
create_db(filename, fasta.FieldTypes, iterfunc)
- theFile.close()
return ScreedDB(filename)

0 comments on commit 6b84d88

Please sign in to comment.