Skip to main content

A short description of my package

Project description

worm-imtools

Installation

This package can be installed through pip using:

pip install wormimtools

This should be performed using pip within a conda environment. It can also be built from source and/or modified using this repository.

To upgrade the package through pip, run:

pip install --upgrade wormimtools  

Using worm-imtools

It is highly recommended that this is performed using a jupyter notebook.

Processing

To process a directory like the one created above, import and instantiate a Processor object. The channel_info should be specified as a list of tuples containing your channel names and their indexes (0-based) within the images. You can use up to 4 channels:

from wormimtools import Processor

channel_info = [("{channel 0 name}", 0), ("{channel 1 name}", 1)]

proc = Processor("{path_to_images}", channel_info) 
Additional Args:
Default Values:
group_number = 1  
max_value    = 65535
final_len    = 3500

The Processor class contains 3 key-word arguments which have default values.

group_number is used when multiple groups are contained within a single README. This variable specifies the order of the README. If the group in the directory is second in the README, set this to 2, etc.

max_value is the value that the images are normalized to. It is arbitrary, but it should be set to the max value of the image format (255 for 8bit, 65535 for 16bit, etc.). When performing downstream analysis, the dataset should be normalized to the max value of the entire dataset.

final_len specifies the length all arrays will be interpolated to. It should be set to a value close to the average width of the images to minimize the need for interpolation.

Generating a DataFrame
DataFrame Structure

The generated DataFrame contains the following metadata columns specified in README.txt:

date                            # Date the rep was collected              
strain                          # C. elegans strain used
diet                            # Name of the bacterial diet
temp                            # Temperature worms developed at
rep                             # Rep number
name                            # Relative file name
stage                           # C. elegans developmental stage 
rating                          # Rating of quality of worm
comments                        # Comments given at imaging
ID                              # UUID

It also contains the following data columns for channel i (i = 0,1,2,3):

channel{i}_name                 # Channel i name specified in `channel_info`
channel{i}_arr_vals             # Normalized and interpolated array values
channel{i}_arr_vals_ni          # Normalized array values
channel{i}_arr_vals_raw         # Raw array values

In most cases, the raw array values should be used for downstream analysis.

Barcode Plotting

  1. To create barcode plots of the processed arrays, import and instantiate a BarcodePlotter object:
from wormimtools import BarcodePlotter

plotter = BarcodePlotter()
Single Channel Plotting
data = [["Single Channel"]]    # List of arrays generated by Processor

plotter.plot_barcodes_single(data, save={"save_path"})

The save argument is optional, defaulting to None.

Dual Channel Plotting
data = [[["Channel 0"], ["Channel 1"]]] # List of lists of len=2 with arrays for 2 channels of an image

plotter.plot_barcodes_dual(data)

The save argument is the same as single channel plotting.

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

wormimtools-1.0.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wormimtools-1.0.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file wormimtools-1.0.0.tar.gz.

File metadata

  • Download URL: wormimtools-1.0.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for wormimtools-1.0.0.tar.gz
Algorithm Hash digest
SHA256 748f43bf9f1f53c406f8847528ef043fceb2186ab919b0845bfe6f897b15f3b1
MD5 6ba02f17cf84784129940f394dfbce58
BLAKE2b-256 95754b3441ca7652748f314b143a7b957389f3aa020744b95e9e8bafc4cf242f

See more details on using hashes here.

File details

Details for the file wormimtools-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: wormimtools-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for wormimtools-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 906fe5ae5115799b4f0c6b44fb10cdefe2010346438691f75222d1b0d60ec6e1
MD5 82c75b160e6dc92687f09c27e24fdb93
BLAKE2b-256 d9b3566ee3b2cb32716637fa203cf6d510b11680137af6128dbc613fc57c7c2d

See more details on using hashes here.

Supported by

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