Back to index

python-biopython  1.60
Public Member Functions | Static Public Attributes
test_SeqIO_SeqXML.TestDetailedRead Class Reference

List of all members.

Public Member Functions

def setUp
def test_special_characters_desc
def test_unicode_characters_desc
def test_full_characters_set_read
def test_duplicated_property
def test_duplicated_dbxref
def test_read_minimal_required
def test_local_species
def test_global_species
def test_local_source_definition
def test_empty_description

Static Public Attributes

dictionary records = {}

Detailed Description

Definition at line 42 of file test_SeqIO_SeqXML.py.


Member Function Documentation

Definition at line 46 of file test_SeqIO_SeqXML.py.

00046 
00047     def setUp(self):
00048         for key in test_files:
00049             self.records[key] = list(SeqIO.parse(test_files[key][0],"seqxml"))

Read multiple cross references to a single source

Definition at line 70 of file test_SeqIO_SeqXML.py.

00070 
00071     def test_duplicated_dbxref(self):
00072         """Read multiple cross references to a single source"""
00073         self.assertEqual(self.records["protein"][2].dbxrefs,[u"someDB:G001",u"someDB:G002"])
    
Read property with multiple values

Definition at line 66 of file test_SeqIO_SeqXML.py.

00066 
00067     def test_duplicated_property(self):
00068         """Read property with multiple values"""
00069         self.assertEqual(self.records["protein"][2].annotations["test"],[u"1",u"2",u"3"])
        
Check empty description.

Definition at line 104 of file test_SeqIO_SeqXML.py.

00104 
00105     def test_empty_description(self):
00106         """Check empty description."""
00107         self.assertEqual(self.records["rna"][4].description,SeqRecord(id="",seq=Seq("")).description)
00108 

Read full characters set for each type

Definition at line 60 of file test_SeqIO_SeqXML.py.

00060 
00061     def test_full_characters_set_read(self):
00062         """Read full characters set for each type"""
00063         self.assertEqual(self.records["dna"][1].seq.tostring(),"ACGTMRWSYKVHDBXN.-" )
00064         self.assertEqual(self.records["rna"][1].seq.tostring(),"ACGUMRWSYKVHDBXN.-" )
00065         self.assertEqual(self.records["protein"][1].seq.tostring(),"ABCDEFGHIJKLMNOPQRSTUVWXYZ.-*")
    
Check global species.

Definition at line 92 of file test_SeqIO_SeqXML.py.

00092 
00093     def test_global_species(self):
00094         """Check global species."""
00095         self.assertEqual(self.records["globalSpecies"][0].annotations["organism"],"Mus musculus")
00096         self.assertEqual(self.records["globalSpecies"][0].annotations["ncbi_taxid"],"10090")
00097         
00098         self.assertEqual(self.records["globalSpecies"][1].annotations["organism"],"Homo sapiens")
00099         self.assertEqual(self.records["globalSpecies"][1].annotations["ncbi_taxid"],"9606")

Check local source.

Definition at line 100 of file test_SeqIO_SeqXML.py.

00100 
00101     def test_local_source_definition(self):
00102         """Check local source."""
00103         self.assertEqual(self.records["protein"][4].annotations["source"],u"Uniprot")

Check local species.

Definition at line 84 of file test_SeqIO_SeqXML.py.

00084 
00085     def test_local_species(self):
00086         """Check local species."""
00087         self.assertEqual(self.records["rna"][1].annotations["organism"],"Mus musculus")
00088         self.assertEqual(self.records["rna"][1].annotations["ncbi_taxid"],"10090")
00089         
00090         self.assertEqual(self.records["rna"][0].annotations["organism"],"Gallus gallus")
00091         self.assertEqual(self.records["rna"][0].annotations["ncbi_taxid"],"9031")
        
Check minimal record.

Definition at line 74 of file test_SeqIO_SeqXML.py.

00074 
00075     def test_read_minimal_required(self):
00076         """Check minimal record."""
00077         minimalRecord = SeqRecord(id="test",seq=Seq("abc"))
00078         minimalRecord.annotations["source"] = u"Ensembl"
00079         
00080         self.assertEqual(self.records["rna"][3].name,minimalRecord.name)
00081         self.assertEqual(self.records["dna"][3].annotations,minimalRecord.annotations)
00082         self.assertEqual(self.records["rna"][3].dbxrefs,minimalRecord.dbxrefs)
00083         self.assertEqual(self.records["protein"][3].description,minimalRecord.description)
        
Read special XML characters in description.

Definition at line 50 of file test_SeqIO_SeqXML.py.

00050 
00051     def test_special_characters_desc(self):
00052         """Read special XML characters in description."""
00053         self.assertEqual(self.records["dna"][2].description, u'some special characters in the description\n<tag> "quoted string"')

Test special unicode characters in the description.

Definition at line 56 of file test_SeqIO_SeqXML.py.

00056 
00057         def test_unicode_characters_desc(self):
00058             """Test special unicode characters in the description."""
00059             self.assertEqual(self.records["rna"][2].description, u"\u00E5\u00C5\u00FC\u00F6\u00D6\u00DF\u00F8\u00E4\u00A2\u00A3$\u20AC\u9999\u80A0")
        

Member Data Documentation

Definition at line 44 of file test_SeqIO_SeqXML.py.


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