Back to index

python-biopython  1.60
Public Member Functions
test_Emboss.SeqRetSeqIOTests Class Reference

List of all members.

Public Member Functions

def tearDown
def check_SeqIO_to_EMBOSS
def check_EMBOSS_to_SeqIO
def check_SeqIO_with_EMBOSS
def test_abi
def test_genbank
def test_genbank2
def test_embl
def test_ig
def test_pir
def test_clustalw

Detailed Description

Check EMBOSS seqret against Bio.SeqIO for converting files.

Definition at line 223 of file test_Emboss.py.


Member Function Documentation

def test_Emboss.SeqRetSeqIOTests.check_EMBOSS_to_SeqIO (   self,
  filename,
  old_format,
  skip_formats = [] 
)
Can Bio.SeqIO read seqret's conversion of the file?

Definition at line 247 of file test_Emboss.py.

00247 
00248                               skip_formats=[]):
00249         """Can Bio.SeqIO read seqret's conversion of the file?"""
00250         #TODO: Why can't we read EMBOSS's swiss output?
00251         self.assertTrue(os.path.isfile(filename))
00252         old_records = list(SeqIO.parse(filename, old_format))
00253         for new_format in ["genbank","fasta","pir","embl", "ig"]:
00254             if new_format in skip_formats:
00255                 continue
00256             handle = emboss_convert(filename, old_format, new_format)
00257             new_records = list(SeqIO.parse(handle, new_format))
00258             handle.close()
00259             try:
00260                 self.assertTrue(compare_records(old_records, new_records))
00261             except ValueError, err:
00262                 raise ValueError("Disagree on %s file %s in %s format: %s" \
00263                                  % (old_format, filename, new_format, err))

Here is the call graph for this function:

Here is the caller graph for this function:

def test_Emboss.SeqRetSeqIOTests.check_SeqIO_to_EMBOSS (   self,
  in_filename,
  in_format,
  skip_formats = [],
  alphabet = None 
)
Can Bio.SeqIO write files seqret can read back?

Definition at line 230 of file test_Emboss.py.

00230 
00231                               alphabet=None):
00232         """Can Bio.SeqIO write files seqret can read back?"""
00233         if alphabet:
00234             records = list(SeqIO.parse(in_filename, in_format, alphabet))
00235         else:
00236             records = list(SeqIO.parse(in_filename, in_format))
00237         for temp_format in ["genbank","embl","fasta"]:
00238             if temp_format in skip_formats:
00239                 continue
00240             new_records = list(emboss_piped_SeqIO_convert(records, temp_format, "fasta"))
00241             try:
00242                 self.assertTrue(compare_records(records, new_records))
00243             except ValueError, err:
00244                 raise ValueError("Disagree on file %s %s in %s format: %s" \
00245                                  % (in_format, in_filename, temp_format, err))
            

Here is the call graph for this function:

Here is the caller graph for this function:

def test_Emboss.SeqRetSeqIOTests.check_SeqIO_with_EMBOSS (   self,
  filename,
  old_format,
  skip_formats = [],
  alphabet = None 
)

Definition at line 265 of file test_Emboss.py.

00265 
00266                                 alphabet=None):
00267         #Check EMBOSS can read Bio.SeqIO output...
00268         self.check_SeqIO_to_EMBOSS(filename, old_format, skip_formats,
00269                                    alphabet)
00270         #Check Bio.SeqIO can read EMBOSS seqret output...
00271         self.check_EMBOSS_to_SeqIO(filename, old_format, skip_formats)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 226 of file test_Emboss.py.

00226 
00227     def tearDown(self):
00228         clean_up()

Here is the call graph for this function:

SeqIO agrees with EMBOSS' Abi to FASTQ conversion.

Definition at line 272 of file test_Emboss.py.

