Beispiel #1
0
def Visualiser_sekvens(gen):
    import warnings
    from Bio import BiopythonParserWarning
    warnings.simplefilter('ignore', BiopythonParserWarning)

    if gen == 'alle':
        fil = 'Artemisia%20annua.gb'
        graphic_record = ChangeFeatures().translate_record(fil)
        ax, _ = graphic_record.plot(figure_width=20)
        ax.figure.tight_layout()

    elif gen == "aldh1":
        sequence = "CTGTGTCTAGATTTACGGTTTTGTTGAGTATGGAGTATTTATCCCTGTGTCTAGATTTACGGTTTGAAGACTCAGGAAACTCTCATTAAGCGATCAACGTAGCATGATCATCAAAAGCATGGTTTTGTAAACTCGACATGTCAATGTACCAGCCGATCCAAGTATCCAAGCAATTGGTTCACCACACCAAAAGAGTTTTACACTTAAAAACAACAATTAATTCTAAATAGTCTATGTAATGAAATATGTTTTGTGTGGGTTAGTTTAGTTCATAGTTGCGCCATAAGTATTTACAGCAA"
        record = GraphicRecord(sequence=sequence,
                               features=[
                                   GraphicFeature(start=0,
                                                  end=28,
                                                  strand=+1,
                                                  color='#ffd700',
                                                  label="Promotor"),
                                   GraphicFeature(start=29,
                                                  end=299,
                                                  strand=+1,
                                                  color="#ffcccc",
                                                  label="aldh1")
                               ])
        ax, _ = record.plot(figure_width=50)
        record.plot_sequence(ax)
        record.plot_translation(ax, (29, 299), fontdict={'weight': 'bold'})

    elif gen == 'CYP71AV1':
        sequence = "ATTTTTGGGGGCCCCCCCCCATTTTTTGGGGGGCGCGCGATGAAGTTGGTCATTCGAAATATACTTCCAAAATATGAAGTTGGTCATTCGAAATATACTTCCAAACAACCGAGCTGGTCAGGTAGATTTTGTTTCAGATGAAGATGCAATCCACCGTTGGGGGAGTTTCATGAATAACAATCGCAAATAAGATATATTGTTGATTCTTGATGATGTTTGGTCTGATACCATCATCACCGACCTCCAATTCAGGTCACGTGGATACAAGATCCTCGTGACCTCTGAAACAACCTTTAAGAGATTCGATACATATAAAGTGAGACCTCTCAGTGTTCAAGATGCCATCAATCTGTTATGCTATTCAACACTTTCGGAGCGTGCAAGTCAAGCCACAAATGACATACAGACCTTGTTGACAAGGTGAAATTTCAAATTATTCCAAGATTCATGTTTCATACCTTTATAAGAAAGTAATATCTAAACCATATTAACAAATACTAACAATTAACTTTCAAATGTTTTTGTAGTTAACCAAATGTTGCAAGAAGAATCCGCTCGCCTTAAGTGTCATTGGTGGTCGCCTAAAGGGGACACAAATGGAAAGTTGGCATCATACACTGAAAAAGCTATCTCAAGCCACACACCCTCTTATCGACCTTCCTTTGGATGAGGCAAACAGATTTCATCTCGCAAGAGCTCTCGGTTTACTCAAAGATGATGAACGCAACAGCCCCAGAAGTTCAACCTCGAAATTGACCCGATCTTACCAAGTCA"
        record = GraphicRecord(sequence=sequence,
                               features=[
                                   GraphicFeature(start=1,
                                                  end=38,
                                                  strand=+1,
                                                  color='#cffccc',
                                                  label="Promotor"),
                                   GraphicFeature(start=39,
                                                  end=774,
                                                  strand=+1,
                                                  color="#cff77d",
                                                  label="CYP71AV1")
                               ])
        ax, _ = record.plot(figure_width=100)
        record.plot_sequence(ax)
        record.plot_translation(ax, (39, 774), fontdict={'weight': 'bold'})
    return
def haplotype_blocks_fig(model, ref_seq):
    s1, s2 = model.align_alleles()
    record = GraphicRecord(sequence=ref_seq,
                           sequence_length=len(ref_seq),
                           features=[
                               GraphicFeature(start=0,
                                              end=len(s1),
                                              strand=+1,
                                              color='#ffcccc'),
                               GraphicFeature(start=0,
                                              end=len(s2),
                                              strand=+1,
                                              color='#cffccc')
                           ])
    ax, _ = record.plot(figure_width=5)
    record.plot_sequence(ax)
    record.plot_translation(ax, (8, 23), fontdict={'weight': 'bold'})
    ax.figure.savefig('haplotypes.png', bbox_inches='tight')
Beispiel #3
0
def test_sequence_and_translation_plotting():
    from dna_features_viewer import (
        GraphicFeature,
        GraphicRecord,
        CircularGraphicRecord,
    )

    features = [
        GraphicFeature(
            start=5, end=10, strand=+1, color="#ffd700", label="bbS-1"
        ),
        GraphicFeature(
            start=8, end=15, strand=+1, color="#ffcccc", label="CrC"
        ),
    ]

    record = GraphicRecord(sequence=7 * "ATGC", features=features)
    ax, _ = record.plot(figure_width=5)
    record.plot_sequence(ax)
    record.plot_translation(ax, (8, 23), fontdict={"weight": "bold"})
from dna_features_viewer import GraphicFeature, GraphicRecord

record = GraphicRecord(sequence="ATGCATGCATGCATGCATGCATGCATGC", features=[
    GraphicFeature(start=5, end=10, strand=+1, color='#ffcccc'),
    GraphicFeature(start=8, end=15, strand=+1, color='#ccccff')
])

ax, _ = record.plot(figure_width=5)
record.plot_sequence(ax)
record.plot_translation(ax, (8, 23), fontdict={'weight': 'bold'})
ax.figure.savefig('sequence_and_translation.png', bbox_inches='tight')
from dna_features_viewer import GraphicFeature, GraphicRecord

record = GraphicRecord(sequence="ATGCATGCATGCATGCATGCATGCATGC",
                       features=[
                           GraphicFeature(start=5,
                                          end=10,
                                          strand=+1,
                                          color='#ffcccc'),
                           GraphicFeature(start=8,
                                          end=15,
                                          strand=+1,
                                          color='#ccccff')
                       ])

ax, _ = record.plot(figure_width=6)
record.plot_sequence(ax, guides_intensity=0.2)
fontdict = {'weight': 'bold'}
record.plot_translation(ax, (8, 23), fontdict=fontdict, guides_intensity=0.8)
ax.figure.savefig('sequence_and_translation.png', bbox_inches='tight')