Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add example sequential titration assay data #126

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"url": "https://drive.google.com/open?id=1S3vW12yoHmg4dV2Gco6dwx7lkPh-qGjztDn1L69WnvQ", "doc_id": "1S3vW12yoHmg4dV2Gco6dwx7lkPh-qGjztDn1L69WnvQ", "email": "[email protected]"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Generate Numpy array of stated ligand concentration(Lstated) for logarithmic dilution along a row.
#
# Example output:
# np.array([20.0e-6,9.15e-6,4.18e-6,1.91e-6,0.875e-6,0.4e-6,0.183e-6,0.0837e-6,0.0383e-6,0.0175e-6,0.008e-6,0.0001e-6], np.float64)
#
# Usage:
# python calculate_Lstated_array.py --n_wells 12 --h_conc 8e-06 --l_conc 2.53e-09 --dilution logarithmic
# python calculate_Lstated_array.py --n_wells 6 --h_conc 100 --l_conc 10 --dilution linear


from __future__ import print_function, division
import numpy as np
import argparse
import sys

# Argument parser
parser = argparse.ArgumentParser(prog="calculate_Lstated_array")
parser.add_argument("--n_wells", dest="n_wells", help="Enter target number of different concentrations.", type=int)
parser.add_argument("--h_conc", dest= "highest_conc", help="The highest concentration in the series (Unit: M).", type=float)
parser.add_argument("--l_conc", dest="lowest_conc", help="The lowest concentration in the series (Unit: M).", type=float)
parser.add_argument("--dilution", dest="dilution_method", help="Defines logarithmic or linear dilution.Enter 'logarithmic' or 'linear.'.", type=str)
args = parser.parse_args()

n = args.n_wells
print("Number of wells: ", n)
highest_conc = args.highest_conc
print("Highest concentration (M): ", highest_conc)
lowest_conc = args.lowest_conc
print("Lowest concentration (M): ", lowest_conc)
dilution_method = args.dilution_method
print("Dilution method is {}.".format(dilution_method))


if dilution_method == "logarithmic":

# Calculate dilution factor
DF = (highest_conc / lowest_conc)**(1.0/(n-1))
print("Dilution factor: {}".format(DF))

# Calculate concentration of solute in each well
Ltot = np.zeros(n)
for i, conc in enumerate(Ltot):
Ltot[i] = highest_conc/(DF**i)

elif dilution_method == "linear":

# Calculate interval, i.e. concentration difference between consecutive dilution points
interval = (highest_conc - lowest_conc)/(n-1)
print("Linear concentration interval(M): {} ".format(interval) )

# Calculate linear dilution array
Ltot = np.zeros(n)
for i, conc in enumerate(Ltot):
Ltot[i] = highest_conc - i*interval

else:

sys.exit("Error in --dilution argument! It must be specified as '--dilution linear' or '--dilution logarithmic' .")


# Create a string that codes for Lstated array:
array_string = "np.array(["
for i in range(n-1):
array_string = array_string + str(Ltot[i]) + ","
array_string = array_string + str(Ltot[n-1]) + "], np.float64)"

# Print with matching format for input.py file
print("Copy this line to Lstated section of assaytools input.py file: ")
print(array_string)

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions examples/sequential-titration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Sequential titration assay example

This directory contains data from a sequential titration assay conducted by Mehtap Isik, Chodera lab.

More details forthcoming.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"url": "https://drive.google.com/open?id=1S3vW12yoHmg4dV2Gco6dwx7lkPh-qGjztDn1L69WnvQ", "doc_id": "1S3vW12yoHmg4dV2Gco6dwx7lkPh-qGjztDn1L69WnvQ", "email": "[email protected]"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Generate Numpy array of stated ligand concentration(Lstated) for logarithmic dilution along a row.
#
# Example output:
# np.array([20.0e-6,9.15e-6,4.18e-6,1.91e-6,0.875e-6,0.4e-6,0.183e-6,0.0837e-6,0.0383e-6,0.0175e-6,0.008e-6,0.0001e-6], np.float64)
#
# Usage:
# python calculate_Lstated_array.py --n_wells 12 --h_conc 8e-06 --l_conc 2.53e-09 --dilution logarithmic
# python calculate_Lstated_array.py --n_wells 6 --h_conc 100 --l_conc 10 --dilution linear


from __future__ import print_function, division
import numpy as np
import argparse
import sys

# Argument parser
parser = argparse.ArgumentParser(prog="calculate_Lstated_array")
parser.add_argument("--n_wells", dest="n_wells", help="Enter target number of different concentrations.", type=int)
parser.add_argument("--h_conc", dest= "highest_conc", help="The highest concentration in the series (Unit: M).", type=float)
parser.add_argument("--l_conc", dest="lowest_conc", help="The lowest concentration in the series (Unit: M).", type=float)
parser.add_argument("--dilution", dest="dilution_method", help="Defines logarithmic or linear dilution.Enter 'logarithmic' or 'linear.'.", type=str)
args = parser.parse_args()

n = args.n_wells
print("Number of wells: ", n)
highest_conc = args.highest_conc
print("Highest concentration (M): ", highest_conc)
lowest_conc = args.lowest_conc
print("Lowest concentration (M): ", lowest_conc)
dilution_method = args.dilution_method
print("Dilution method is {}.".format(dilution_method))


if dilution_method == "logarithmic":

# Calculate dilution factor
DF = (highest_conc / lowest_conc)**(1.0/(n-1))
print("Dilution factor: {}".format(DF))

# Calculate concentration of solute in each well
Ltot = np.zeros(n)
for i, conc in enumerate(Ltot):
Ltot[i] = highest_conc/(DF**i)

elif dilution_method == "linear":

# Calculate interval, i.e. concentration difference between consecutive dilution points
interval = (highest_conc - lowest_conc)/(n-1)
print("Linear concentration interval(M): {} ".format(interval) )

# Calculate linear dilution array
Ltot = np.zeros(n)
for i, conc in enumerate(Ltot):
Ltot[i] = highest_conc - i*interval

else:

sys.exit("Error in --dilution argument! It must be specified as '--dilution linear' or '--dilution logarithmic' .")


# Create a string that codes for Lstated array:
array_string = "np.array(["
for i in range(n-1):
array_string = array_string + str(Ltot[i]) + ","
array_string = array_string + str(Ltot[n-1]) + "], np.float64)"

# Print with matching format for input.py file
print("Copy this line to Lstated section of assaytools input.py file: ")
print(array_string)
Loading