00272 
00273     def test_abi(self):
00274         """SeqIO agrees with EMBOSS' Abi to FASTQ conversion."""
00275         #This lets use check the id, sequence, and quality scores
00276         for filename in ["Abi/3730.ab1", "Abi/empty.ab1"]:
00277              old = SeqIO.read(filename, "abi")
00278              handle = emboss_convert(filename, "abi", "fastq-sanger")
00279              new = SeqIO.read(handle, "fastq-sanger")
00280              handle.close()
00281              if emboss_version == (6,4,0) and new.id == "EMBOSS_001":
00282                  #Avoid bug in EMBOSS 6.4.0 (patch forthcoming)
00283                  pass
00284              else:
00285                  self.assertEqual(old.id, new.id)
00286              self.assertEqual(str(old.seq), str(new.seq))
00287              if emboss_version < (6,3,0) and new.letter_annotations["phred_quality"] == [1]*len(old):
00288                  #Apparent bug in EMBOSS 6.2.0.1 on Windows           
00289                  pass
00290              else:
00291                  self.assertEqual(old.letter_annotations, new.letter_annotations)

Here is the call graph for this function:

SeqIO & EMBOSS reading each other's conversions of a Clustalw file.

Definition at line 325 of file test_Emboss.py.

00325 
00326     def test_clustalw(self):
00327         """SeqIO & EMBOSS reading each other's conversions of a Clustalw file."""
00328         self.check_SeqIO_with_EMBOSS("Clustalw/hedgehog.aln", "clustal",
00329                                    skip_formats=["embl","genbank"])
00330         self.check_SeqIO_with_EMBOSS("Clustalw/opuntia.aln", "clustal",
00331                                    skip_formats=["embl","genbank"])

Here is the call graph for this function:

SeqIO & EMBOSS reading each other's conversions of an EMBL file.

Definition at line 300 of file test_Emboss.py.

00300 
00301     def test_embl(self):
00302         """SeqIO & EMBOSS reading each other's conversions of an EMBL file."""
00303         self.check_SeqIO_with_EMBOSS("EMBL/U87107.embl", "embl")

Here is the call graph for this function:

SeqIO & EMBOSS reading each other's conversions of a GenBank file.

Definition at line 292 of file test_Emboss.py.

00292 
00293     def test_genbank(self):
00294         """SeqIO & EMBOSS reading each other's conversions of a GenBank file."""
00295         self.check_SeqIO_with_EMBOSS("GenBank/cor6_6.gb", "genbank")

Here is the call graph for this function:

SeqIO & EMBOSS reading each other's conversions of another GenBank file.

Definition at line 296 of file test_Emboss.py.

00296 
00297     def test_genbank2(self):
00298         """SeqIO & EMBOSS reading each other's conversions of another GenBank file."""
00299         self.check_SeqIO_with_EMBOSS("GenBank/NC_000932.gb", "genbank")

Here is the call graph for this function:

SeqIO & EMBOSS reading each other's conversions of an ig file.

Definition at line 304 of file test_Emboss.py.

00304 
00305     def test_ig(self):
00306         """SeqIO & EMBOSS reading each other's conversions of an ig file."""
00307         #NOTE - EMBOSS considers "genbank" to be for nucleotides only,
00308         #and will turn "X" into "N" for GenBank output.
00309         self.check_SeqIO_to_EMBOSS("IntelliGenetics/VIF_mase-pro.txt", "ig",
00310                                    alphabet=generic_protein,
00311                                    skip_formats=["genbank","embl"])
00312         #TODO - What does a % in an ig sequence mean?
00313         #e.g. "IntelliGenetics/vpu_nucaligned.txt"
00314         #and  "IntelliGenetics/TAT_mase_nuc.txt"
00315         #EMBOSS seems to ignore them.

Here is the call graph for this function:

SeqIO & EMBOSS reading each other's conversions of a PIR file.

Definition at line 316 of file test_Emboss.py.

00316 
00317     def test_pir(self):
00318         """SeqIO & EMBOSS reading each other's conversions of a PIR file."""
00319         #Skip genbank here, EMBOSS mangles the LOCUS line:
00320         self.check_SeqIO_with_EMBOSS("NBRF/clustalw.pir", "pir",
00321                                skip_formats=["genbank"])
00322         #Skip EMBL here, EMBOSS mangles the ID line
00323         #Skip GenBank, EMBOSS 6.0.1 on Windows won't output proteins as GenBank
00324         self.check_SeqIO_with_EMBOSS("NBRF/DMB_prot.pir", "pir",
                               skip_formats=["embl","genbank"])

Here is the call graph for this function:


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