@@ -32,63 +32,24 @@ jupyter:
32
32
thumbnail : thumbnail/alignment-chart.png
33
33
---
34
34
35
- ## Default AlignmentChart
36
- An example of a default AlignmentChart component without any extra properties
35
+ ## Bar Chart for conservation visualization
37
36
38
37
``` python
39
- import urllib.request as urlreq
38
+ import plotly.express as px
40
39
41
- import dash_bio as dashbio
40
+ df = (pd.read_csv(' https://raw.githubusercontent.com/plotly/dash-bio-docs-files/master/gene_conservation.csv' )
41
+ .set_index(' 0' )
42
+ .loc[[' consensus' ,' conservation' ]]
43
+ .T)
42
44
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
- )
45
+ fig = px.bar(df, labels = { ' index' : ' base' }, hover_name = ' consensus' , y = ' conservation' )
46
+ fig.show()
86
47
```
87
48
88
- ## Alignment Chart in ` dash_bio `
49
+ ## Alignment Chart in dash_bio
89
50
90
51
``` python
91
52
from IPython.display import IFrame
92
53
snippet_url = ' https://dash-gallery.plotly.host/python-docs-dash-snippets/'
93
- IFrame(snippet_url + ' bio-circos ' , width = ' 100%' , height = 630 )
54
+ IFrame(snippet_url + ' bio-alignmentchart ' , width = ' 100%' , height = 630 )
94
55
```
0 commit comments