Exemplo n.º 1
0
#computes the global minimum over a set of two dimensional arrays (stored as files)
def timemin(protein):
    return min([v.min() for v in protein])

proteinList = ["nADP","nATP","ND","NDE","nE"]
proteinLabels = ["MinD:ADP (cyto)",
                 "MinD:ATP (cyto)",
                 "MinD:ATP (mem)",
                 "MinE:MinD:ATP (mem)",
                 "MinE (cyto)"]

proteins = [0]*len(proteinList)

for i in range(len(proteinList)):
    proteins[i] = load.data(proteinList[i],start_time,end_time)

plt.figure(figsize=(9,3.5))
numtimes = int(end_time/dump_time_step)- int(start_time/dump_time_step)
numproteins = len(proteins)
skip_times = 2 # only plot every skip_times of the snapshots
dZ = proteins[0].datashape[1]*1.05
dY = proteins[0].datashape[0]*1.1/skip_times
kvals = range(0, int(end_time/dump_time_step)-int(start_time/dump_time_step), skip_times)

#axes = plt.subplot(1, 1, 1, axisbg='black')

for i in range(len(proteins)):
    if (proteinList[i]=="ND" or proteinList[i]=="NDE"):
        maxval = timemax(proteins[i].dataset)/4
    else:
Exemplo n.º 2
0
from __future__ import division
import matplotlib.pyplot as plt
import numpy as np
import sys
import file_loader as load

f_shape = sys.argv[1]
f_param1 = sys.argv[2]
f_param2 = sys.argv[3]
f_param3 = sys.argv[4]
f_param4 = sys.argv[5]
f_param5 = sys.argv[6]

natp = load.data(protein="natp")
ne = load.data(protein="ne")
nadp = load.data(protein="nadp")
nd = load.data(protein="nd")

areaFname = "data/shape-" + f_shape + "/area_rating_two-" + f_param1 + "-" + f_param2 + "-" + f_param3 + "-" + f_param4 + "-" + f_param5 + ".dat"
areaFile = np.loadtxt(areaFname, dtype=float)


def splitdata(protein):
    areaFname = "data/shape-" + f_shape + "/area_rating_two-" + f_param1 + "-" + f_param2 + "-" + f_param3 + "-" + f_param4 + "-" + f_param5 + ".dat"
    areaFile = np.loadtxt(areaFname, dtype=float)

    proteinFname = "data/shape-" + f_shape + "/" + str(
        protein.protein
    ) + "-avg_density-" + f_shape + "-" + f_param1 + "-" + f_param2 + "-" + f_param3 + "-" + f_param4 + "-" + f_param5 + ".dat"
    proteinFile = np.loadtxt(proteinFname, dtype=float)
Exemplo n.º 3
0
#computes the global minimum over a set of two dimensional arrays (stored as files)
def timemin(protein):
    return min([v.min() for v in protein])


proteinList = ["nADP", "nATP", "ND", "NDE", "nE"]
proteinLabels = [
    "MinD:ADP (cyto)", "MinD:ATP (cyto)", "MinD:ATP (mem)",
    "MinE:MinD:ATP (mem)", "MinE (cyto)"
]

proteins = [0] * len(proteinList)

for i in range(len(proteinList)):
    proteins[i] = load.data(proteinList[i], start_time, end_time)

plt.figure(figsize=(9, 3.5))
numtimes = int(end_time / dump_time_step) - int(start_time / dump_time_step)
numproteins = len(proteins)
skip_times = 2  # only plot every skip_times of the snapshots
dZ = proteins[0].datashape[1] * 1.05
dY = proteins[0].datashape[0] * 1.1 / skip_times
kvals = range(
    0,
    int(end_time / dump_time_step) - int(start_time / dump_time_step),
    skip_times)

#axes = plt.subplot(1, 1, 1, axisbg='black')

for i in range(len(proteins)):
Exemplo n.º 4
0
elif load.f_shape == 'stad':
    if f_param2 == '2.35':
        time_stochastic_is_behind = 23.0
    if f_param2 == '2.92':
        time_stochastic_is_behind = 12.0
else:
    print 'soemthigns wrong!'
    exit(1)

while (time_left > 0):
    next_end_time = input_start_time + (video_number+1)*video_limit
    if next_end_time > input_end_time:
        next_end_time = input_end_time
    print "next_end_time = ",next_end_time
    full_video_list = full_video_list + [load.data(protein=protein_name, sim_type='full_array', \
                                                       start_time = time_stochastic_is_behind + input_start_time + video_number*video_limit, \
                                                       end_time = time_stochastic_is_behind + next_end_time)]
    exact_video_list = exact_video_list + [load.data(protein=protein_name, sim_type='exact',start_time = input_start_time + video_number*video_limit,
                                         end_time = next_end_time)]
    print 'e',next_end_time
    print 's',input_start_time
    print ''
    time_left -= video_limit
    video_number += 1


# for lis in full_video_list:
#     print lis.dataset.shape
#     for vid in lis.dataset:
#         print vid[3]
#         #for line in vid:
Exemplo n.º 5
0
    print "For ", fname
    print "This end_time is too great, there are only enough files to support a end_time less than ", total_number_of_files*dump_time_step
    exit(1)


time_left = input_end_time - input_start_time
video_limit = 2 #time of each gif created
video_list = []#list of video_limit long movies
video_number = 0

while (time_left > 0):
    next_end_time = input_start_time + (video_number+1)*video_limit
    if next_end_time > input_end_time:
        next_end_time = input_end_time
    print "next_end_time = ",next_end_time
    video_list = video_list + [load.data(protein=protein_name, sim_type=sim_type,start_time = input_start_time + video_number*video_limit,
                                         end_time = next_end_time)]
    time_left -= video_limit
    video_number += 1

