Пример #1
0
 def test_mixed_protocol_fusions_different_sequence(self):
     genome_ev = BreakpointPair(Breakpoint('1', 1),
                                Breakpoint('1', 10),
                                opposing_strands=True,
                                data={
                                    COLUMNS.event_type: SVTYPE.DEL,
                                    COLUMNS.call_method: CALL_METHOD.CONTIG,
                                    COLUMNS.fusion_sequence_fasta_id: 'a',
                                    COLUMNS.protocol: PROTOCOL.GENOME,
                                    COLUMNS.transcript1: None,
                                    COLUMNS.transcript2: None,
                                    COLUMNS.fusion_cdna_coding_start: 1,
                                    COLUMNS.fusion_cdna_coding_end: 10
                                })
     trans_ev = BreakpointPair(Breakpoint('1', 50),
                               Breakpoint('1', 60),
                               opposing_strands=True,
                               data={
                                   COLUMNS.event_type: SVTYPE.DEL,
                                   COLUMNS.call_method: CALL_METHOD.CONTIG,
                                   COLUMNS.fusion_sequence_fasta_id: 'b',
                                   COLUMNS.protocol: PROTOCOL.TRANS,
                                   COLUMNS.transcript1: None,
                                   COLUMNS.transcript2: None,
                                   COLUMNS.fusion_cdna_coding_start: 1,
                                   COLUMNS.fusion_cdna_coding_end: 10
                               })
     self.assertFalse(
         pairing.inferred_equivalent(genome_ev, trans_ev, self.TRANSCRIPTS))
Пример #2
0
 def test_mixed_protocol_fusions_same_sequence_diff_translation(
     self, genomic_event1, genomic_event2, transcripts
 ):
     genome_ev = BreakpointPair(
         Breakpoint('1', 1),
         Breakpoint('1', 10),
         opposing_strands=True,
         **{
             COLUMNS.event_type: SVTYPE.DEL,
             COLUMNS.call_method: CALL_METHOD.CONTIG,
             COLUMNS.fusion_sequence_fasta_id: 'a',
             COLUMNS.protocol: PROTOCOL.GENOME,
             COLUMNS.transcript1: None,
             COLUMNS.transcript2: None,
             COLUMNS.fusion_cdna_coding_start: 1,
             COLUMNS.fusion_cdna_coding_end: 10,
         },
     )
     trans_ev = BreakpointPair(
         Breakpoint('1', 50),
         Breakpoint('1', 60),
         opposing_strands=True,
         **{
             COLUMNS.event_type: SVTYPE.DEL,
             COLUMNS.call_method: CALL_METHOD.CONTIG,
             COLUMNS.fusion_sequence_fasta_id: 'a',
             COLUMNS.protocol: PROTOCOL.TRANS,
             COLUMNS.transcript1: None,
             COLUMNS.transcript2: None,
             COLUMNS.fusion_cdna_coding_start: 1,
             COLUMNS.fusion_cdna_coding_end: 50,
         },
     )
     assert not pairing.inferred_equivalent(genome_ev, trans_ev, transcripts)
Пример #3
0
    def test_mixed_protocol_one_predicted_one_mismatch(self):
        genome_ev = BreakpointPair(
            Breakpoint('1', 350, orient=ORIENT.LEFT),
            Breakpoint('1', 400, orient=ORIENT.RIGHT),
            opposing_strands=False,
            data={
                COLUMNS.event_type: SVTYPE.DEL,
                COLUMNS.call_method: CALL_METHOD.CONTIG,
                COLUMNS.fusion_sequence_fasta_id: None,
                COLUMNS.protocol: PROTOCOL.GENOME,
                COLUMNS.transcript1: self.ust1.name,
                COLUMNS.transcript2: None,
            },
        )
        trans_ev = BreakpointPair(
            Breakpoint('1', 350, orient=ORIENT.LEFT),
            Breakpoint('1', 400, orient=ORIENT.RIGHT),
            opposing_strands=False,
            data={
                COLUMNS.event_type: SVTYPE.DEL,
                COLUMNS.call_method: CALL_METHOD.CONTIG,
                COLUMNS.fusion_sequence_fasta_id: None,
                COLUMNS.protocol: PROTOCOL.TRANS,
                COLUMNS.transcript1: self.ust1.name,
                COLUMNS.transcript2: None,
            },
        )
        self.assertTrue(
            pairing.equivalent(genome_ev, trans_ev, self.TRANSCRIPTS))
        self.assertTrue(
            pairing.equivalent(trans_ev, genome_ev, self.TRANSCRIPTS))

        genome_ev.data[COLUMNS.transcript2] = self.ust1.name
        genome_ev.data[COLUMNS.transcript1] = None
        trans_ev.data[COLUMNS.transcript2] = self.ust1.name
        trans_ev.data[COLUMNS.transcript1] = None
        self.assertTrue(
            pairing.inferred_equivalent(genome_ev, trans_ev, self.TRANSCRIPTS))
        self.assertTrue(
            pairing.inferred_equivalent(trans_ev, genome_ev, self.TRANSCRIPTS))
Пример #4
0
    def test_mixed_protocol_one_predicted_one_mismatch(
        self, genomic_event1, genomic_event2, transcripts, unspliced_transcript1
    ):
        genome_ev = BreakpointPair(
            Breakpoint('1', 350, orient=ORIENT.LEFT),
            Breakpoint('1', 400, orient=ORIENT.RIGHT),
            opposing_strands=False,
            **{
                COLUMNS.event_type: SVTYPE.DEL,
                COLUMNS.call_method: CALL_METHOD.CONTIG,
                COLUMNS.fusion_sequence_fasta_id: None,
                COLUMNS.protocol: PROTOCOL.GENOME,
                COLUMNS.transcript1: unspliced_transcript1.name,
                COLUMNS.transcript2: None,
            },
        )
        trans_ev = BreakpointPair(
            Breakpoint('1', 350, orient=ORIENT.LEFT),
            Breakpoint('1', 400, orient=ORIENT.RIGHT),
            opposing_strands=False,
            **{
                COLUMNS.event_type: SVTYPE.DEL,
                COLUMNS.call_method: CALL_METHOD.CONTIG,
                COLUMNS.fusion_sequence_fasta_id: None,
                COLUMNS.protocol: PROTOCOL.TRANS,
                COLUMNS.transcript1: unspliced_transcript1.name,
                COLUMNS.transcript2: None,
            },
        )
        assert pairing.equivalent(genome_ev, trans_ev, transcripts)
        assert pairing.equivalent(trans_ev, genome_ev, transcripts)

        genome_ev.data[COLUMNS.transcript2] = unspliced_transcript1.name
        genome_ev.data[COLUMNS.transcript1] = None
        trans_ev.data[COLUMNS.transcript2] = unspliced_transcript1.name
        trans_ev.data[COLUMNS.transcript1] = None
        assert pairing.inferred_equivalent(genome_ev, trans_ev, transcripts)
        assert pairing.inferred_equivalent(trans_ev, genome_ev, transcripts)