コード例 #1
0
def test18():
    """Test to make sure it creates a file that is readable"""
    L = [dnaSeq.dnaSeq(randomSeq(random.randint(300,600))) for i in range(5)]
    for d in L:
        d.info = ">" + "".join([random.choice("ABCDEFH ") for i in range(30)])
    dnaSeq.writeFA(L, "test1.fa")
    L2 = dnaSeq.readFA("test1.fa")
    return all([o1.info.lstrip('>').strip()==o2.info.lstrip('>').strip() and str(o1)==str(o2) for o1,o2 in zip(L,L2)])
コード例 #2
0
def test17():
    L = [dnaSeq_sol.dnaSeq(randomSeq(random.randint(300,600))) for i in range(5)]
    for d in L:
        d.info = ">" + "".join([random.choice("ABCDEFH ") for i in range(30)])
    dnaSeq_sol.writeFA(L, "test.fa")
    
    L2 = dnaSeq.readFA("test.fa")
    return all([o1.info.lstrip('>').strip()==o2.info.lstrip('>').strip() and str(o1)==str(o2) for o1,o2 in zip(L,L2)])
コード例 #3
0
def test18():
    """Test to make sure it creates a file that is readable"""
    L = [dnaSeq.dnaSeq(randomSeq(random.randint(300, 600))) for i in range(5)]
    for d in L:
        d.info = ">" + "".join([random.choice("ABCDEFH ") for i in range(30)])
    dnaSeq.writeFA(L, "test1.fa")
    L2 = dnaSeq.readFA("test1.fa")
    return all([
        o1.info.lstrip('>').strip() == o2.info.lstrip('>').strip()
        and str(o1) == str(o2) for o1, o2 in zip(L, L2)
    ])
コード例 #4
0
def test17():
    L = [
        dnaSeq_sol.dnaSeq(randomSeq(random.randint(300, 600)))
        for i in range(5)
    ]
    for d in L:
        d.info = ">" + "".join([random.choice("ABCDEFH ") for i in range(30)])
    dnaSeq_sol.writeFA(L, "test.fa")

    L2 = dnaSeq.readFA("test.fa")
    return all([
        o1.info.lstrip('>').strip() == o2.info.lstrip('>').strip()
        and str(o1) == str(o2) for o1, o2 in zip(L, L2)
    ])
コード例 #5
0
 def readTest(self):
     fileseqs = dnaSeq.readFA("tester.fa")
     self.assertTrue(all([str(fileseqs[i]) == str(self.seqs[i]) and self.seqs[i].info in fileseqs[i].info for i in range(len(self.seqs))]), "Info and sequences read from tester.fa did not match expected results")