Skip to main content

Lysis curve package

Project description

Lysis-curve

This package generates automated lysis curves (bacterial growth curves) for biological research via Plotly and utilizes code for automated grouping, titles, annotations and subplotting within a single custom graphing function.

Simply changing the function arguments can generate a variety of bacterial growth curves.

The graphs are dynamic when generated within a webpage (i.e. Jupyter) which can be useful when teasing apart data.

For a very similar package which generates non-dynamic but prettier bacterial growth curves / lysis curves using R rather than Python, see Cody Martin's lysis_curves package.

Install Package Using PyPi

At the command line, run

pip install lysis-curve

Running (in Jupyter or at command line)

First, make sure your x-axis (time) data is your zeroth (first) column (this script always plots the first column in the csv file as the x-axis). Next, make sure you save your data in the .csv file format.

Next, navigate to the directory containing your .csv file in Jupyter.

import os
os.chdir('your_path_here')

Next, import the lysis_curve.py file using

from lysis_curve import lysis_curve

Alternatively, copy/paste the file into a jupyter cell from github and you can modify the code yourself.

Generate basic plot

from lysis_curve import lysis_curve

lysis_curve('yourcsvfile.csv')

basic plot

Generate plot with grouping

This argument is useful if you wish to visually group your data by color. It automatically sets each line in each group the same color, but assigns them different markers. Does not work with subplots. Pass the argument to group as a list of strings, with each column in a group separated by vertical bars.

lysis_curve('122120JSC.csv',
           title='Title Goes Here',
           group = ['1', '4','3|5'],
           annotate=True)

basic_plot_with_grouping

Generate plot with annotations

Use the argument annotations=True and follow the prompts.

Generate plot with subplots

Use the argument subplots=True to split your data into subplots.

lysis_curve('051321JSC.csv',
           title='Title Goes Here',
           subplots=True)

basic_plot_with_subplots

Generate plot with custom title

Use the argument title='Your Custom Title Here' By default, the title will be taken from your csv file name - thus 'yourcsvfile' if 'yourcsvfile.csv' is passed.

Pass custom colors

lysis_curve('yourcsvfile.csv', colors=['red', 'blue', 'blah'])

Save as .png

Set the argument png=True and the function will generate a .png file of the graph in your current directory.

Save as .svg

Set the argument svg=True and the function will generate a .svg file of the graph in your current directory. Requires Kaleido or Orca

Save .png, .svg and legendless .svg

save=True Saves three versions of the graph: (1) a .png version with a legend (2) a .svg version with a legend (3) a .svg version without a legend and square dimensions

Dependencies

  • Python 3.5+
  • Pandas pip install pandas
  • Plotly pip install plotly
  • Requests pip install requests
  • Kaleido pip install kaleido (Kaleido is recommended over Orca according to Plotly)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lysis_curve-1.12.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

lysis_curve-1.12-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file lysis_curve-1.12.tar.gz.

File metadata

  • Download URL: lysis_curve-1.12.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.4

File hashes

Hashes for lysis_curve-1.12.tar.gz
Algorithm Hash digest
SHA256 b9d17caf9f7d005ddf5901a426158af2dff07a6f1ea62caf04db523855e9967e
MD5 291ce95d4978a834a4cd1e4cfe9bd079
BLAKE2b-256 af5461bb6d3051248de152a826e9ceeca70eda1f424af5b718cb688ad17a5dcf

See more details on using hashes here.

File details

Details for the file lysis_curve-1.12-py3-none-any.whl.

File metadata

  • Download URL: lysis_curve-1.12-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.4

File hashes

Hashes for lysis_curve-1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 727152c9287e9e8cc6a5e05f5d38bba003af21852dbb6aad8dcb8b03cf36cee5
MD5 1d84fd2e26b5cf79f51595214cad7be0
BLAKE2b-256 9029b4a2ebaabd7a7bc5cac1f23b3099c104c76f0d1864b61012b9e0827baf42

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page