print "video number = ",video_number
print "time left = ",time_left
print "size video_list = ",len(video_list)

#  NflE = load.data(protein="NflE")
# nATP = load.data(protein="nATP")
# nE = load.data(protein="nE")
# nADP = load.data(protein="nADP")
# ND = load.data(protein="ND")
# NDE = load.data(protein="NDE")

Exemplo n.º 6
0
from __future__ import division
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os
import sys
import time
import file_loader as load

#create data objects (see file_loader.py)
NflE = load.data(protein="NflE")
NflD = load.data(protein="NflD")
nATP = load.data(protein="nATP")
nE = load.data(protein="nE")
nADP = load.data(protein="nADP")
ND = load.data(protein="ND")
NDE = load.data(protein="NDE")

f_shape = sys.argv[1]
f_param1 = sys.argv[2]
f_param2 = sys.argv[3]
f_param3 = sys.argv[4]
f_param4 = sys.argv[5]
f_param5 = sys.argv[6]

#computes the maximum of a two dimensional array - REPLACE with method
def maxnum(page):
    Z = [0. for i in range(page.shape[0])]
    for i in range(page.shape[0]):
        Z[i] = max(page[i])
Exemplo n.º 7
0
        max_y = 0
        for x in range(max_data.shape[0]):
            for y in range(max_data.shape[1]):
                if max_data[x,y] > maxima:
                    maxima = max_data[x,y]
                    max_x = x
                    max_y = y
        p_file.write('%g %g %g %g\n'%(input_start_time+num*dump_time_step,maxima,max_x,max_y))
        if (num%20 == 0 and num > 1):
            contour_values = job_string +'ave-time/contour-values-' + str(protein) +'-'+ str(int(input_start_time))+'-' \
                +str(int(input_start_time+num*dump_time_step))+'.dat'
            unsmeared_values = job_string +'ave-time/unsmeared-values-' + str(protein) +'-'+ str(int(input_start_time))+'-' \
                +str(int(input_start_time+num*dump_time_step))+'.dat'
            print contour_values
            c_file = open(contour_values,'w')
            unsmeared_file = open(unsmeared_values,'w')
            for x in range(new.shape[0]):
                for y in range(new.shape[1]):
                    c_file.write("%g "%(new[x,y]/num/dx**2))
                    unsmeared_file.write("%g "%(unsmeared[x,y]/num/dx**2))
                c_file.write('\n')
                unsmeared_file.write('\n')
            c_file.close()
            unsmeared_file.close()
    p_file.close()
    return new/data.shape[0]


data = load.data(protein=protein_name, sim_type=sim_type,start_time = input_start_time, end_time = input_end_time)
smeared_data = gaussian_smear(data.dataset,.509,data.protein) #this is in microns green light at 500nm,
Exemplo n.º 8
0
f_shape = sys.argv[1]
f_param1 = sys.argv[2]
f_param2 = sys.argv[3]
f_param3 = sys.argv[4]
f_param4 = sys.argv[5]
f_param5 = sys.argv[6]

par1 = str(int(10*(float(f_param1))))
par2 = str(int(10*(float(f_param2))))
par3 = str(int(10*(float(f_param3))))
par4 = str(int(10*(float(f_param4))))
par5 = str(int(10*(float(f_param5))))


NflE = load.data(protein="NflE")
NflD = load.data(protein="NflD")
nATP = load.data(protein="nATP")
nE = load.data(protein="nE")
nADP = load.data(protein="nADP")
Nd = load.data(protein="Nd")
Nde = load.data(protein="Nde")

mid = False
if "-mid" in sys.argv:
    mid = True
    print "The -mid flag was set so we'll add the middle point data to the plot"

norm = False
if "-norm" in sys.argv:
    norm = True
Exemplo n.º 9
0
from __future__ import division
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import file_loader as load
import sys

#create protein data objects (see file_loader.py)
NflE = load.data(protein="NflE")
NflD = load.data(protein="NflD")
nATP = load.data(protein="nATP")
nE = load.data(protein="nE")
nADP = load.data(protein="nADP")
Nd = load.data(protein="Nd")
Nde = load.data(protein="Nde")

#compute time average (removing first 10% happens in file loading)
def average_location(dataset):
    tsum = np.zeros_like(dataset[0])
    for t in range(nATP.tsteps):
            tsum += dataset[t]
    return tsum/(nATP.tsteps)

#plot each of the data set time maps individually.
for p in [NflE, NflD, nATP, nE, nADP, Nd]:
    plt.figure()
    plt.contourf(p.axes[0],p.axes[1],average_location(p.dataset),500)
    plt.axes().set_aspect('equal', 'datalim')
    plt.colorbar()
    plt.savefig(load.print_string("time-map",p))
Exemplo n.º 10
0
from __future__ import division
import matplotlib.pyplot as plt
import numpy as np
import sys
import file_loader as load

f_shape = sys.argv[1]
f_param1 = sys.argv[2]
f_param2 = sys.argv[3]
f_param3 = sys.argv[4]
f_param4 = sys.argv[5]
f_param5 = sys.argv[6]

natp = load.data(protein="natp")
ne = load.data(protein="ne")
nadp = load.data(protein="nadp")
nd = load.data(protein="nd")

areaFname = (
    "data/shape-"
    + f_shape
    + "/area_rating_two-"
    + f_param1
    + "-"
    + f_param2
    + "-"
    + f_param3
    + "-"
    + f_param4
    + "-"
    + f_param5