Back to index

python-biopython  1.60
Public Member Functions
test_SeqIO_QualityIO.TestReadWrite Class Reference

List of all members.

Public Member Functions

def test_fastq_2000
def test_fastq_1000
def test_fastq_dna
def test_fastq_rna

Detailed Description

Test can read and write back files.

Definition at line 384 of file test_SeqIO_QualityIO.py.


Member Function Documentation

Read and write back simple example with mixed case 1000bp read

Definition at line 394 of file test_SeqIO_QualityIO.py.

00394 
00395     def test_fastq_1000(self):
00396         """Read and write back simple example with mixed case 1000bp read"""
00397         data = "@%s\n%s\n+\n%s\n" \
00398                % ("id descr goes here", "ACGTNncgta"*100, "abcd!!efgh"*100)
00399         handle = StringIO("")
00400         self.assertEqual(1, SeqIO.write(SeqIO.parse(StringIO(data), "fastq"), handle, "fastq"))
00401         self.assertEqual(data, handle.getvalue())

Read and write back simple example with upper case 2000bp read

Definition at line 386 of file test_SeqIO_QualityIO.py.

00386 
00387     def test_fastq_2000(self):
00388         """Read and write back simple example with upper case 2000bp read"""
00389         data = "@%s\n%s\n+\n%s\n" \
00390                % ("id descr goes here", "ACGT"*500, "!@a~"*500)
00391         handle = StringIO("")
00392         self.assertEqual(1, SeqIO.write(SeqIO.parse(StringIO(data), "fastq"), handle, "fastq"))
00393         self.assertEqual(data, handle.getvalue())

Read and write back simple example with ambiguous DNA

Definition at line 402 of file test_SeqIO_QualityIO.py.

00402 
00403     def test_fastq_dna(self):
00404         """Read and write back simple example with ambiguous DNA"""
00405         #First in upper case...        
00406         data = "@%s\n%s\n+\n%s\n" \
00407                % ("id descr goes here",
00408                   ambiguous_dna_letters.upper(),
00409                   "".join(chr(33+q) for q in range(len(ambiguous_dna_letters))))
00410         handle = StringIO("")
00411         self.assertEqual(1, SeqIO.write(SeqIO.parse(StringIO(data), "fastq"), handle, "fastq"))
00412         self.assertEqual(data, handle.getvalue())
00413         #Now in lower case...
00414         data = "@%s\n%s\n+\n%s\n" \
00415                % ("id descr goes here",
00416                   ambiguous_dna_letters.lower(),
00417                   "".join(chr(33+q) for q in range(len(ambiguous_dna_letters))))
00418         handle = StringIO("")
00419         self.assertEqual(1, SeqIO.write(SeqIO.parse(StringIO(data), "fastq"), handle, "fastq"))
00420         self.assertEqual(data, handle.getvalue())

Read and write back simple example with ambiguous RNA

Definition at line 421 of file test_SeqIO_QualityIO.py.

00421 
00422     def test_fastq_rna(self):
00423         """Read and write back simple example with ambiguous RNA"""
00424         #First in upper case...        
00425         data = "@%s\n%s\n+\n%s\n" \
00426                % ("id descr goes here",
00427                   ambiguous_rna_letters.upper(),
00428                   "".join(chr(33+q) for q in range(len(ambiguous_rna_letters))))
00429         handle = StringIO("")
00430         self.assertEqual(1, SeqIO.write(SeqIO.parse(StringIO(data), "fastq"), handle, "fastq"))
00431         self.assertEqual(data, handle.getvalue())
00432         #Now in lower case...
00433         data = "@%s\n%s\n+\n%s\n" \
00434                % ("id descr goes here",
00435                   ambiguous_rna_letters.lower(),
00436                   "".join(chr(33+q) for q in range(len(ambiguous_rna_letters))))
00437         handle = StringIO("")
00438         self.assertEqual(1, SeqIO.write(SeqIO.parse(StringIO(data), "fastq"), handle, "fastq"))
00439         self.assertEqual(data, handle.getvalue())
00440 


The documentation for this class was generated from the following file: