Esempio n. 1
0
    def test(self):
        alignment = [
            "AAAagaattcTAGATATACCAAACCAGAGAAAACAAATACATAATCGGAGAAATACAGAT"
            "AGAGAGCGAGAGAGATCGACGGCGAAGCTCTTTACCCGGAAACCATTGAAATCGGACGGT"
            "TTAGTGAAAATGGAGGATCAAGTagAtTTTGGGTTCCGTCCGAACGACGAGGAGCTCGTT"
            "GGTCACTATCTCCGTAACAAAATCGAAGGAAACACTAGCCGCGACGTTGAAGTAGCCATC"
            "AGCGAGGTCAACATCTGTAGCTACGATCCTTGGAACTTGCGCTGTAAGTTCCGAATTTTC",
            "AAAagaTttcTAGATATACCAAACCAGAGAAAACAAATACATAATCGGAGAAATACAGAT"
            "AGAGAGCGAGAGAGATCGACGGCGAAGCTCTTTACCCGGAAACCATTGAAATCGGACGGT"
            "TTAGTGAAAATGGAGGATCAAGTagctTTTGGGTTCCGTCCGAACGACGAGGAGCTCGTT"
            "GGTCACTATCTCCGTAACAAAATCGAAGGAAACACTAGCCGCGACGTTGAAGTAGCCATC"
            "AGCGAGGTCAACATCTGTAGCTACGATCCTTGGAACTTGCGCTGTAAGTTCCGAATTTTC",
            "AAAagaTttcTAGATATACCAAACCAGAGAAAACAAATACATAATCGGAGAAATACAGAT"
            "AGAGAGCGAGAGAGATCGACGGCGAAGCTCTTTACCCGGAAACCATTGAAATCGGACGGT"
            "TTAGTGAAAATGGAGGATCAAGTagctTTTGGGTTCCGTCCGAACGACGAGGAGCTCGTT"
            "GGTCACTATCTCCGTAACAAAATCGAAGGAAACACTAGCCGCGACGTTGAAGTAGCCATC"
            "AGCGAGGTCAACATCTGTAGCTACGATCCTTGGAACTTGCGCTGTAAGTTCCGAATTTTC",
        ]
        self.assertEqual(len(alignment), 3)
        enzymes = [EcoRI, AluI]
        align = createAlignment(alignment, Alphabet.generic_dna)
        map = CAPS.CAPSMap(align, enzymes)

        self.assertEqual(len(map.dcuts), 2)
        self.assertEqual(map.dcuts[0].enzyme, EcoRI)
        self.assertEqual(map.dcuts[0].start, 5)
        self.assertEqual(map.dcuts[0].cuts_in, [0])
        self.assertEqual(map.dcuts[0].blocked_in, [1, 2])
        self.assertEqual(map.dcuts[1].enzyme, AluI)
        self.assertEqual(map.dcuts[1].start, 144)
        self.assertEqual(map.dcuts[1].cuts_in, [1, 2])
        self.assertEqual(map.dcuts[1].blocked_in, [0])
Esempio n. 2
0
 def testNoCAPS(self):
     alignment = ["aaaaaaaaaaaaaaaaaaaa",
                  "aaaaaaaaaaaaaaaaaaaa",
                 ]
     enzymes = []
     align = createAlignment(alignment, Alphabet.generic_nucleotide)
     map = CAPS.CAPSMap(align, enzymes)
     self.assertEqual(map.dcuts, [])
Esempio n. 3
0
    def test_trivial(self):
        enzymes = [EcoRI]
        alignment = ["gaattc", "gaactc"]
        align = createAlignment(alignment, Alphabet.generic_dna)
        map = CAPS.CAPSMap(align, enzymes)

        self.assertEqual(len(map.dcuts), 1)
        self.assertEqual(map.dcuts[0].enzyme, EcoRI)
        self.assertEqual(map.dcuts[0].start, 1)
        self.assertEqual(map.dcuts[0].cuts_in, [0])
        self.assertEqual(map.dcuts[0].blocked_in, [1])
Esempio n. 4
0
 def testNoCAPS(self):
     alignment = ["aaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaa"]
     enzymes = []
     align = createAlignment(alignment)
     map = CAPS.CAPSMap(align, enzymes)
     self.assertEqual(map.dcuts, [])