import unittest
import sys

from pygr import seqdb
import genebuilder


class TestGetDnaSeq(unittest.TestCase):
    def setUp(self):

        genomeFile = '/Users/Likit/projects/mdv/data/chick.fa'
        self.genome = seqdb.SequenceFileDB(genomeFile, verbose=False)

        exons = [('chr1', 51035309, 51035430), ('chr1', 51062489, 51062516)]

        self.isoform = genebuilder.Isoform('chr1', '1', '0', exons, self.genome)

    def testGetDnaSeq(self):
        seq = '''GGTGACTCCACCACCTCCCTGGGCAGCCCATTCCAGTGCCTGACCATCCCTTTCAGAGAAACTTTTCCTAACACCCAACCTGAATCTTCCCTGCCGCGAAACTGAGGCCATCCCCTCTAGTCCTACTGCTAGTTATGTGGGAAAAGAG'''

        dnaSeq = self.isoform._getDnaSeq(self.genome)
        self.assertEqual(seq, str(dnaSeq.reverse_complement()))


    def testFindORF(self):

        genebuilder.findORF(self.isoform)

        mrnaSeq = 'GGUGACUCCACCACCUCCCUGGGCAGCCCAUUCCAGUGCCUGACCAUCCCUUUCAGAGAAACUUUUCCUAACACCCAACCUGAAUCUUCCCUGCCGCGAAACUGAGGCCAUCCCCUCUAGUCCUACUGCUAGUUAUGUGGGAAAAGAG'

        self.assertLess(self.isoform.frame, 0)
        self.assertEqual('MGSPFQCLTIPFRETFPNTQPESSLPRN', str(self.isoform.proteinSeq))
        self.assertEqual(mrnaSeq, str(self.isoform.mrnaSeq))

de0983da643e243dd325853214bb8d3482fb9339
<mask token>


class TestGetDnaSeq(unittest.TestCase):

    def setUp(self):
        genomeFile = '/Users/Likit/projects/mdv/data/chick.fa'
        self.genome = seqdb.SequenceFileDB(genomeFile, verbose=False)
        exons = [('chr1', 51035309, 51035430), ('chr1', 51062489, 51062516)]
        self.isoform = genebuilder.Isoform('chr1', '1', '0', exons, self.genome
            )
    <mask token>
    <mask token>

<mask token>


class TestGetDnaSeq(unittest.TestCase):

    def setUp(self):
        genomeFile = '/Users/Likit/projects/mdv/data/chick.fa'
        self.genome = seqdb.SequenceFileDB(genomeFile, verbose=False)
        exons = [('chr1', 51035309, 51035430), ('chr1', 51062489, 51062516)]
        self.isoform = genebuilder.Isoform('chr1', '1', '0', exons, self.genome
            )
    <mask token>

    def testFindORF(self):
        genebuilder.findORF(self.isoform)
        mrnaSeq = (
            'GGUGACUCCACCACCUCCCUGGGCAGCCCAUUCCAGUGCCUGACCAUCCCUUUCAGAGAAACUUUUCCUAACACCCAACCUGAAUCUUCCCUGCCGCGAAACUGAGGCCAUCCCCUCUAGUCCUACUGCUAGUUAUGUGGGAAAAGAG'
            )
        self.assertLess(self.isoform.frame, 0)
        self.assertEqual('MGSPFQCLTIPFRETFPNTQPESSLPRN', str(self.isoform.
            proteinSeq))
        self.assertEqual(mrnaSeq, str(self.isoform.mrnaSeq))

<mask token>


class TestGetDnaSeq(unittest.TestCase):

    def setUp(self):
        genomeFile = '/Users/Likit/projects/mdv/data/chick.fa'
        self.genome = seqdb.SequenceFileDB(genomeFile, verbose=False)
        exons = [('chr1', 51035309, 51035430), ('chr1', 51062489, 51062516)]
        self.isoform = genebuilder.Isoform('chr1', '1', '0', exons, self.genome
            )

    def testGetDnaSeq(self):
        seq = (
            'GGTGACTCCACCACCTCCCTGGGCAGCCCATTCCAGTGCCTGACCATCCCTTTCAGAGAAACTTTTCCTAACACCCAACCTGAATCTTCCCTGCCGCGAAACTGAGGCCATCCCCTCTAGTCCTACTGCTAGTTATGTGGGAAAAGAG'
            )
        dnaSeq = self.isoform._getDnaSeq(self.genome)
        self.assertEqual(seq, str(dnaSeq.reverse_complement()))

    def testFindORF(self):
        genebuilder.findORF(self.isoform)
        mrnaSeq = (
            'GGUGACUCCACCACCUCCCUGGGCAGCCCAUUCCAGUGCCUGACCAUCCCUUUCAGAGAAACUUUUCCUAACACCCAACCUGAAUCUUCCCUGCCGCGAAACUGAGGCCAUCCCCUCUAGUCCUACUGCUAGUUAUGUGGGAAAAGAG'
            )
        self.assertLess(self.isoform.frame, 0)
        self.assertEqual('MGSPFQCLTIPFRETFPNTQPESSLPRN', str(self.isoform.
            proteinSeq))
        self.assertEqual(mrnaSeq, str(self.isoform.mrnaSeq))

