Exemplo n.º 1
0
def test_subs_3_prime_side(annotator, transcript_model, effect_checker):
    variant = Variant(loc="1:80", ref="A", alt="G")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model
    )
    effect = effect_checker.get_effect(request)
    assert effect is None

    variant = Variant(loc="1:79", ref="A", alt="G")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model
    )
    effect = effect_checker.get_effect(request)
    assert effect.effect == "intron"

    variant = Variant(loc="1:78", ref="A", alt="G")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model
    )
    effect = effect_checker.get_effect(request)
    assert effect.effect == "intron"

    variant = Variant(loc="1:77", ref="A", alt="G")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model
    )
    effect = effect_checker.get_effect(request)
    assert effect.effect == "intron"
Exemplo n.º 2
0
def test_deletion_5_prime_side(annotator, transcript_model, effect_checker):
    variant = Variant(loc="1:70", ref="0", alt="")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model
    )
    effect = effect_checker.get_effect(request)
    assert effect is None

    variant = Variant(loc="1:71", ref="0", alt="")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model
    )
    effect = effect_checker.get_effect(request)
    assert effect.effect == "intron"

    variant = Variant(loc="1:72", ref="0", alt="")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model
    )
    effect = effect_checker.get_effect(request)
    assert effect.effect == "intron"

    variant = Variant(loc="1:73", ref="0", alt="")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model
    )
    effect = effect_checker.get_effect(request)
    assert effect.effect == "intron"
Exemplo n.º 3
0
def test_deletion_3_prime_side(annotator, transcript_model, effect_checker):
    variant = Variant(loc="1:80", ref="0", alt="")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model
    )
    effect = effect_checker.get_effect(request)
    assert effect.effect == "non-coding"

    variant = Variant(loc="1:79", ref="0", alt="")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model
    )
    effect = effect_checker.get_effect(request)
    assert effect.effect == "non-coding-intron"

    variant = Variant(loc="1:78", ref="0", alt="")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model
    )
    effect = effect_checker.get_effect(request)
    assert effect.effect == "non-coding-intron"

    variant = Variant(loc="1:77", ref="0", alt="")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model
    )
    effect = effect_checker.get_effect(request)
    assert effect.effect == "non-coding-intron"
Exemplo n.º 4
0
def test_subs_5_prime_side(annotator, transcript_model, effect_checker):
    variant = Variant(loc="1:70", ref="A", alt="G")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model
    )
    effect = effect_checker.get_effect(request)
    assert effect.effect == "non-coding"

    variant = Variant(loc="1:71", ref="A", alt="G")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model
    )
    effect = effect_checker.get_effect(request)
    assert effect.effect == "non-coding-intron"

    variant = Variant(loc="1:72", ref="A", alt="G")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model
    )
    effect = effect_checker.get_effect(request)
    assert effect.effect == "non-coding-intron"

    variant = Variant(loc="1:73", ref="A", alt="G")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model
    )
    effect = effect_checker.get_effect(request)
    assert effect.effect == "non-coding-intron"
Exemplo n.º 5
0
def test_exonic_distance(annotator, transcript_model):
    variant = Variant(loc="1:64", ref="A", alt="")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model)
    assert request.get_exonic_distance(60, 61) == 1
    assert request.get_exonic_distance(60, 70) == 10
    assert request.get_exonic_distance(60, 80) == 11
    assert request.get_exonic_distance(70, 80) == 1
Exemplo n.º 6
0
def test_negative_deletion_at_start(annotator, negative_transcript_model,
                                    effect_checker):
    variant = Variant(loc="1:109", ref="ABC", alt="")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, negative_transcript_model)
    effect = effect_checker.get_effect(request)

    assert effect.effect == "noStart"
Exemplo n.º 7
0
def test_possitive_insertion_after_start(annotator, possitive_transcript_model,
                                         effect_checker):
    variant = Variant(loc="1:68", ref="", alt="ABC")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, possitive_transcript_model)
    effect = effect_checker.get_effect(request)

    assert effect is None
Exemplo n.º 8
0
def test_multiple_codons_nonsense(annotator, transcript_model, effect_checker):
    variant = Variant(loc="1:65", ref="ABCDEF", alt="EndPBC")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model)
    request.cod2aa = lambda codon: codon
    effect = effect_checker.get_effect(request)

    assert effect.effect == "nonsense"
Exemplo n.º 9
0
def test_synonymous(annotator, transcript_model, effect_checker):
    variant = Variant(loc="1:65", ref="ABC", alt="End")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model)
    request.cod2aa = lambda codon: "Asn"
    effect = effect_checker.get_effect(request)

    assert effect.effect == "synonymous"
Exemplo n.º 10
0
def test_negative_deletion_before_end(annotator, negative_transcript_model,
                                      effect_checker):
    variant = Variant(loc="1:62", ref="ABC", alt="")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, negative_transcript_model)
    effect = effect_checker.get_effect(request)

    assert effect is None
Exemplo n.º 11
0
def test_deletion_before_start(annotator, transcript_model, effect_checker):
    variant = Variant(loc="1:65", ref="A", alt="")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model)
    effect = effect_checker.get_effect(request)

    assert effect.effect == "5'UTR"
    assert effect.dist_from_coding == 11
Exemplo n.º 12
0
def test_deletion_after_end_last_exon(annotator, transcript_model,
                                      effect_checker):
    variant = Variant(loc="1:151", ref="A", alt="")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model)
    effect = effect_checker.get_effect(request)

    assert effect.effect == "3'UTR"
    assert effect.dist_from_coding == 7
Exemplo n.º 13
0
def test_exonic_pos_last_exon(annotator, transcript_model):
    variant = Variant(loc="1:110", ref="A", alt="")
    request = AnnotationRequestFactory.create_annotation_request(
        annotator, variant, transcript_model)
    assert request.get_exonic_position() == 33
    assert request.get_exonic_length() == 33