Running Micrompn from https://github.com/USDA-ARS-GBRU/micrompn

How to run micrompn from a jupyter notebook: 1) check file locations

2) create a toml file in notepad (save it as microplate.toml)

3) install and import wellmap https://wellmap.readthedocs.io/en/latest/index.html

4) check the toml file with wellmap.show()

5) download the micrompn files from github and make a local copy. Extract all to run micrompn https://github.com/USDA-ARS-GBRU/micrompn

6) install micrompn using pip install path/to/micrompnm

7) import micrompn

8) ! micrompn --help for more options

pip install wellmap

I will run this first trial with data for C1-C3 and rfp-Rs5 control from time point 48 h filename:Copy_of_original_T48.CSV

In [1]:
import wellmap
In [8]:
wellmap.show("microplate_384_4_samples_horizontal_dilutions.txt")#prints two versions of the same image (png, img)
Out[8]:
In [6]:
import micrompn
In [7]:
! micrompn --help
usage: micrompn [-h] --wellmap WELLMAP --data DATA --cutoff CUTOFF --outfile
                OUTFILE [--plate_name PLATE_NAME] [--value_name VALUE_NAME]
                [--well_name WELL_NAME] [--col_name COL_NAME]
                [--row_name ROW_NAME] [--zero_padded] [--trim_positives]
                [--version] [--logfile LOGFILE]

MicroMPN: Software to estimate Most Probable Number (MPN) bacterial abundance
from microplates

optional arguments:
  -h, --help            show this help message and exit
  --wellmap WELLMAP     A TOML file with plate layout specified in wellmap
                        format
  --data DATA           A csv file or a directory containing csv files with
                        the plate name, optical value, and well or row and
                        column data
  --cutoff CUTOFF       The value from the plate reader above which a well is
                        classified as positive
  --outfile OUTFILE     The file path and name for the results
  --plate_name PLATE_NAME
                        The name of the column containing the plate identifier
                        in the data file
  --value_name VALUE_NAME
                        The name of the column containing the optical signal
                        column in the data file
  --well_name WELL_NAME
                        The name of the column containing the well identifier
                        in the data file
  --col_name COL_NAME   The name of the column containing the plate column
                        identifier in the data file
  --row_name ROW_NAME   The name of the column containing the plate row
                        identifier in the data file
  --zero_padded         If present, the well value in the data file is treated
                        as zero-padded, e.g. A01
  --trim_positives      If present, the list of positive wells will be trimmed
                        to the most dilute all positive dilution and the least
                        dilute all negative dilution. This helps if early
                        dilutions are turbid.
  --version, -v         show program's version number and exit
  --logfile LOGFILE, -l LOGFILE
In [4]:
! micrompn -v
micrompn (0.1)

The cutoff value = (mean RFU T0) + (5*SD). For limit of detection the cutoff was 5.598597652

microplate_384_4_samples_horizontal_dilutions

In [12]:
! micrompn --wellmap microplate_384_4_samples_horizontal_dilutions.txt --data "path_to_files\384_4_samples_horizontal_dilutions.csv" --cutoff 6 --outfile "path_to_files\OUTFILE_384_4_samples_horizontal_dilutions.csv" --plate_name "plate_unique" --value_name "rfu" --well_name "plate_well" --trim_positives
#this is a mock dataset 
2023-06-09 11:27:27,321 root         INFO     Starting microMPN
2023-06-09 11:27:27,322 root         INFO     Input parameters and arguments for the run:
2023-06-09 11:27:27,322 root         INFO     Namespace(col_name=None, cutoff=6.0, data='path_to_files\\384_4_samples_horizontal_dilutions.csv', logfile='micrompn.log', outfile='path_to_files\\OUTFILE_384_4_samples_horizontal_dilutions.csv', plate_name='plate_unique', row_name=None, trim_positives=True, value_name='rfu', well_name='plate_well', wellmap='microplate_384_4_samples_horizontal_dilutions.txt', zero_padded=False)
2023-06-09 11:27:27,326 root         INFO     Importing data from microplate_384_4_samples_horizontal_dilutions.txt and path_to_files\384_4_samples_horizontal_dilutions.csv
2023-06-09 11:27:27,362 numexpr.utils INFO     Note: NumExpr detected 12 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
2023-06-09 11:27:27,362 numexpr.utils INFO     NumExpr defaulting to 8 threads.
2023-06-09 11:27:27,483 root         INFO     Completed MPN estimation. Results are in path_to_files\OUTFILE_384_4_samples_horizontal_dilutions.csv
In [ ]: