Back to index

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

List of all members.

Public Member Functions

def test_generated
def check
def test_tricky
def test_sanger_93
def test_sanger_faked
def test_example_fasta
def test_example_fastq
def test_example_qual
def test_solexa_faked
def test_solexa_example
def test_illumina_faked
def test_greek_sff
def test_paired_sff
def test_E3MFGYR02
def test_E3MFGYR02_no_manifest
def test_E3MFGYR02_index_at_start
def test_E3MFGYR02_index_in_middle
def test_E3MFGYR02_alt_index_at_start
def test_E3MFGYR02_alt_index_in_middle
def test_E3MFGYR02_alt_index_at_end
def test_E3MFGYR02_trimmed

Detailed Description

Test can write and read back files.

Definition at line 441 of file test_SeqIO_QualityIO.py.


Member Function Documentation

def test_SeqIO_QualityIO.TestWriteRead.check (   self,
  filename,
  format,
  out_formats 
)

Definition at line 475 of file test_SeqIO_QualityIO.py.

00475 
00476     def check(self, filename, format, out_formats):
00477         for f in out_formats:
00478             write_read(filename, format, f)

Here is the call graph for this function:

Here is the caller graph for this function:

Write and read back E3MFGYR02_random_10_reads.sff

Definition at line 549 of file test_SeqIO_QualityIO.py.

00549 
00550     def test_E3MFGYR02(self) :
00551         """Write and read back E3MFGYR02_random_10_reads.sff"""
00552         self.check(os.path.join("Roche", "E3MFGYR02_random_10_reads.sff"), "sff",
00553                    ["fastq", "fastq-sanger", "fastq-illumina", "fastq-solexa",
00554                     "fasta", "qual", "phd", "sff"])

Here is the call graph for this function:

Write and read back E3MFGYR02_alt_index_at_end.sff

Definition at line 585 of file test_SeqIO_QualityIO.py.

00585 
00586     def test_E3MFGYR02_alt_index_at_end(self) :
00587         """Write and read back E3MFGYR02_alt_index_at_end.sff"""
00588         self.check(os.path.join("Roche", "E3MFGYR02_alt_index_at_end.sff"), "sff",
00589                    ["fastq", "fastq-sanger", "fastq-illumina", "fastq-solexa",
00590                     "fasta", "qual", "phd", "sff"])

Here is the call graph for this function:

Write and read back E3MFGYR02_alt_index_at_start.sff

Definition at line 573 of file test_SeqIO_QualityIO.py.

00573 
00574     def test_E3MFGYR02_alt_index_at_start(self) :
00575         """Write and read back E3MFGYR02_alt_index_at_start.sff"""
00576         self.check(os.path.join("Roche", "E3MFGYR02_alt_index_at_start.sff"), "sff",
00577                    ["fastq", "fastq-sanger", "fastq-illumina", "fastq-solexa",
00578                     "fasta", "qual", "phd", "sff"])

Here is the call graph for this function:

Write and read back E3MFGYR02_alt_index_in_middle.sff

Definition at line 579 of file test_SeqIO_QualityIO.py.

00579 
00580     def test_E3MFGYR02_alt_index_in_middle(self) :
00581         """Write and read back E3MFGYR02_alt_index_in_middle.sff"""
00582         self.check(os.path.join("Roche", "E3MFGYR02_alt_index_in_middle.sff"), "sff",
00583                    ["fastq", "fastq-sanger", "fastq-illumina", "fastq-solexa",
00584                     "fasta", "qual", "phd", "sff"])

Here is the call graph for this function:

Write and read back E3MFGYR02_index_at_start.sff

Definition at line 561 of file test_SeqIO_QualityIO.py.

00561 
00562     def test_E3MFGYR02_index_at_start(self) :
00563         """Write and read back E3MFGYR02_index_at_start.sff"""
00564         self.check(os.path.join("Roche", "E3MFGYR02_index_at_start.sff"), "sff",
00565                    ["fastq", "fastq-sanger", "fastq-illumina", "fastq-solexa",
00566                     "fasta", "qual", "phd", "sff"])

Here is the call graph for this function:

Write and read back E3MFGYR02_index_in_middle.sff

Definition at line 567 of file test_SeqIO_QualityIO.py.

00567 
00568     def test_E3MFGYR02_index_in_middle(self) :
00569         """Write and read back E3MFGYR02_index_in_middle.sff"""
00570         self.check(os.path.join("Roche", "E3MFGYR02_index_in_middle.sff"), "sff",
00571                    ["fastq", "fastq-sanger", "fastq-illumina", "fastq-solexa",
00572                     "fasta", "qual", "phd", "sff"])

