Example #1
0
    def test_positive_on_AFE(self):
        """
            []------[]
            []------[]
        """

        self.graph.add_path(["start", str(self.ex1), str(self.ex2), "end"])
        self.transcripts = [[str(self.ex1), str(self.ex2)]]
        paths = list(find_AFE(self.graph, self.exonsDB, self.transcripts))

        self.assertEqual(len(paths[0]), 0)
Example #2
0
    def test_negative_one_path_one_exon(self):
        """
            []<------[]
        """
        path = ["end", str(self.ex1), str(self.ex2), "start"]
        path.reverse()
        self.graph.add_path(path)
        self.transcripts = [path]
        paths = list(find_AFE(self.graph, self.exonsDB, self.transcripts))

        self.assertEqual(len(paths[0]), 0)
Example #3
0
    def test_positive_no_AFE_with_ALE(self):
        """
            []--------->[]--------->[]
            []--------->[]----->[]
        """

        path1 = ["start", str(self.ex1), str(self.ex5), str(self.ex3), "end"]
        path2 = ["start", str(self.ex1), str(self.ex5), str(self.ex2), "end"]

        self.graph.add_path(path1)
        self.graph.add_path(path2)
        self.transcripts = [path1, path2]
        paths = list(find_AFE(self.graph, self.exonsDB, self.transcripts))

        self.assertEqual(len(paths[0]), 0)
Example #4
0
    def test_positive_two_path_one_exon(self):
        """
            []------->[]
            []---->[]
        """

        path1 = ["start", str(self.ex1), str(self.ex2), "end"]
        path2 = ["start", str(self.ex5), str(self.ex2), "end"]
        self.graph.add_path(path1)
        self.graph.add_path(path2)
        self.transcripts = [path1, path2]
        paths = list(find_AFE(self.graph, self.exonsDB, self.transcripts))

        self.assertEqual(len(paths[0]), 2)
        self.assertItemsEqual(get_num_exons(paths), [2, 2])
Example #5
0
    def test_positive_two_path_two_exon(self):
        """
            []------------>[]---------->[]
              [*]--->[*]-->[]---------->[]
        """
        self.ex6 = Exon("chrX", 7000, 8000, "ex1.1", "+")
        self.exonsDB[str(self.ex6)] = self.ex6
        path1 = ["start", str(self.ex1), str(self.ex3), str(self.ex6), "end"]
        path2 = ["start", str(self.ex5), str(self.ex2), str(self.ex3), str(self.ex6), "end"]
        self.graph.add_path(path1)
        self.graph.add_path(path2)
        self.transcripts = [path1, path2]

        paths = list(find_AFE(self.graph, self.exonsDB, self.transcripts))

        self.assertEqual(len(paths[0]), 2)
        self.assertItemsEqual(get_num_exons(paths), [2, 3])
Example #6
0
    def test_negative_no_AFE_with_ALE(self):
        """
            []<-----[]<----[]<-----[]
               []<---------[]<-----[]
        """

        path1 = ["end", str(self.ex4), str(self.ex1), str(self.ex2), str(self.ex3), "start"]
        path2 = ["end", str(self.ex5), str(self.ex2), str(self.ex3), "start"]

        path1.reverse()
        path2.reverse()

        self.graph.add_path(path1)
        self.graph.add_path(path2)
        self.transcripts = [path1, path2]
        paths = list(find_AFE(self.graph, self.exonsDB, self.transcripts))

        self.assertEqual(len(paths[0]), 0)
Example #7
0
    def test_negative_two_path_one_exon(self):
        """
            []<-------[]
            []<-------------[]
        """

        path1 = ["end", str(self.ex1), str(self.ex2), "start"]
        path2 = ["end", str(self.ex1), str(self.ex3), "start"]

        path1.reverse()
        path2.reverse()

        self.graph.add_path(path1)
        self.graph.add_path(path2)
        self.transcripts = [path1, path2]
        paths = list(find_AFE(self.graph, self.exonsDB, self.transcripts))

        self.assertEqual(len(paths[0]), 2)
        self.assertItemsEqual(get_num_exons(paths), [2, 2])
Example #8
0
    def test_negative_single_AFE_with_ALE(self):
        """
               []<-------[]<-------[]
                  []<----[]<----------[*]
        """

        self.ex6 = Exon("chrX", 7000, 8000, "ex1.1", "-")
        self.exonsDB[str(self.ex6)] = self.ex6

        path1 = ["end", str(self.ex1), str(self.ex2), str(self.ex3), "start"]
        path2 = ["end", str(self.ex4), str(self.ex2), str(self.ex6), "start"]

        path1.reverse()
        path2.reverse()

        self.graph.add_path(path1)
        self.graph.add_path(path2)
        self.transcripts = [path1, path2]
        paths = list(find_AFE(self.graph, self.exonsDB, self.transcripts))

        self.assertEqual(len(paths[0]), 2)
        self.assertItemsEqual(get_num_exons(paths), [2, 2])