Skip to content

Commit

Permalink
Merge pull request #19 from ekwan/working
Browse files Browse the repository at this point in the history
Added RecipeStep.dataframe to User's Guide
  • Loading branch information
JMarvi3 authored Jun 20, 2024
2 parents fc3dee1 + 20147b3 commit 2fef58c
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 2 deletions.
Binary file added docs/source/images/plate_dataframe_10uL.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/plate_dataframe_3uL.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/plate_dataframe_7uL.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/plate_dataframe_water_umol.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions docs/source/users_guide/working_with_recipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,43 @@ This transfer works because both plates are 8x12.

.. figure:: /images/plate2.png

Extracting data from RecipeSteps
""""""""""""""""""""""""""""""""

After baking, a recipe has a list of steps. You can extract data from these steps using `RecipeStep.dataframe()`

During the second step, 10 uL of water is transferred from the water_stock container to plate1.

Let's demonstrate how to extract the data from this step:

>>> recipe.steps[1].dataframe(data_source='destination', mode='final', unit='uL')

.. figure:: /images/plate_dataframe_10uL.png
:scale: 50%

In the third step, 3 uL of water is transferred from plate1 to plate2.

You can get the volume of each well in the source plate after the step:

>>> recipe.steps[2].dataframe(data_source='source', mode='final', unit='uL')

.. figure:: /images/plate_dataframe_7uL.png
:scale: 50%

You can also get the volume of each well of the destination plate after the step:

>>> recipe.steps[2].dataframe(data_source='destination', mode='final', unit='uL')

.. figure:: /images/plate_dataframe_3uL.png
:scale: 50%

We can query the amount of specific substances added in each step:

>>> recipe.steps[2].dataframe(data_source='destination', mode='delta', substance=water, unit='umol')

.. figure:: /images/plate_dataframe_water_umol.png
:scale: 50%

.. _cross_coupling_liquid_handling:

Using Source Plates
Expand Down
6 changes: 4 additions & 2 deletions pyplate/pyplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1801,10 +1801,12 @@ def dataframe(self, data_source: str = 'destination', substance: str | Substance
before = before.dataframe(substance=substance, unit=unit).data
after = after.dataframe(substance=substance, unit=unit).data

precision = config.precisions[unit] if unit in config.precisions else config.precisions['default']

if mode == 'final':
return after
return after.round(precision)
elif mode == 'delta':
return after - before
return (after - before).round(precision)
else:
raise ValueError("Invalid mode.")

Expand Down

0 comments on commit 2fef58c

Please sign in to comment.