Contents

Overview

_this is an experimental project._

docs Documentation Status
tests
Travis-CI Build Status AppVeyor Build Status
Coverage Status Coverage Status
Codacy Code Quality Status CodeClimate Quality Status Code Climate technical debt
package
PyPI Package latest release PyPI Wheel Supported versions Supported implementations
Commits since latest release PyPI - Downloads

Plotting templates common in biological sciences.

Installation

pip install bioplottemplates

You can also install the in-development version with:

pip install https://github.com/joaomcteixeira/python-bioplottemplates/archive/master.zip

Development

To run the all tests run:

tox

Installation

At the command line:

pip install bioplottemplates

Usage

To use BioPlotTemplates in a project:

import bioplottemplates

Reference

bioplottemplates

BioPlot Templates.

This package contains useful plotting templates for
biological sciences.
class bioplottemplates.Path[source]

Define a common Path to string interface.

Avoids using os.fspath around libs.

str()[source]

Return string version of Path.

Plots

Plot a single parameter.

bioplottemplates.plots.param.plot(x_data, y_data, *, labels='No label provided', title=None, xlabel=None, ylabel=None, colors=('b', 'g', 'r', 'c', 'm', 'y', 'k'), alpha=0.7, xmax=None, xmin=None, ymax=None, ymin=None, grid=True, grid_color='lightgrey', grid_ls='-', grid_lw=1, grid_alpha=0.5, legend=True, legend_fs=6, legend_loc=4, vert_lines=None, figsize=(8, 6), filename='plot_param.pdf', **kwargs)[source]

Plot a single plot with the combined RMSD.

Bellow parameters concern data representation and are considered of highest importance because their incorrect use can mislead data analysis and consequent conclusions.

Plot style parameters concernning only plot style, i.e., colors, shapes, fonts, etc… and which do not distort the actual data, are not listed in the paremeter list bellow. We hope these parameter names are self-explanatory and are listed in the function definition.

Parameters:
  • x_data (interable of numbers) – Container of the X axis data. Should be accepted by matplotlib.
  • y_data (np.ndarray, shape=(M,)) – Container of the Y axis data. Where M is the RMSDs data for the combined chains.
  • labels (str, optional) – The label to represent in plot legend. If a list of series is provided, a list of labels can be provided as well. Defauts to: “no labels provided”.
  • filename (str, optional) – The file name with which the plot figure will be saved in disk. Defaults to rmsd_individual_chains_one_subplot.pdf. You can change the file type by specifying its extention in the file name.
  • fig_size (tuple of float or int) – The size ratio of the subplot in the figure.

Plot a single parameter.

bioplottemplates.plots.label_dots.plot(x_labels, y_data, title=None, xlabel=None, ylabel=None, series_labels=None, legend=True, legend_fs=6, legend_loc=4, numeric_x_labels=False, colors=('b', 'g', 'r', 'c', 'm', 'y', 'k'), alpha=0.7, grid=True, grid_color='lightgrey', grid_ls='-', grid_lw=1, grid_alpha=0.5, figsize=(10, 6), filename='plot_param.pdf', **kwargs)[source]

Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

Bug reports

When reporting a bug please include:

  • Your operating system name and version.
  • Any details about your local setup that might be helpful in troubleshooting.
  • Detailed steps to reproduce the bug.

Documentation improvements

BioPlotTemplates could always use more documentation, whether as part of the official BioPlotTemplates docs, in docstrings, or even on the web in blog posts, articles, and such.

Feature requests and feedback

The best way to send feedback is to file an issue at https://github.com/joaomcteixeira/python-bioplottemplates/issues.

If you are proposing a feature:

  • Explain in detail how it would work.
  • Keep the scope as narrow as possible, to make it easier to implement.
  • Remember that this is a volunteer-driven project, and that code contributions are welcome :)

Development

To set up python-bioplottemplates for local development:

  1. Fork python-bioplottemplates (look for the “Fork” button).

  2. Clone your fork locally:

    git clone git@github.com:joaomcteixeira/python-bioplottemplates.git
    
  3. Create a branch for local development:

    git checkout -b name-of-your-bugfix-or-feature
    

    Now you can make your changes locally.

  4. When you’re done making changes, run all the checks, doc builder and spell checker with tox one command:

    tox
    
  5. Commit your changes and push your branch to GitHub:

    git add .
    git commit -m "Your detailed description of your changes."
    git push origin name-of-your-bugfix-or-feature
    
  6. Submit a pull request through the GitHub website.

Pull Request Guidelines

If you need some code review or feedback while you’re developing the code just make the pull request.

For merging, you should:

  1. Include passing tests (run tox) [1].
  2. Update documentation when there’s new API, functionality etc.
  3. Add a note to CHANGELOG.rst about the changes.
  4. Add yourself to AUTHORS.rst.
[1]

If you don’t have all the necessary python versions available locally you can rely on Travis - it will run the tests for each change you add in the pull request.

It will be slower though …

Tips

To run a subset of tests:

tox -e envname -- pytest -k test_myfeature

To run all the test environments in parallel (you need to pip install detox):

detox

Authors

Changelog

0.1.1 (2020-01-14)

  • added plotlabeld interface for label_dots.

0.1.0 (2019-12-20)

  • added xmin, xmax, ymin and ymax options in plots.param.plot.
  • Implemented client interface for param.

0.0.4 (2019-12-15)

  • Implemented cli_labeldots and general cli interface
  • Implemented label_dots plot template
  • Removed spellcheck from Travis-CI (PR164)

0.0.3 (2019-10-14)

  • Supports just Python >= 3.6
  • Coverage details reported just from Travis-CI
  • Added new stats badges
  • Removed CI for OSX.

0.0.0 (2019-10-10)

  • First release on PyPI.

Indices and tables