Exemplo n.º 1
0
    def testSeqid(self):

        seqid = 0.50
        label = "FSHB_BOVIN"
        unique = uniqueSequences(FASTA, seqid)
        refined = refineMSA(FASTA, seqid=seqid)
        assert_array_equal(refined._getArray(), FASTA._getArray()[unique])
Exemplo n.º 2
0
    def testSeqid(self):

        seqid = 0.50
        label = 'FSHB_BOVIN'
        unique = uniqueSequences(FASTA, seqid)
        refined = refineMSA(FASTA, seqid=seqid)
        assert_array_equal(refined._getArray(), FASTA._getArray()[unique])
Exemplo n.º 3
0
    def testSeqidLabel(self):

        seqid = 0.50
        label = 'FSHB_BOVIN'
        labeled = refineMSA(FASTA, label=label)
        unique = uniqueSequences(labeled, seqid)
        unique[FASTA.getIndex(label)] = True
        refined = refineMSA(FASTA, label=label, seqid=seqid)
        assert_array_equal(refined._getArray(), labeled._getArray()[unique])
Exemplo n.º 4
0
    def testSeqidLabel(self):

        seqid = 0.50
        label = "FSHB_BOVIN"
        labeled = refineMSA(FASTA, label=label)
        unique = uniqueSequences(labeled, seqid)
        unique[FASTA.getIndex(label)] = True
        refined = refineMSA(FASTA, label=label, seqid=seqid)
        assert_array_equal(refined._getArray(), labeled._getArray()[unique])
Exemplo n.º 5
0
    def testUnique2(self):

        seqid = 0.5
        unique = ones(FASTA_NUMBER, bool)
        for i in range(FASTA_NUMBER):
            if not unique[i]:
                continue
            for j in range(i + 1, FASTA_NUMBER):
                if FASTA_EYE[i, j] >= seqid:
                    unique[j] = False

        assert_array_equal(unique, uniqueSequences(FASTA, seqid))
Exemplo n.º 6
0
    def testUnique2(self):

        seqid = 0.5
        unique = ones(FASTA_NUMBER, bool)
        for i in range(FASTA_NUMBER):
            if not unique[i]:
                continue
            for j in range(i + 1, FASTA_NUMBER):
                if FASTA_EYE[i, j] >= seqid:
                    unique[j] = False

        assert_array_equal(unique, uniqueSequences(FASTA, seqid))
Exemplo n.º 7
0
    def testAll(self):

        rowocc = 0.9
        colocc = 0.9
        seqid = 0.98
        label = "FSHB_BOVIN"
        refined = refineMSA(FASTA, label=label, seqid=seqid, rowocc=rowocc, colocc=colocc)

        index = FASTA.getIndex(label)
        which = FASTA_ALPHA[index].nonzero()[0]
        expected = FASTA._getArray().take(which, 1)

        expected = expected[uniqueSequences(expected, seqid)]

        expected = expected[calcMSAOccupancy(expected, "row") >= rowocc]

        which = (calcMSAOccupancy(expected) >= colocc).nonzero()[0]
        expected = expected.take(which, 1)

        assert_array_equal(refined._getArray(), expected)
Exemplo n.º 8
0
    def testAll(self):

        rowocc = 0.9
        colocc = 0.9
        seqid = 0.98
        label = 'FSHB_BOVIN'
        refined = refineMSA(FASTA, label=label, seqid=seqid,
                            rowocc=rowocc, colocc=colocc)

        index = FASTA.getIndex(label)
        which = FASTA_ALPHA[index].nonzero()[0]
        expected = FASTA._getArray().take(which, 1)

        expected = expected[uniqueSequences(expected, seqid)]

        expected = expected[calcMSAOccupancy(expected, 'row') >= rowocc]

        which = (calcMSAOccupancy(expected) >= colocc).nonzero()[0]
        expected = expected.take(which, 1)

        assert_array_equal(refined._getArray(), expected)