Biomathhh
Welcome to Biomathhh
Biomathhh is a Python package that provides simple, well tested functions for common biological calculations. Below you will find a quick start on how to use the package functions.
Installation
pip install git+https://github.com/UBC-MDS/DSCI_524_group27_biomathhh.gitQuick Start
Here are examples of how to use each function:
Calculate Dilution
Computes the final concentration of a solution after dilution using the standard laboratory equation
from biomathhh.dilution import calculate_dilution
final_conc = calculate_dilution(
stock_concentration=5.0,
stock_volume=1.0,
final_volume=5.0
)
print(final_conc)Output:
1.0Exponential Growth
Calculates how a quantity grows or decays over time assuming continuous exponential change.
from biomathhh.exponential_growth import exponential_growth
value = exponential_growth(100, 0.05, 10)
print(round(value, 6))Output:
164.872127pH Calculation
Calculate pH scale for a given hydronium concentration
from biomathhh.pH_scale import calculate_pH
hydronium_concentration = 1e-4
ph_value = calculate_pH(hydronium_concentration)
print(ph_value)Output:
4.0Shannon-Wiener Diversity Index
The Shannon Wiener index quantifies species diversity by accounting for both species richness and evenness.
from biomathhh.sw_diversity_index import sw_diversity_index
species_counts = [50, 30, 20]
diversity_index = sw_diversity_index(species_counts)
print(diversity_index)Output:
1.0297