Ejemplo n.º 1
0
    def test_find_match_with_diff_5(self):
        """ Example of an ISM where the start is different from the match
        """
        conn, cursor = get_db_cursor()
        build = "toy_build"
        transcript_dict = talon.make_transcript_dict(cursor)

        edges = ( 200, 13, 14 )
        gene_ID, transcripts = talon.search_for_transcript_prefix(edges, transcript_dict)

        # Make sure that correct match got returned
        correct_gene_ID = fetch_correct_ID("TG2", "gene", cursor)
        assert gene_ID == correct_gene_ID

        conn.close()
Ejemplo n.º 2
0
    def test_find_no_match(self):
        """ Example where the toy transcript database contains no matches
            for the edge set.
        """
        conn, cursor = get_db_cursor()
        build = "toy_build"
        transcript_dict = talon.make_transcript_dict(cursor)
        conn.close()

        edges = (1, 2, 3)
        gene_ID, transcripts = talon.search_for_transcript_suffix(
            edges, transcript_dict)

        # Make sure that no match got returned
        assert gene_ID == None
Ejemplo n.º 3
0
    def test_find_monoexon_match(self):
        """ Input is a single exon that matches the end of an existing transcript
        """
        conn, cursor = get_db_cursor()
        build = "toy_build"
        transcript_dict = talon.make_transcript_dict(cursor)

        edges = (16, )
        gene_ID, matches = talon.search_for_transcript_suffix(
            edges, transcript_dict)

        # Make sure that correct match got returned
        correct_gene_ID = fetch_correct_ID("TG2", "gene", cursor)

        assert gene_ID == correct_gene_ID
        conn.close()
Ejemplo n.º 4
0
    def test_find_match(self):
        """ Example where the toy transcript database contains exactly one 
            prefix match for the transcript.
        """
        conn, cursor = get_db_cursor()
        build = "toy_build"
        transcript_dict = talon.make_transcript_dict(cursor)

        edges = ( 12, 13, 14 )
        gene_ID, transcripts = talon.search_for_transcript_prefix(edges, transcript_dict)

        # Make sure that correct match got returned
        correct_gene_ID = fetch_correct_ID("TG2", "gene", cursor)
        assert gene_ID == correct_gene_ID
        assert transcripts == [(12, 13, 14, 15, 16)]
        conn.close()