import unittest
import sys
from pygr import seqdb
import genebuilder


class TestGetDnaSeq(unittest.TestCase):

    def setUp(self):
        genomeFile = '/Users/Likit/projects/mdv/data/chick.fa'
        self.genome = seqdb.SequenceFileDB(genomeFile, verbose=False)
        exons = [('chr1', 51035309, 51035430), ('chr1', 51062489, 51062516)]
        self.isoform = genebuilder.Isoform('chr1', '1', '0', exons, self.genome
            )

    def testGetDnaSeq(self):
        seq = (
            'GGTGACTCCACCACCTCCCTGGGCAGCCCATTCCAGTGCCTGACCATCCCTTTCAGAGAAACTTTTCCTAACACCCAACCTGAATCTTCCCTGCCGCGAAACTGAGGCCATCCCCTCTAGTCCTACTGCTAGTTATGTGGGAAAAGAG'
            )
        dnaSeq = self.isoform._getDnaSeq(self.genome)
        self.assertEqual(seq, str(dnaSeq.reverse_complement()))

    def testFindORF(self):
        genebuilder.findORF(self.isoform)
        mrnaSeq = (
            'GGUGACUCCACCACCUCCCUGGGCAGCCCAUUCCAGUGCCUGACCAUCCCUUUCAGAGAAACUUUUCCUAACACCCAACCUGAAUCUUCCCUGCCGCGAAACUGAGGCCAUCCCCUCUAGUCCUACUGCUAGUUAUGUGGGAAAAGAG'
            )
        self.assertLess(self.isoform.frame, 0)
        self.assertEqual('MGSPFQCLTIPFRETFPNTQPESSLPRN', str(self.isoform.
            proteinSeq))
        self.assertEqual(mrnaSeq, str(self.isoform.mrnaSeq))

import unittest
import sys

from pygr import seqdb
import genebuilder


class TestGetDnaSeq(unittest.TestCase):
    def setUp(self):

        genomeFile = '/Users/Likit/projects/mdv/data/chick.fa'
        self.genome = seqdb.SequenceFileDB(genomeFile, verbose=False)

        exons = [('chr1', 51035309, 51035430), ('chr1', 51062489, 51062516)]

        self.isoform = genebuilder.Isoform('chr1', '1', '0', exons, self.genome)

    def testGetDnaSeq(self):
        seq = '''GGTGACTCCACCACCTCCCTGGGCAGCCCATTCCAGTGCCTGACCATCCCTTTCAGAGAAACTTTTCCTAACACCCAACCTGAATCTTCCCTGCCGCGAAACTGAGGCCATCCCCTCTAGTCCTACTGCTAGTTATGTGGGAAAAGAG'''

        dnaSeq = self.isoform._getDnaSeq(self.genome)
        self.assertEqual(seq, str(dnaSeq.reverse_complement()))


    def testFindORF(self):

        genebuilder.findORF(self.isoform)

        mrnaSeq = 'GGUGACUCCACCACCUCCCUGGGCAGCCCAUUCCAGUGCCUGACCAUCCCUUUCAGAGAAACUUUUCCUAACACCCAACCUGAAUCUUCCCUGCCGCGAAACUGAGGCCAUCCCCUCUAGUCCUACUGCUAGUUAUGUGGGAAAAGAG'

        self.assertLess(self.isoform.frame, 0)
        self.assertEqual('MGSPFQCLTIPFRETFPNTQPESSLPRN', str(self.isoform.proteinSeq))
        self.assertEqual(mrnaSeq, str(self.isoform.mrnaSeq))
