|
| 1 | +--- |
| 2 | +jupyter: |
| 3 | + jupytext: |
| 4 | + notebook_metadata_filter: all |
| 5 | + text_representation: |
| 6 | + extension: .md |
| 7 | + format_name: markdown |
| 8 | + format_version: '1.3' |
| 9 | + jupytext_version: 1.13.0 |
| 10 | + kernelspec: |
| 11 | + display_name: Python 3 (ipykernel) |
| 12 | + language: python |
| 13 | + name: python3 |
| 14 | + language_info: |
| 15 | + codemirror_mode: |
| 16 | + name: ipython |
| 17 | + version: 3 |
| 18 | + file_extension: .py |
| 19 | + mimetype: text/x-python |
| 20 | + name: python |
| 21 | + nbconvert_exporter: python |
| 22 | + pygments_lexer: ipython3 |
| 23 | + version: 3.9.7 |
| 24 | + plotly: |
| 25 | + display_as: bio |
| 26 | + language: python |
| 27 | + layout: base |
| 28 | + name: Alignment Chart |
| 29 | + order: 1 |
| 30 | + page_type: u-guide |
| 31 | + permalink: python/alignment-chart/ |
| 32 | + thumbnail: thumbnail/alignment-chart.png |
| 33 | +--- |
| 34 | + |
| 35 | +## Default AlignmentChart |
| 36 | +An example of a default AlignmentChart component without any extra properties |
| 37 | + |
| 38 | +```python |
| 39 | +import urllib.request as urlreq |
| 40 | + |
| 41 | +import dash_bio as dashbio |
| 42 | + |
| 43 | + |
| 44 | +data = urlreq.urlopen( |
| 45 | + 'https://raw.githubusercontent.com/plotly/dash-bio-docs-files/master/' + |
| 46 | + 'alignment_viewer_p53.fasta' |
| 47 | +).read().decode('utf-8') |
| 48 | + |
| 49 | +app.layout = dashbio.AlignmentChart( |
| 50 | + id='my-default-alignment-viewer', |
| 51 | + data=data |
| 52 | +) |
| 53 | +``` |
| 54 | + |
| 55 | +## Consensus Sequence |
| 56 | +Toggle the display of the consensus sequence at the bottom of the heatmap. |
| 57 | + |
| 58 | +```python |
| 59 | +import urllib.request as urlreq |
| 60 | + |
| 61 | +import dash_bio as dashbio |
| 62 | + |
| 63 | + |
| 64 | +data = urlreq.urlopen('https://raw.githubusercontent.com/plotly/dash-bio-docs-files/master/alignment_viewer_p53.fasta').read().decode('utf-8') |
| 65 | + |
| 66 | +app.layout = dashbio.AlignmentChart( |
| 67 | + data=data, |
| 68 | + showconsensus=False |
| 69 | +) |
| 70 | +``` |
| 71 | + |
| 72 | +## Tile Size |
| 73 | +Change the height and/or width of the tiles. |
| 74 | + |
| 75 | + |
| 76 | +```python |
| 77 | +import urllib.request as urlreq |
| 78 | +import dash_bio as dashbio |
| 79 | + |
| 80 | +data = urlreq.urlopen('https://raw.githubusercontent.com/plotly/dash-bio-docs-files/master/alignment_viewer_p53.fasta').read().decode('utf-8') |
| 81 | + |
| 82 | +app.layout = dashbio.AlignmentChart( |
| 83 | + data=data, |
| 84 | + tilewidth=50 |
| 85 | +) |
| 86 | +``` |
| 87 | + |
| 88 | +## Alignment Chart in `dash_bio` |
| 89 | + |
| 90 | +```python |
| 91 | +from IPython.display import IFrame |
| 92 | +snippet_url = 'https://dash-gallery.plotly.host/python-docs-dash-snippets/' |
| 93 | +IFrame(snippet_url + 'bio-circos', width='100%', height=630) |
| 94 | +``` |
0 commit comments