A small library to plot Bismark methylation_exctractor reports.
Project description
BismarkPlot
A small library to plot Bismark methylation_exctractor
reports.
See the docs: https://shitohana.github.io/BismarkPlot
Right now only coverage2cytosine
input is supported, but support for bismark2bedGraph
will be added soon.
Example
First we need to initialize genome
and BismarkFiles
. genome
is .gff or .bed file with gene coordinates. BismarkFiles
is a class, which calculates data for all plots, so their types need to be specified when it is initialized.
import bismarkplot
file = 'path/to/genome.gff'
genome = bismarkplot.read_genome(
file,
flank_length=2000,
min_length=4000
)
files = ['path/to/genomeWide1.txt', 'path/to/genomeWide2.txt']
bismark = bismarkplot.BismarkFiles(
files, genome,
flank_windows=500,
gene_windows=2000,
line_plot=True,
heat_map=True,
box_plot=True,
bar_plot=True
)
Let's now draw plots themselves.
For line plots use (or draw_line_plots_all
for all contexts)
bismark.draw_line_plots_filtered(
context='CG',
strand='+',
smooth=.05,
labels = ['exp1', 'exp2'],
title = 'Plot for CG+'
)
Result:
For heat maps use (or draw_heat_maps_all
for all contexts)
bismark.draw_heat_maps_filtered(
context='CG',
strand='+',
resolution=100,
labels = ['exp1', 'exp2'],
title = 'Heatmap for CG+'
)
Result: For box plot or bar plot use
bismark.draw_box_plot(strand_specific=True, labels=['exp1', 'exp2'])
bismark.draw_bar_plot(labels=['exp1', 'exp2'])
Result ![bar_05_07_23:54.png](https://user-images.githubusercontent.com/43905117/236703687-f3fd1225-1ad1-45b0-9318-b2282a694e68.png
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for bismarkplot-0.2.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9759abc9926ea0d86c43fe0722bae5c1e90f13cc0c2f176da99bbdee9a8ff1e6 |
|
MD5 | a0636177c62a7022177f8e33cdcf1a70 |
|
BLAKE2b-256 | 8a87e5cac4c0f17de6c8bb84f6637be5fb6bc77b751b7482087962d4c98c6e24 |