Package: ninetysix
ninetysixA general package for annotating, processing, and visualizing 96-well* plate data.(*n-well, really.)Purposeninetysixprovides a method of combining well-value data pairs and efficiently adding additional information (e.g., controls, well conditions) and processing and visualizing the results.This primarily works via thePlateclass, but visualization tools are available forpandas DataFrameobjects as well throughninetysix.viz.Visit theninetysixGitHub Pages sitefor detailed and interactive examples.Installpip install ninetysixAlthoughjupyter labis not a strict dependency forninetysix, much of the visualization functionality benefits from being run in a notebook. If yourjupyter laband other packages are up to date, the abovepipinstall should suffice. If you have issues, the following conda environment should work:# Create the environment with python and jupyterlab installed
conda create -n ns_env python jupyterlab

# Activate the environment
conda activate ns_env

# Install ninetysix and its dependencies
pip install ninetysix

# Open jupyter lab
jupyter labFeaturesninetysix.PlateThe heart of this package, aPlateobject contains three major groups to describe a well:locations,annotations, andvalues,which are always arrayed in that order.Plateperforms value-oriented operationsThe 'most important' (or perhaps 'most relevant')valueis set as the right-most column in the data, which is automatically used in downstream processing and visualization unless explicitly overwritten, thus saving time needing to specify what data to use during exploratory data analysis.New columns are assumed to be genericannotations, but can be moved tolocationsorvaluesas desired to streamline your processing and analysis (seeExamplesbelow).Plateuses the flexibility of thepandas DataFramePlateobjects have nearly all methods available to aDataFrame(e.g.,merge), but will return aPlateobject when possible.>>>importninetysixasns>>>importpandasaspd>>># Create Plate>>>plate=ns.Plate('example_data.csv')>>># Create DataFrame with only row A and column 'plate'>>>df=pd.DataFrame({...'well':[f'A{i}'foriinrange(1,13)],...'plate':1...})>>># Call `pd.merge` from Plate>>>merged_plate=plate.merge(df)>>># Returned object is a Plate>>>type(merged_plate)ninetysix.plate.PlateThis new plate object will retain the samelocations,annotations, andvaluesattributes.ninetysix.parsers.well_regexDictionaries with key-value pairs that represent a single well and information about it are a powerful way to add information to a plate, but writing 96 key-value pairs is cumbersome. To alleviate this,ninetysixprovideswell_regexin theparsersmodule, which accepts well keys written in a simple regex form and expands them.>>>fromninetysix.parsersimportwell_regex>>>well_info={...'[A-C]10':'control',...'[A,H][1,12]':'empty',...}>>>well_regex(well_info){'A10':'control','B10':'control','C10':'control','A1':'empty','A12':'empty','H1':'empty','H12':'empty'}ninetysix.vizQuick access to scatter charts, plate heatmaps, and aggregated charts are available for bothPlateandDataFrameobjects, leveraging the information encoded in these objects to generate annotated visualizations.These plots are based on theholoviews(http://holoviews.org/) package with thebokehbackend. The chart outputs ofvizcan be further tuned using the tools provided in these packages.Plotting functions are available directly asPlatemethods for an efficient workflow: