greatpy.pl.dotplot_multi_sample
- greatpy.pl.dotplot_multi_sample(test_data, n_row=5, list_id=[], fig=None, show_term_name=False, term_name_nchars=30, dot_size_amplifier=7, palette_id='Reds', ylab='GO', xlab='', label_colorbar='-log(p_hypergeometric)', marker='o', plot_title='Dotplot of enrichment GO terms', line_width=0.1, circle_legend='log2(odd ratio)', save=False, **kwargs)
Dotplot of enrichment GO terms for a given list of example genomic regions.
- Parameters:
- test_data : dict
dict of multiple tests output
- n_row : int
Number of rows pick in each dataframe.
Default is
5- list_id : list
List of IDs to be plotted. If
list_id == [], any filter will be applied.Default is
[]- fig : matplotlib.figure.Figure or None
Figure to plot the dotplot.
Default is
None- show_term_name : bool
Whether to show the GO term name.
Default is
False- term_name_nchars : int
Number of characters to show for the GO term name.
Default is
30- dot_size_amplifier : int or float
Amplifier for the dot size.
Default is
7- palette_id : str or matplotlib.cm
Color palette for the dotplot.
Default is
Reds- ylab : str
Y-axis label.
Default is
"GO"- xlab : str
X-axis label.
Default is
""- label_colorbar : str
Label for the colorbar.
Default is
"-log(p_hypergeometric)"- marker : str
Marker for the dotplot.
Default is
"o"- plot_title : str
Plot title.
Default is
"Dotplot of enrichment GO terms"- line_width : int
Dot line width.
Default is
0.1- circle_legend : str
Legend for the circle.
Default is
"log2(odd ratio)"- kwargs
Other parameters to be passed to the make make_bubble_heatmap function.
- Returns:
None – Dotplot of enrichment GO terms for the given df
p_val (pandas.DataFrame) – Dataframe of plotted p-values
odds_ratio (pandas.DataFrame) – Dataframe of plotted odds ratios
df (pandas.DataFrame) – Dataframe of all results concatenated
Examples
>>> test = ["SRF:Ishikawa,A-673-clone-Asp114,K-562,MCF-7,Hep-G2","MAX:K-562,WA01,HeLa-S3", "BACH1:A-549,GM12878"] >>> tmp_df = great.tl.enrichment_multiple( tests = test, regdom_file="../data/human/hg38/regulatory_domain.bed", chr_size_file="../data/human/hg38/chr_size.bed", annotation_file="../data/human/ontologies.csv", binom=True, hypergeom=True,) >>> p_val,odd_ratio = great.pl.dotplot_multi_sample(tmp_df)
>>> p_val ... | id | 0 | 1 | 2 | ... |:-----------|--------:|--------:|---------:| ... | GO:0051292 | 6.28405 | 1 | 1 | ... | GO:0030261 | 5.51863 | 1 | 1 | ... | GO:0001650 | 5.3019 | 1 | 1 | ... | GO:0090096 | 5.29709 | 1 | 1 | ... | GO:0099637 | 5.29709 | 1 | 1 | ... | GO:0004896 | 1 | 7.98072 | 1 | ... | GO:0038165 | 1 | 7.93887 | 1 | ... | GO:0030883 | 1 | 7.03282 | 1 | ... | GO:0048006 | 1 | 7.03282 | 1 | ... | GO:0004924 | 1 | 7.03282 | 1 | ... | GO:0008137 | 1 | 1 | 14.0412 | ... | GO:0015990 | 1 | 1 | 13.2519 | ... | GO:0006120 | 1 | 1 | 11.7472 | ... | GO:0045277 | 1 | 1 | 10.2356 | ... | GO:0030964 | 1 | 1 | 9.74806 |
>>> odds_ratio ... | id | 0 | 1 | 2 | ... |:-----------|--------:|--------:|--------:| ... | GO:0051292 | 4.94165 | 0 | 0 | ... | GO:0030261 | 4.39416 | 0 | 0 | ... | GO:0001650 | 2.54406 | 0 | 0 | ... | GO:0090096 | 7.64209 | 0 | 0 | ... | GO:0099637 | 7.64209 | 0 | 0 | ... | GO:0004896 | 0 | 3.58059 | 0 | ... | GO:0038165 | 0 | 6.00685 | 0 | ... | GO:0030883 | 0 | 5.42189 | 0 | ... | GO:0048006 | 0 | 5.42189 | 0 | ... | GO:0004924 | 0 | 5.42189 | 0 | ... | GO:0008137 | 0 | 0 | 3.76802 | ... | GO:0015990 | 0 | 0 | 6.61172 | ... | GO:0006120 | 0 | 0 | 3.65752 | ... | GO:0045277 | 0 | 0 | 5.44179 | ... | GO:0030964 | 0 | 0 | 7.02675 |