1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
# !/usr/bin/env python
##############################################################################
## DendroPy Phylogenetic Computing Library.
##
## Copyright 2010-2015 Jeet Sukumaran and Mark T. Holder.
## All rights reserved.
##
## See "LICENSE.rst" for terms and conditions of usage.
##
## If you use this work or any portion thereof in published work,
## please cite it as:
##
## Sukumaran, J. and M. T. Holder. 2010. DendroPy: a Python library
## for phylogenetic computing. Bioinformatics 26: 1569-1571.
##
##############################################################################
"""
Tests for general FASTA reading.
"""
import unittest
import dendropy
from dendropy.test.support import dendropytest
from dendropy.test.support import pathmap
from dendropy.test.support import standard_file_test_chars
class FastaDnaReaderTestCase(
standard_file_test_chars.DnaTestChecker,
dendropytest.ExtendedTestCase):
@classmethod
def setUpClass(cls):
cls.build()
def test_basic_fasta(self):
src_path = pathmap.char_source_path("standard-test-chars-dna.fasta")
self.verify_get_from(
matrix_type=dendropy.DnaCharacterMatrix,
src_filepath=src_path,
schema="fasta",
factory_kwargs={},
check_taxon_annotations=False,
check_matrix_annotations=False,
check_sequence_annotations=False,
check_column_annotations=False,
check_cell_annotations=False)
class FastaRnaReaderTestCase(
standard_file_test_chars.RnaTestChecker,
dendropytest.ExtendedTestCase):
@classmethod
def setUpClass(cls):
cls.build()
def test_basic_fasta(self):
src_path = pathmap.char_source_path("standard-test-chars-rna.fasta")
self.verify_get_from(
matrix_type=dendropy.RnaCharacterMatrix,
src_filepath=src_path,
schema="fasta",
factory_kwargs={},
check_taxon_annotations=False,
check_matrix_annotations=False,
check_sequence_annotations=False,
check_column_annotations=False,
check_cell_annotations=False)
class FastaProteinReaderTestCase(
standard_file_test_chars.ProteinTestChecker,
dendropytest.ExtendedTestCase):
@classmethod
def setUpClass(cls):
cls.build()
def test_basic_fasta(self):
src_path = pathmap.char_source_path("standard-test-chars-protein.fasta")
self.verify_get_from(
matrix_type=dendropy.ProteinCharacterMatrix,
src_filepath=src_path,
schema="fasta",
factory_kwargs={},
check_taxon_annotations=False,
check_matrix_annotations=False,
check_sequence_annotations=False,
check_column_annotations=False,
check_cell_annotations=False)
if __name__ == "__main__":
unittest.main()
|