Beispiel #1
0
def test_utils():
    test_DNA = DNA('ATAGCGATACGAT')
    test_RNA = RNA('AUGCGAUAGCGAU')
    test_peptide = Peptide('msvkkkpvqg')
    test_str = 'msvkkkpvgq'

    assert_equal(analysis.utils.sequence_type(test_DNA), 'dna')
    assert_equal(analysis.utils.sequence_type(test_RNA), 'rna')
    assert_equal(analysis.utils.sequence_type(test_peptide), 'peptide')
    assert_raises(Exception, analysis.utils.sequence_type, test_str)
def test_translation():
    test_rna = RNA('AUGAUGGGCAGUGUCGAAUUAAAUCUGCGUGAGACAGAAUU' +
                   'GUGUUUGGGACUACCAGGCGGUGAUACAGUUGCACCAGUAA' +
                   'CAGGAAACAAAAGAGGAUUCUCUGAAACAGUAGAUUUGAAA' +
                   'CUUAAUUUGAACAAUGAGCCAGCCAACAAGGAAGGUUCCAC' +
                   'CACUCAUGACGUCGUCACAUUUGAUAGUAAAGAAAAGAGUG' +
                   'CGUGUCCAAAAGAUCCAGCUAAGCCACCUGCCAAGGCUCAA' +
                   'GUCGUCGGAUGGCCACCUGUGAGAUCUUAUAGAAAGAACGU' +
                   'AAUGGUUUCUUGUCAGAAGUCCAGUGGUGGUCCUGAAGCAG' + 'CGGCUugaaaa')
    reference_peptide = Peptide('MMGSVELNLRETELCLGLPGGDTVAPVTGNK' +
                                'RGFSETVDLKLNLNNEPANKEGSTTHDVVTF' +
                                'DSKEKSACPKDPAKPPAKAQVVGWPPVRSYR' +
                                'KNVMVSCQKSSGGPEAAA')
    # Basic transcription should work
    translation_output = reaction.translate(test_rna)
    assert_equal(translation_output, reference_peptide)

    # Coding peptide should exclude anything after a stop codon
    coding_rna = reaction.coding_sequence(test_rna)
    coding_peptide = reaction.translate(coding_rna)
    assert_equal(coding_peptide, reference_peptide)
Beispiel #3
0
 def test_ne(self):
     assert_true(self.test_peptide != Peptide('mkqp'))
Beispiel #4
0
 def test_eq(self):
     assert_true(self.test_peptide == Peptide('mkgp'))
Beispiel #5
0
 def __init__(self):
     self.test_peptide = Peptide('mkgp')