# ----------------------------------------------------------------------------
# Copyright (c) 2016--, micronota development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# ----------------------------------------------------------------------------

from unittest import TestCase, main

from skbio.util import get_data_path
from skbio.metadata import IntervalMetadata

from micronota.format.rnammer import _generator


class ParseTests(TestCase):
    def test_parse(self):
        imd1 = IntervalMetadata(None)
        imd1.add(bounds=[(0, 2853)],
                 metadata={'source': 'RNAmmer-1.2', 'type': 'rRNA',
                           'product': '23s_rRNA', 'strand': '-', 'score': '3222.8'})
        imd1.add(bounds=[(2924, 3040)],
                 metadata={'source': 'RNAmmer-1.2', 'type': 'rRNA',
                           'product': '5s_rRNA', 'strand': '+', 'score': '80.8'})
        imd2 = IntervalMetadata(None)
        imd2.add(bounds=[(77272, 78834)],
                 metadata={'source': 'RNAmmer-1.2', 'type': 'rRNA',
                           'product': '16s_rRNA', 'strand': '+', 'score': '1984.2'})

        exp = (('NZ_JXDA01000005.1', imd1),
               ('NZ_JXDA01000001.1', imd2))

        fp = get_data_path('rnammer.gff')
        gen = _generator(fp)

        for (exp_id, exp_imd), (obs_id, obs_imd) in zip(exp, gen):
            self.assertEqual(exp_id, obs_id)
            self.assertEqual(exp_imd, obs_imd)


if __name__ == '__main__':
    main()

f6e02c6af59cb15a9b0b26a96232051f22c210d3
<mask token>


class ParseTests(TestCase):
    <mask token>


<mask token>

<mask token>


class ParseTests(TestCase):

    def test_parse(self):
        imd1 = IntervalMetadata(None)
        imd1.add(bounds=[(0, 2853)], metadata={'source': 'RNAmmer-1.2',
            'type': 'rRNA', 'product': '23s_rRNA', 'strand': '-', 'score':
            '3222.8'})
        imd1.add(bounds=[(2924, 3040)], metadata={'source': 'RNAmmer-1.2',
            'type': 'rRNA', 'product': '5s_rRNA', 'strand': '+', 'score':
            '80.8'})
        imd2 = IntervalMetadata(None)
        imd2.add(bounds=[(77272, 78834)], metadata={'source': 'RNAmmer-1.2',
            'type': 'rRNA', 'product': '16s_rRNA', 'strand': '+', 'score':
            '1984.2'})
        exp = ('NZ_JXDA01000005.1', imd1), ('NZ_JXDA01000001.1', imd2)
        fp = get_data_path('rnammer.gff')
        gen = _generator(fp)
        for (exp_id, exp_imd), (obs_id, obs_imd) in zip(exp, gen):
            self.assertEqual(exp_id, obs_id)
            self.assertEqual(exp_imd, obs_imd)


<mask token>

<mask token>


class ParseTests(TestCase):

    def test_parse(self):
        imd1 = IntervalMetadata(None)
        imd1.add(bounds=[(0, 2853)], metadata={'source': 'RNAmmer-1.2',
            'type': 'rRNA', 'product': '23s_rRNA', 'strand': '-', 'score':
            '3222.8'})
        imd1.add(bounds=[(2924, 3040)], metadata={'source': 'RNAmmer-1.2',
            'type': 'rRNA', 'product': '5s_rRNA', 'strand': '+', 'score':
            '80.8'})
        imd2 = IntervalMetadata(None)
        imd2.add(bounds=[(77272, 78834)], metadata={'source': 'RNAmmer-1.2',
            'type': 'rRNA', 'product': '16s_rRNA', 'strand': '+', 'score':
            '1984.2'})
        exp = ('NZ_JXDA01000005.1', imd1), ('NZ_JXDA01000001.1', imd2)
        fp = get_data_path('rnammer.gff')
        gen = _generator(fp)
        for (exp_id, exp_imd), (obs_id, obs_imd) in zip(exp, gen):
            self.assertEqual(exp_id, obs_id)
            self.assertEqual(exp_imd, obs_imd)


if __name__ == '__main__':
    main()

from unittest import TestCase, main
from skbio.util import get_data_path
from skbio.metadata import IntervalMetadata
from micronota.format.rnammer import _generator


class ParseTests(TestCase):

    def test_parse(self):
        imd1 = IntervalMetadata(None)
        imd1.add(bounds=[(0, 2853)], metadata={'source': 'RNAmmer-1.2',
            'type': 'rRNA', 'product': '23s_rRNA', 'strand': '-', 'score':
            '3222.8'})
        imd1.add(bounds=[(2924, 3040)], metadata={'source': 'RNAmmer-1.2',
            'type': 'rRNA', 'product': '5s_rRNA', 'strand': '+', 'score':
            '80.8'})
        imd2 = IntervalMetadata(None)
        imd2.add(bounds=[(77272, 78834)], metadata={'source': 'RNAmmer-1.2',
            'type': 'rRNA', 'product': '16s_rRNA', 'strand': '+', 'score':
            '1984.2'})
        exp = ('NZ_JXDA01000005.1', imd1), ('NZ_JXDA01000001.1', imd2)
        fp = get_data_path('rnammer.gff')
        gen = _generator(fp)
        for (exp_id, exp_imd), (obs_id, obs_imd) in zip(exp, gen):
            self.assertEqual(exp_id, obs_id)
            self.assertEqual(exp_imd, obs_imd)


if __name__ == '__main__':
    main()

# ----------------------------------------------------------------------------
# Copyright (c) 2016--, micronota development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# ----------------------------------------------------------------------------

from unittest import TestCase, main

from skbio.util import get_data_path
from skbio.metadata import IntervalMetadata

from micronota.format.rnammer import _generator


class ParseTests(TestCase):
    def test_parse(self):
        imd1 = IntervalMetadata(None)
        imd1.add(bounds=[(0, 2853)],
                 metadata={'source': 'RNAmmer-1.2', 'type': 'rRNA',
                           'product': '23s_rRNA', 'strand': '-', 'score': '3222.8'})
        imd1.add(bounds=[(2924, 3040)],
                 metadata={'source': 'RNAmmer-1.2', 'type': 'rRNA',
                           'product': '5s_rRNA', 'strand': '+', 'score': '80.8'})
        imd2 = IntervalMetadata(None)
        imd2.add(bounds=[(77272, 78834)],
                 metadata={'source': 'RNAmmer-1.2', 'type': 'rRNA',
                           'product': '16s_rRNA', 'strand': '+', 'score': '1984.2'})

        exp = (('NZ_JXDA01000005.1', imd1),
               ('NZ_JXDA01000001.1', imd2))

        fp = get_data_path('rnammer.gff')
        gen = _generator(fp)

        for (exp_id, exp_imd), (obs_id, obs_imd) in zip(exp, gen):
            self.assertEqual(exp_id, obs_id)
            self.assertEqual(exp_imd, obs_imd)


if __name__ == '__main__':
    main()