Here is the call graph for this function:

Write and read back E3MFGYR02_no_manifest.sff

Definition at line 555 of file test_SeqIO_QualityIO.py.

00555 
00556     def test_E3MFGYR02_no_manifest(self) :
00557         """Write and read back E3MFGYR02_no_manifest.sff"""
00558         self.check(os.path.join("Roche", "E3MFGYR02_no_manifest.sff"), "sff",
00559                    ["fastq", "fastq-sanger", "fastq-illumina", "fastq-solexa",
00560                     "fasta", "qual", "phd", "sff"])

Here is the call graph for this function:

Write and read back E3MFGYR02_random_10_reads.sff (trimmed)

Definition at line 591 of file test_SeqIO_QualityIO.py.

00591 
00592     def test_E3MFGYR02_trimmed(self) :
00593         """Write and read back E3MFGYR02_random_10_reads.sff (trimmed)"""
00594         self.check(os.path.join("Roche", "E3MFGYR02_random_10_reads.sff"), "sff-trim",
00595                    ["fastq", "fastq-sanger", "fastq-illumina", "fastq-solexa",
00596                     "fasta", "qual", "phd"]) #not sff as output
00597 

Here is the call graph for this function:

Write and read back example.fasta

Definition at line 502 of file test_SeqIO_QualityIO.py.

00502 
00503     def test_example_fasta(self):
00504         """Write and read back example.fasta"""
00505         write_read(os.path.join("Quality", "example.fasta"), "fasta", "fasta")
00506         #TODO - tests to check can't write FASTQ or QUAL...

Here is the call graph for this function:

Write and read back example.fastq

Definition at line 507 of file test_SeqIO_QualityIO.py.

00507 
00508     def test_example_fastq(self):
00509         """Write and read back example.fastq"""
00510         self.check(os.path.join("Quality", "example.fastq"), "fastq",
00511                    ["fastq", "fastq-sanger", "fastq-illumina", "fastq-solexa",
00512                     "fasta", "qual", "phd"])

Here is the call graph for this function:

Write and read back example.qual

Definition at line 513 of file test_SeqIO_QualityIO.py.

00513 
00514     def test_example_qual(self):
00515         """Write and read back example.qual"""
00516         self.check(os.path.join("Quality", "example.qual"), "qual",
00517                    ["fastq", "fastq-sanger", "fastq-illumina", "fastq-solexa",
00518                     "fasta", "qual", "phd"])

Here is the call graph for this function:

Write and read back odd SeqRecord objects

Definition at line 443 of file test_SeqIO_QualityIO.py.

00443 
00444     def test_generated(self):
00445         """Write and read back odd SeqRecord objects"""
00446         record1 = SeqRecord(Seq("ACGT"*500, generic_dna),  id="Test", description="Long "*500,
00447                            letter_annotations={"phred_quality":[40,30,20,10]*500})
00448         record2 = SeqRecord(MutableSeq("NGGC"*1000),  id="Mut", description="very "*1000+"long",
00449                            letter_annotations={"phred_quality":[0,5,5,10]*1000})
00450         record3 = SeqRecord(UnknownSeq(2000,character="N"),  id="Unk", description="l"+("o"*1000)+"ng",
00451                            letter_annotations={"phred_quality":[0,1]*1000})
00452         record4 = SeqRecord(Seq("ACGT"*500),  id="no_descr", description="", name="",
00453                            letter_annotations={"phred_quality":[40,50,60,62]*500})
00454         record5 = SeqRecord(Seq("",generic_dna),  id="empty_p", description="(could have been trimmed lots)",
00455                            letter_annotations={"phred_quality":[]})
00456         record6 = SeqRecord(Seq(""),  id="empty_s", description="(could have been trimmed lots)",
00457                            letter_annotations={"solexa_quality":[]})
00458         record7 = SeqRecord(Seq("ACNN"*500),  id="Test_Sol", description="Long "*500,
00459                            letter_annotations={"solexa_quality":[40,30,0,-5]*500})
00460         record8 = SeqRecord(Seq("ACGT"),  id="HighQual", description="With very large qualities that even Sanger FASTQ can't hold!",
00461                            letter_annotations={"solexa_quality":[0,10,100,1000]})
00462         #TODO - Record with no identifier?
00463         records = [record1, record2, record3, record4, record5, record6, record7, record8]
00464         #TODO - Have a Biopython defined "DataLossWarning?"
00465         warnings.simplefilter('ignore', BiopythonWarning)
00466         #TODO - Include phd output?
00467         for format in ["fasta", "fastq", "fastq-solexa", "fastq-illumina", "qual"]:
00468             handle = StringIO()
00469             SeqIO.write(records, handle, format)
00470             handle.seek(0)
00471             compare_records(records,
00472                             list(SeqIO.parse(handle, format)),
00473                             truncation_expected(format))
00474         warnings.filters.pop()
            

