From 5f0fce86e23c5b6e4d28e5d13806338e7e00fbb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ester=20Mu=C3=B1oz=20del=20Campo?= Date: Tue, 25 Jun 2024 12:16:34 +0200 Subject: [PATCH] Update naming. --- README.md | 2 +- docs/installation.rst | 2 +- docs/tutorial.rst | 217 +++++++++++++++-------------- setup.cfg | 2 +- src/pyranges_plot/plot_features.py | 2 +- src/pyranges_plot/plot_main.py | 2 +- 6 files changed, 114 insertions(+), 113 deletions(-) diff --git a/README.md b/README.md index 9ddd2d9..7448d61 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ If the user wishes to use only one of the engines, the installation of all depen can be avoided by using the engine-specific installation options: ``` # For matplotlib -pip install pyranges-plot[plt] +pip install pyranges-plot[matplotlib] # For plotly pip install pyranges-plot[plotly] diff --git a/docs/installation.rst b/docs/installation.rst index 4333d51..a55f8da 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -10,7 +10,7 @@ commands: :: pip install pyranges-plot[plotly] - pip install pyranges-plot[plt] + pip install pyranges-plot[matplotlib] To install all dependencies in order to be able to use both engines' functionalities, the [all] option must be specified: :: diff --git a/docs/tutorial.rst b/docs/tutorial.rst index a3dc03d..e54b558 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -328,60 +328,61 @@ in the example above). .. code-block:: - +------------------+----------------------+---------+--------------------------------------------------------------+ - | Feature | Value | Edited? | Description | - +------------------+----------------------+---------+--------------------------------------------------------------+ - | colormap | Mariotti_lab palette | | Sequence of colors to assign to every group of intervals | - | | | | sharing the same “color_col” value. It can be provided as a | - | | | | Matplotlib colormap, a Plotly color sequence (built as | - | | | | lists), a string naming the previously mentioned color | - | | | | objects from Matplotlib and Plotly, or a dictionary with | - | | | | the following structure {color_column_value1: color1, | - | | | | color_column_value2: color2, ...}. When a specific | - | | | | color_col value is not specified in the dictionary it will | - | | | | be colored in black. | - | exon_border | None | | Color of the interval's rectangle border. | - | fig_bkg | white | | Bakground color of the whole figure. | - | grid_color | lightgrey | | Color of x coordinates grid lines. | - | plot_bkg | white | | Background color of the plots. | - | plot_border | black | | Color of the line delimiting the plots. | - | shrunk_bkg | lightyellow | | Color of the shrunk region background. | - | tag_bkg | grey | | Background color of the tooltip annotation for the gene in | - | | | | Matplotlib. | - | title_color | black | | Color of the plots' titles. | - | title_size | 18 | | Size of the plots' titles. | - | x_ticks | None | | Int, list or dict defining the x_ticks to be displayed. | - | | | | When int, number of ticks to be placed on each plot. When | - | | | | list, it corresponds to de values used as ticks. When dict, | - | | | | the keys must match the Chromosome values of the data, | - | | | | while the values can be either int or list of int; when int | - | | | | it corresponds to the number of ticks to be placed; when | - | | | | list of int it corresponds to de values used as ticks. Note | - | | | | that when the tick falls within a shrunk region it will not | - | | | | be diplayed. | - +------------------+----------------------+---------+--------------------------------------------------------------+ - | arrow_color | grey | | Color of the arrow indicating strand. | - | arrow_line_width | 1 | | Line width of the arrow lines | - | arrow_size | 0.006 | | Float corresponding to the fraction of the plot or int | - | | | | corresponding to the number of positions occupied by a | - | | | | direction arrow. | - | exon_height | 0.6 | | Height of the exon rectangle in the plot. | - | intron_color | None | | Color of the intron lines. When None, the color of the | - | | | | first interval will be used. | - | text_pad | 0.005 | | Space where the id annotation is placed beside the | - | | | | interval. When text_pad is float, it represents the | - | | | | percentage of the plot space, while an int pad represents | - | | | | number of positions or base pairs. | - | text_size | 10 | | Fontsize of the text annotation beside the intervals. | - | v_spacer | 0.5 | | Vertical distance between the intervals and plot border. | - +------------------+----------------------+---------+--------------------------------------------------------------+ - | plotly_port | 8050 | | Port to run plotly app. | - | shrink_threshold | 0.01 | | Minimum length of an intron or intergenic region in order | - | | | | for it to be shrunk while using the “shrink” feature. When | - | | | | threshold is float, it represents the fraction of the plot | - | | | | space, while an int threshold represents number of | - | | | | positions or base pairs. | - +------------------+----------------------+---------+--------------------------------------------------------------+ + +------------------+-------------+---------+--------------------------------------------------------------+ + | Feature | Value | Edited? | Description | + +------------------+-------------+---------+--------------------------------------------------------------+ + | colormap | popart | | Sequence of colors to assign to every group of intervals | + | | | | sharing the same “color_col” value. It can be provided as a | + | | | | Matplotlib colormap, a Plotly color sequence (built as | + | | | | lists), a string naming the previously mentioned color | + | | | | objects from Matplotlib and Plotly, or a dictionary with | + | | | | the following structure {color_column_value1: color1, | + | | | | color_column_value2: color2, ...}. When a specific | + | | | | color_col value is not specified in the dictionary it will | + | | | | be colored in black. | + | exon_border | None | | Color of the interval's rectangle border. | + | fig_bkg | white | | Bakground color of the whole figure. | + | grid_color | lightgrey | | Color of x coordinates grid lines. | + | plot_bkg | white | | Background color of the plots. | + | plot_border | black | | Color of the line delimiting the plots. | + | shrunk_bkg | lightyellow | | Color of the shrunk region background. | + | tag_bkg | grey | | Background color of the tooltip annotation for the gene in | + | | | | Matplotlib. | + | title_color | black | | Color of the plots' titles. | + | title_size | 18 | | Size of the plots' titles. | + | x_ticks | None | | Int, list or dict defining the x_ticks to be displayed. | + | | | | When int, number of ticks to be placed on each plot. When | + | | | | list, it corresponds to de values used as ticks. When dict, | + | | | | the keys must match the Chromosome values of the data, | + | | | | while the values can be either int or list of int; when int | + | | | | it corresponds to the number of ticks to be placed; when | + | | | | list of int it corresponds to de values used as ticks. Note | + | | | | that when the tick falls within a shrunk region it will not | + | | | | be diplayed. | + +------------------+-------------+---------+--------------------------------------------------------------+ + | arrow_color | grey | | Color of the arrow indicating strand. | + | arrow_line_width | 1 | | Line width of the arrow lines | + | arrow_size | 0.006 | | Float corresponding to the fraction of the plot or int | + | | | | corresponding to the number of positions occupied by a | + | | | | direction arrow. | + | exon_height | 0.6 | | Height of the exon rectangle in the plot. | + | intron_color | None | | Color of the intron lines. When None, the color of the | + | | | | first interval will be used. | + | text_pad | 0.005 | | Space where the id annotation is placed beside the | + | | | | interval. When text_pad is float, it represents the | + | | | | percentage of the plot space, while an int pad represents | + | | | | number of positions or base pairs. | + | text_size | 10 | | Fontsize of the text annotation beside the intervals. | + | v_spacer | 0.5 | | Vertical distance between the intervals and plot border. | + +------------------+-------------+---------+--------------------------------------------------------------+ + | plotly_port | 8050 | | Port to run plotly app. | + | shrink_threshold | 0.01 | | Minimum length of an intron or intergenic region in order | + | | | | for it to be shrunk while using the “shrink” feature. When | + | | | | threshold is float, it represents the fraction of the plot | + | | | | space, while an int threshold represents number of | + | | | | positions or base pairs. | + +------------------+-------------+---------+--------------------------------------------------------------+ + @@ -408,60 +409,60 @@ Now the modified values will be marked when checking the options values: .. code-block:: - +------------------+----------------------+---------+--------------------------------------------------------------+ - | Feature | Value | Edited? | Description | - +------------------+----------------------+---------+--------------------------------------------------------------+ - | colormap | Mariotti_lab palette | | Sequence of colors to assign to every group of intervals | - | | | | sharing the same “color_col” value. It can be provided as a | - | | | | Matplotlib colormap, a Plotly color sequence (built as | - | | | | lists), a string naming the previously mentioned color | - | | | | objects from Matplotlib and Plotly, or a dictionary with | - | | | | the following structure {color_column_value1: color1, | - | | | | color_column_value2: color2, ...}. When a specific | - | | | | color_col value is not specified in the dictionary it will | - | | | | be colored in black. | - | exon_border | None | | Color of the interval's rectangle border. | - | fig_bkg | white | | Bakground color of the whole figure. | - | grid_color | lightgrey | | Color of x coordinates grid lines. | - | plot_bkg | rgb(173, 216, 230) | * | Background color of the plots. | - | plot_border | #808080 | * | Color of the line delimiting the plots. | - | shrunk_bkg | lightyellow | | Color of the shrunk region background. | - | tag_bkg | grey | | Background color of the tooltip annotation for the gene in | - | | | | Matplotlib. | - | title_color | magenta | * | Color of the plots' titles. | - | title_size | 18 | | Size of the plots' titles. | - | x_ticks | None | | Int, list or dict defining the x_ticks to be displayed. | - | | | | When int, number of ticks to be placed on each plot. When | - | | | | list, it corresponds to de values used as ticks. When dict, | - | | | | the keys must match the Chromosome values of the data, | - | | | | while the values can be either int or list of int; when int | - | | | | it corresponds to the number of ticks to be placed; when | - | | | | list of int it corresponds to de values used as ticks. Note | - | | | | that when the tick falls within a shrunk region it will not | - | | | | be diplayed. | - +------------------+----------------------+---------+--------------------------------------------------------------+ - | arrow_color | grey | | Color of the arrow indicating strand. | - | arrow_line_width | 1 | | Line width of the arrow lines | - | arrow_size | 0.006 | | Float corresponding to the fraction of the plot or int | - | | | | corresponding to the number of positions occupied by a | - | | | | direction arrow. | - | exon_height | 0.6 | | Height of the exon rectangle in the plot. | - | intron_color | None | | Color of the intron lines. When None, the color of the | - | | | | first interval will be used. | - | text_pad | 0.005 | | Space where the id annotation is placed beside the | - | | | | interval. When text_pad is float, it represents the | - | | | | percentage of the plot space, while an int pad represents | - | | | | number of positions or base pairs. | - | text_size | 10 | | Fontsize of the text annotation beside the intervals. | - | v_spacer | 0.5 | | Vertical distance between the intervals and plot border. | - +------------------+----------------------+---------+--------------------------------------------------------------+ - | plotly_port | 8050 | | Port to run plotly app. | - | shrink_threshold | 0.01 | | Minimum length of an intron or intergenic region in order | - | | | | for it to be shrunk while using the “shrink” feature. When | - | | | | threshold is float, it represents the fraction of the plot | - | | | | space, while an int threshold represents number of | - | | | | positions or base pairs. | - +------------------+----------------------+---------+--------------------------------------------------------------+ + +------------------+--------------------+---------+--------------------------------------------------------------+ + | Feature | Value | Edited? | Description | + +------------------+--------------------+---------+--------------------------------------------------------------+ + | colormap | popart | | Sequence of colors to assign to every group of intervals | + | | | | sharing the same “color_col” value. It can be provided as a | + | | | | Matplotlib colormap, a Plotly color sequence (built as | + | | | | lists), a string naming the previously mentioned color | + | | | | objects from Matplotlib and Plotly, or a dictionary with | + | | | | the following structure {color_column_value1: color1, | + | | | | color_column_value2: color2, ...}. When a specific | + | | | | color_col value is not specified in the dictionary it will | + | | | | be colored in black. | + | exon_border | None | | Color of the interval's rectangle border. | + | fig_bkg | white | | Bakground color of the whole figure. | + | grid_color | lightgrey | | Color of x coordinates grid lines. | + | plot_bkg | rgb(173, 216, 230) | * | Background color of the plots. | + | plot_border | #808080 | * | Color of the line delimiting the plots. | + | shrunk_bkg | lightyellow | | Color of the shrunk region background. | + | tag_bkg | grey | | Background color of the tooltip annotation for the gene in | + | | | | Matplotlib. | + | title_color | magenta | * | Color of the plots' titles. | + | title_size | 18 | | Size of the plots' titles. | + | x_ticks | None | | Int, list or dict defining the x_ticks to be displayed. | + | | | | When int, number of ticks to be placed on each plot. When | + | | | | list, it corresponds to de values used as ticks. When dict, | + | | | | the keys must match the Chromosome values of the data, | + | | | | while the values can be either int or list of int; when int | + | | | | it corresponds to the number of ticks to be placed; when | + | | | | list of int it corresponds to de values used as ticks. Note | + | | | | that when the tick falls within a shrunk region it will not | + | | | | be diplayed. | + +------------------+--------------------+---------+--------------------------------------------------------------+ + | arrow_color | grey | | Color of the arrow indicating strand. | + | arrow_line_width | 1 | | Line width of the arrow lines | + | arrow_size | 0.006 | | Float corresponding to the fraction of the plot or int | + | | | | corresponding to the number of positions occupied by a | + | | | | direction arrow. | + | exon_height | 0.6 | | Height of the exon rectangle in the plot. | + | intron_color | None | | Color of the intron lines. When None, the color of the | + | | | | first interval will be used. | + | text_pad | 0.005 | | Space where the id annotation is placed beside the | + | | | | interval. When text_pad is float, it represents the | + | | | | percentage of the plot space, while an int pad represents | + | | | | number of positions or base pairs. | + | text_size | 10 | | Fontsize of the text annotation beside the intervals. | + | v_spacer | 0.5 | | Vertical distance between the intervals and plot border. | + +------------------+--------------------+---------+--------------------------------------------------------------+ + | plotly_port | 8050 | | Port to run plotly app. | + | shrink_threshold | 0.01 | | Minimum length of an intron or intergenic region in order | + | | | | for it to be shrunk while using the “shrink” feature. When | + | | | | threshold is float, it represents the fraction of the plot | + | | | | space, while an int threshold represents number of | + | | | | positions or base pairs. | + +------------------+--------------------+---------+--------------------------------------------------------------+ diff --git a/setup.cfg b/setup.cfg index 7f7afe2..6bd1e69 100644 --- a/setup.cfg +++ b/setup.cfg @@ -27,7 +27,7 @@ install_requires = kaleido >= 0.2.1 [options.extras_require] -plt = +matplotlib = matplotlib >= 3.7.2 mplcursors >= 0.5.2 plotly = diff --git a/src/pyranges_plot/plot_features.py b/src/pyranges_plot/plot_features.py index 8970195..18c2ad7 100644 --- a/src/pyranges_plot/plot_features.py +++ b/src/pyranges_plot/plot_features.py @@ -26,7 +26,7 @@ " ", ), "colormap": ( - "Mariotti_lab palette", + "popart", "Sequence of colors to assign to every group of intervals sharing the same “color_col” value. It can be provided as a Matplotlib colormap, a Plotly color sequence (built as lists), a string naming the previously mentioned color objects from Matplotlib and Plotly, or a dictionary with the following structure {color_column_value1: color1, color_column_value2: color2, ...}. When a specific color_col value is not specified in the dictionary it will be colored in black.", " ", ), diff --git a/src/pyranges_plot/plot_main.py b/src/pyranges_plot/plot_main.py index 38ab0d4..6dcc5e4 100644 --- a/src/pyranges_plot/plot_main.py +++ b/src/pyranges_plot/plot_main.py @@ -323,7 +323,7 @@ def getvalue(key): } shrink_threshold = feat_dict["shrink_threshold"] colormap = feat_dict["colormap"] - if colormap == "Mariotti_lab palette": + if colormap == "popart": colormap = prp_cmap # restore options set before plot is called