Skip to main content

Lysis curve package

Project description

lysis_curve.py (deprecated)

This function generates automated lysis curves (OD curves) for bacteriophage research via plotly. It can also split a spaghetti lineplot into up to 9 subplots.

lysis_curve_pub.py

This variant generates automated OD curves with modifications with a more professional (less Plotly) styling more suitable for publication. Dynamic interaction with the plots is sometimes buggy due to an issue on Plotly's end.

Running in Jupyter

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. Finally, navigate to the directory containing your .csv file in Jupyter.

import os
os.chdir('your_path_here')

Next, import the lysis_curve.py file or just copy/paste it into a jupyter cell and execute.

Generate basic plot

This basic plot is good for cases where you do not wish to visually group your data

lysis_curve('yourcsvfile.csv')

Generate plot with subplots

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

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('yourcsvfile.csv', group=['1', '2|3', '4|5', '6|7|8'])

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.

Generate plot with annotations

Use the argument annotations=True and follow the prompts.

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-0.11.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

lysis_curve-0.11-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lysis_curve-0.11.tar.gz
  • Upload date:
  • Size: 3.0 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-0.11.tar.gz
Algorithm Hash digest
SHA256 e25cbaa9e0ba3186450a114e92bf77c56f45edfe6e4b0f9b902cb5c5a6db4bab
MD5 424a621e52507b0db7a9a043f589933c
BLAKE2b-256 f187bab3fda2dc80e7913a7161f1feed9efb97958cb6a642afceb50e12d05aa5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lysis_curve-0.11-py3-none-any.whl
  • Upload date:
  • Size: 5.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-0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 e91870aefaea897b1e2e47caf1926318d3969a3a94ac50b6d1877d2610d17d9b
MD5 6b78b40f2f9adf8c2c40cbd4cd28e78b
BLAKE2b-256 819c038d49b9c92a4650acf871caa98e5777b4926b0ea86250349fe147eac046

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