Exemplo n.º 1
0
    def test_seqs_string():
        ''' Here we test it we can initialice a seq with quality
         and if we can print it. Seq is going to be a normal string'''

        #sequence1 = Seq('aaavvttt')

        # First we initialice the quality in the init
        seq1 = SeqWithQuality(name='seq1', seq=Seq('aaavvttt'),
                               qual=[2, 4 , 1, 4, 5, 6, 12, 34])
        assert seq1

        # Here we add the quality after the initialization
        seq2 = SeqWithQuality(name='seq2', seq=Seq('aaavvttt'))
        seq2.qual = [2, 4 , 1, 4, 5, 6, 12, 34]
        assert seq2

        # Let's check the sliceability of the seq
        for num in range(len(seq1)):
            seq3 = seq1[num]
            assert seq3
Exemplo n.º 2
0
    def test_seq_seq():
        ''' We are going to check the same tests but with a BioPython seq
        class object inside seq'''
        sequence1 = Seq('aaaccttt')

        # First we initialice the quality in the init
        seq1 = SeqWithQuality(name='seq1', seq=sequence1, \
                               qual=[2, 4 , 1, 4, 5, 6, 12, 34])
        assert seq1

        # Here we add the quality after the initialization
        seq2 = SeqWithQuality(name='seq2', seq=sequence1)
        seq2.qual = [2, 4 , 1, 4, 5, 6, 12, 34]
        assert seq2

        # We check if the seq can be complemented
        seq3 = seq2.complement()
        assert seq3.seq == 'tttggaaa'

        # Let's check the sliceability of the seq
        assert seq2[0:2].seq == 'aa'
        assert seq2[0:2].qual == [2, 4]