-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
dash-bio docs posts #3409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dash-bio docs posts #3409
Changes from 24 commits
645ee13
69ddc67
21c7f70
46a87bd
c25e710
ce0ed07
65a8c07
cd3f780
77638d0
6a1ee59
f219ebb
93ed64a
a38ed99
f4ff867
f78857b
80e9f35
5ed742d
44b3c5f
41cb53c
cdbeb71
df87ed9
343b6f9
b9ab9da
e91ba8a
f05a436
3269052
1335742
05de373
39cb3c2
3dbcbae
a54afe4
b039ebd
bab1653
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
jupyter: | ||
jupytext: | ||
notebook_metadata_filter: all | ||
text_representation: | ||
extension: .md | ||
format_name: markdown | ||
format_version: '1.3' | ||
jupytext_version: 1.13.0 | ||
kernelspec: | ||
display_name: Python 3 (ipykernel) | ||
language: python | ||
name: python3 | ||
language_info: | ||
codemirror_mode: | ||
name: ipython | ||
version: 3 | ||
file_extension: .py | ||
mimetype: text/x-python | ||
name: python | ||
nbconvert_exporter: python | ||
pygments_lexer: ipython3 | ||
version: 3.9.7 | ||
plotly: | ||
display_as: bio | ||
language: python | ||
layout: base | ||
name: Alignment Chart | ||
order: 1 | ||
page_type: u-guide | ||
permalink: python/alignment-chart/ | ||
thumbnail: thumbnail/alignment-chart.png | ||
--- | ||
|
||
## Bar Chart for conservation visualization | ||
|
||
```python | ||
import plotly.express as px | ||
smallstepman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
df = (pd.read_csv('https://raw.githubusercontent.com/plotly/dash-bio-docs-files/master/gene_conservation.csv') | ||
smallstepman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
.set_index('0') | ||
.loc[['consensus','conservation']] | ||
.T) | ||
|
||
fig = px.bar(df, labels={ 'index': 'base' }, hover_name='consensus', y='conservation') | ||
fig.show() | ||
``` | ||
|
||
## Alignment Chart in dash_bio | ||
|
||
```python no_display=true | ||
from IPython.display import IFrame | ||
snippet_url = 'https://dash-gallery.plotly.host/python-docs-dash-snippets/' | ||
IFrame(snippet_url + 'bio-alignmentchart', width='100%', height=630) | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
--- | ||
smallstepman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
jupyter: | ||
jupytext: | ||
notebook_metadata_filter: all | ||
text_representation: | ||
extension: .md | ||
format_name: markdown | ||
format_version: '1.3' | ||
jupytext_version: 1.13.0 | ||
kernelspec: | ||
display_name: Python 3 (ipykernel) | ||
language: python | ||
name: python3 | ||
language_info: | ||
codemirror_mode: | ||
name: ipython | ||
version: 3 | ||
file_extension: .py | ||
mimetype: text/x-python | ||
name: python | ||
nbconvert_exporter: python | ||
pygments_lexer: ipython3 | ||
version: 3.9.7 | ||
plotly: | ||
display_as: bio | ||
language: python | ||
layout: base | ||
name: Clustergram | ||
order: 1 | ||
page_type: u-guide | ||
permalink: python/clustergram/ | ||
thumbnail: thumbnail/clustergram.png | ||
--- | ||
|
||
## Default Clustergram | ||
An example of a default Clustergram component without any extra properties. | ||
|
||
smallstepman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```python | ||
import pandas as pd | ||
import dash_bio | ||
|
||
|
||
df = pd.read_csv( | ||
'https://raw.githubusercontent.com/plotly/datasets/master/Dash_Bio/Chromosomal/' + | ||
'clustergram_brain_cancer.csv', | ||
) | ||
|
||
dash_bio.Clustergram( | ||
data=df, | ||
column_labels=list(df.columns.values), | ||
row_labels=list(df.index), | ||
height=800, | ||
width=700 | ||
) | ||
``` | ||
|
||
## Dendrogram Cluster Colors/Line Widths | ||
Change the colors of the dendrogram traces that are used to represent clusters, and configure their line widths. | ||
|
||
|
||
```python | ||
import pandas as pd | ||
import dash_bio | ||
|
||
df = pd.read_csv( | ||
'https://raw.githubusercontent.com/plotly/datasets/master/Dash_Bio/Chromosomal/' + | ||
'clustergram_brain_cancer.csv', | ||
) | ||
|
||
dash_bio.Clustergram( | ||
data=df, | ||
column_labels=list(df.columns.values), | ||
row_labels=list(df.index), | ||
height=800, | ||
width=700, | ||
color_list={ | ||
'row': ['#636EFA', '#00CC96', '#19D3F3'], | ||
'col': ['#AB63FA', '#EF553B'], | ||
'bg': '#506784' | ||
}, | ||
line_width=2 | ||
) | ||
``` | ||
|
||
## Relative Dendrogram Size | ||
Change the relative width and height of, respectively, the row and column dendrograms compared to the width and height of the heatmap. | ||
|
||
|
||
```python | ||
import pandas as pd | ||
import dash_bio | ||
|
||
df = pd.read_csv( | ||
'https://raw.githubusercontent.com/plotly/datasets/master/Dash_Bio/Chromosomal/' + | ||
'clustergram_brain_cancer.csv', | ||
) | ||
|
||
dash_bio.Clustergram( | ||
data=df, | ||
column_labels=list(df.columns.values), | ||
row_labels=list(df.index), | ||
height=800, | ||
width=700, | ||
display_ratio=[0.1, 0.7] | ||
) | ||
``` | ||
|
||
## Circos with Dash | ||
|
||
smallstepman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
```python no_display=true | ||
from IPython.display import IFrame | ||
snippet_url = 'https://dash-gallery.plotly.host/python-docs-dash-snippets/' | ||
IFrame(snippet_url + 'bio-circos', width='100%', height=630) | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
jupyter: | ||
celltoolbar: Tags | ||
jupytext: | ||
notebook_metadata_filter: all | ||
text_representation: | ||
extension: .md | ||
format_name: markdown | ||
format_version: '1.3' | ||
jupytext_version: 1.13.0 | ||
kernelspec: | ||
display_name: Python 3 (ipykernel) | ||
language: python | ||
name: python3 | ||
language_info: | ||
codemirror_mode: | ||
name: ipython | ||
version: 3 | ||
file_extension: .py | ||
mimetype: text/x-python | ||
name: python | ||
nbconvert_exporter: python | ||
pygments_lexer: ipython3 | ||
version: 3.9.7 | ||
plotly: | ||
display_as: bio | ||
language: python | ||
layout: base | ||
name: Volcano plot | ||
smallstepman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
order: 1 | ||
page_type: u-guide | ||
permalink: python/volcano-plot/ | ||
thumbnail: thumbnail/volcano-plot.png | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note - I can add the thumbnails, which are sourced from our S3 bucket, as long as they have the correct path. Once we know which ones we want to add to begin with, feel free to send me the thumbnails and I can upload them so that they're displayed on the docs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @HammadTheOne we've dumped all image files here
|
||
--- | ||
|
||
## Manhattan Plot | ||
|
||
An example of a default ManhattanPlot component without any extra properties. | ||
smallstepman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```python | ||
import pandas as pd | ||
import dash_bio as dashbio | ||
|
||
df = pd.read_csv('https://raw.githubusercontent.com/plotly/dash-bio-docs-files/master/manhattan_data.csv') | ||
|
||
|
||
dashbio.ManhattanPlot( | ||
dataframe=df, | ||
) | ||
``` | ||
|
||
## Highlighted points color, and colors of the suggestive line and the genome-wide line. | ||
Change the color of the points that are considered significant. | ||
|
||
```python | ||
import pandas as pd | ||
import dash_bio as dashbio | ||
|
||
|
||
df = pd.read_csv('https://raw.githubusercontent.com/plotly/dash-bio-docs-files/master/manhattan_data.csv') | ||
|
||
dashbio.ManhattanPlot( | ||
dataframe=df, | ||
highlight_color='#00FFAA', | ||
suggestiveline_color='#AA00AA', | ||
genomewideline_color='#AA5500' | ||
) | ||
``` | ||
|
||
## ManhattanPlot with Dash | ||
|
||
smallstepman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
```python no_display=true | ||
from IPython.display import IFrame | ||
snippet_url = 'https://dash-gallery.plotly.host/python-docs-dash-snippets/' | ||
IFrame(snippet_url + 'bio-manhattanplot', width='100%', height=630) | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
jupyter: | ||
celltoolbar: Tags | ||
jupytext: | ||
notebook_metadata_filter: all | ||
text_representation: | ||
extension: .md | ||
format_name: markdown | ||
format_version: '1.3' | ||
jupytext_version: 1.13.0 | ||
kernelspec: | ||
display_name: Python 3 (ipykernel) | ||
language: python | ||
name: python3 | ||
language_info: | ||
codemirror_mode: | ||
name: ipython | ||
version: 3 | ||
file_extension: .py | ||
mimetype: text/x-python | ||
name: python | ||
nbconvert_exporter: python | ||
pygments_lexer: ipython3 | ||
version: 3.9.7 | ||
plotly: | ||
display_as: bio | ||
language: python | ||
layout: base | ||
name: Volcano plot | ||
smallstepman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
order: 1 | ||
page_type: u-guide | ||
permalink: python/volcano-plot/ | ||
thumbnail: thumbnail/volcano-plot.png | ||
--- | ||
|
||
## VolcanoPlot | ||
An example of a default VolcanoPlot component without any extra properties. | ||
|
||
|
||
smallstepman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
```python | ||
import pandas as pd | ||
import dash_bio | ||
|
||
|
||
df = pd.read_csv( | ||
'https://raw.githubusercontent.com/plotly/dash-bio-docs-files/master/' + | ||
'volcano_data1.csv' | ||
) | ||
|
||
dash_bio.VolcanoPlot( | ||
dataframe=df, | ||
) | ||
``` | ||
|
||
## Point Sizes And Line Widths | ||
Change the size of the points on the scatter plot, and the widths of the effect lines and genome-wide line. | ||
|
||
|
||
```python | ||
import pandas as pd | ||
import dash_bio as dashbio | ||
|
||
df = pd.read_csv('https://raw.githubusercontent.com/plotly/dash-bio-docs-files/master/volcano_data1.csv') | ||
|
||
dashbio.VolcanoPlot( | ||
dataframe=df, | ||
point_size=10, | ||
effect_size_line_width=4, | ||
genomewideline_width=2 | ||
) | ||
``` | ||
|
||
## VolcanoPlot with Dash | ||
|
||
```python no_display=true | ||
from IPython.display import IFrame | ||
snippet_url = 'https://dash-gallery.plotly.host/python-docs-dash-snippets/' | ||
IFrame(snippet_url + 'bio-volcano', width='100%', height=630) | ||
``` |
Uh oh!
There was an error while loading. Please reload this page.