Here is the call graph for this function:

Write and read back greek.sff

Definition at line 537 of file test_SeqIO_QualityIO.py.

00537 
00538     def test_greek_sff(self) :
00539         """Write and read back greek.sff"""
00540         self.check(os.path.join("Roche", "greek.sff"), "sff",
00541                    ["fastq", "fastq-sanger", "fastq-illumina", "fastq-solexa",
00542                     "fasta", "qual", "phd", "sff"])

Here is the call graph for this function:

Write and read back illumina_faked.fastq

Definition at line 531 of file test_SeqIO_QualityIO.py.

00531 
00532     def test_illumina_faked(self):
00533         """Write and read back illumina_faked.fastq"""
00534         self.check(os.path.join("Quality", "illumina_faked.fastq"), "fastq-illumina",
00535                    ["fastq", "fastq-sanger", "fastq-illumina", "fastq-solexa",
00536                     "fasta", "qual", "phd"])

Here is the call graph for this function:

Write and read back paired.sff

Definition at line 543 of file test_SeqIO_QualityIO.py.

00543 
00544     def test_paired_sff(self) :
00545         """Write and read back paired.sff"""
00546         self.check(os.path.join("Roche", "paired.sff"), "sff",
00547                    ["fastq", "fastq-sanger", "fastq-illumina", "fastq-solexa",
00548                     "fasta", "qual", "phd", "sff"])

Here is the call graph for this function:

Write and read back sanger_93.fastq

Definition at line 485 of file test_SeqIO_QualityIO.py.

00485 
00486     def test_sanger_93(self):
00487         """Write and read back sanger_93.fastq"""
00488         self.check(os.path.join("Quality", "sanger_93.fastq"), "fastq",
00489                    ["fastq", "fastq-sanger", "fasta", "qual", "phd"])
00490         #TODO - Have a Biopython defined "DataLossWarning?"
00491         #TODO - On Python 2.6+ we can check this warning is really triggered
00492         warnings.simplefilter('ignore', BiopythonWarning)
00493         self.check(os.path.join("Quality", "sanger_93.fastq"), "fastq",
00494                    ["fastq-solexa","fastq-illumina"])
00495         warnings.filters.pop()

Here is the call graph for this function:

Write and read back sanger_faked.fastq

Definition at line 496 of file test_SeqIO_QualityIO.py.

00496 
00497     def test_sanger_faked(self):
00498         """Write and read back sanger_faked.fastq"""
00499         self.check(os.path.join("Quality", "sanger_faked.fastq"), "fastq",
00500                    ["fastq", "fastq-sanger", "fastq-illumina", "fastq-solexa",
00501                     "fasta", "qual", "phd"])

Here is the call graph for this function:

Write and read back solexa_example.fastq

Definition at line 525 of file test_SeqIO_QualityIO.py.

00525 
00526     def test_solexa_example(self):
00527         """Write and read back solexa_example.fastq"""
00528         self.check(os.path.join("Quality", "solexa_example.fastq"), "fastq-solexa",
00529                    ["fastq", "fastq-sanger", "fastq-illumina", "fastq-solexa",
00530                     "fasta", "qual", "phd"])

Here is the call graph for this function:

Write and read back solexa_faked.fastq

Definition at line 519 of file test_SeqIO_QualityIO.py.

00519 
00520     def test_solexa_faked(self):
00521         """Write and read back solexa_faked.fastq"""
00522         self.check(os.path.join("Quality", "solexa_faked.fastq"), "fastq-solexa",
00523                    ["fastq", "fastq-sanger", "fastq-illumina", "fastq-solexa",
00524                     "fasta", "qual", "phd"])

Here is the call graph for this function:

Write and read back tricky.fastq

Definition at line 479 of file test_SeqIO_QualityIO.py.

00479 
00480     def test_tricky(self):
00481         """Write and read back tricky.fastq"""
00482         self.check(os.path.join("Quality", "tricky.fastq"), "fastq",
00483                    ["fastq", "fastq-sanger", "fastq-illumina", "fastq-solexa",
00484                     "fasta", "qual", "phd"])

Here is the call graph for this function:


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