Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fZebrafish somitogenesis simulation
wfZebrafish somitogenesis simulation
==================================

Table of contents
Expand Down
141 changes: 141 additions & 0 deletions README_2017.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@

********************
This is a readme file for 2017 segmentation clock project
It contains information about how to complie, run simulation and use plotting scripts

0. Copy everthing onto cluster

1. To compile:
1.1
--- simulation:
cd into simulation folder
call scons
1.2
--- sres:
cd into sres folder
for parallel sres: scons mpi=1


2. To run:
on CPU:
./simulation -x 50 -w 10 -y 4 -i 2017refine2.params -s 1000 -S 0.01 -V 600 -Y 600 -Z 600 -Q 600 -K 600 -r gradient1.txt -u pert.txt -t -D output -L 1

call this line for a normal simulation
for more details, refer to the general readme file.



on Cluster:
use qsub sres.run (sres.run - sres5.run)
change test name, output file name and ranges file accordingly



3.

3.1
Use extract_para_set.py to extraction all parameter sets from the output above.
example:
python extract_para_sets.py ./s51.txt ./ test1 0.0075
details can be found in extract_para_sets.py

3.2
****
NOTE: need to rm features.txt under simulation folder everytime before you run this step.
****
For a certain parameter, run it using code from 2. on CPU on cluster (Mac and cluster have different outputs)
To run multiple sets, use -p flag
(remember change .params to the output file in 3.1)
Outputs will be written in features.txt under the same directory as simulation


NOTE: need to rm features.txt under simulation folder everytime before you run this step.


3.3
Use scp to copy features.txt from cluster to local

Convert features.txt to features.csv using the following command line:

python feature_to_csv.py features.txt

New features.csv will be written in the same directory







4.

Use scripts to plot



For 4.1 and 4.2,
Make sure wanted concentration levels are output to file (to change species, change code in mutant create in init.cpp)
——————————————————————————————————————————————
4.1
plot mh1 synchronization

python plot-snap-sync.py ../simulation/output/wildtype/set_0.cons ./check wt_sync_mh1 0.01 600
——————————————————————————————————————————————
4.2
plot mh1 vs. mespa/mespb complementary

python plot-snap-comp.py ../simulation/output/wildtype/set_0.cons ../simulation/output/MESPAOVER/set_0.cons ./check compl-mh1-mespa 0.01 600
python plot-snap-comp.py ../simulation/output/wildtype/set_0.cons ../simulation/output/MESPBOVER/set_0.cons ./check compl-mh1-mespb 0.01 600





——————————————————————————————————————————————

NOTE:



——————————————————————————————————————————————
4.3
plot mh1 synchronization bar graph
column 8, 4 ,16

python plot-bar-sync_mh1.py ./check sync_score_mh1
——————————————————————————————————————————————
4.4
plot mesp synchronization bar graph
column 11, 15, 19

python plot-bar-sync_mesp.py ./check sync_score_mesp
——————————————————————————————————————————————
4.5
plot her1 mRNA amplitude (WT/Delta, WT/DAPT) bar graph
column 9,17

python plot-bar-amp_mh1-5 ./check amp_score_mh1
——————————————————————————————————————————————
4.6
plot mespa amplitude comparison (WT/Delta, WT/DAPT) bar graph
column 10, 18

python plot-bar-amp-mmespa-5 ./check amp_score_mespa
——————————————————————————————————————————————
4.7
plot mespb mRNA in Mespa/Mespb amplitude
column 20, 21

python plot-bar-amp-mesp-1.py ./check amp_score_mesp-1
——————————————————————————————————————————————
4.8
plot wildtype/her1over mRNA amplitude
column 12,13,14

python plot-bar-amp-her1over-1.py ./ testing features.csv






Binary file modified scripts/.DS_Store
Binary file not shown.
56 changes: 56 additions & 0 deletions scripts/2017refine3.params

Large diffs are not rendered by default.

Binary file added scripts/check/.DS_Store
Binary file not shown.
Binary file added scripts/check/amp_socre_1.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 scripts/check/amp_socre_mesp-1.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 scripts/check/amp_socre_mespa.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 scripts/check/amp_socre_mh1.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 scripts/check/compl-mh1-mespa.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 scripts/check/compl-mh1-mespb.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 scripts/check/sync_socre_mesp.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 scripts/check/sync_socre_mh1.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 removed scripts/check/test.png
Binary file not shown.
Binary file removed scripts/check/wt_her1sync.png
Binary file not shown.
Binary file removed scripts/check/wt_mespbsync.png
Binary file not shown.
Binary file added scripts/check/wt_sync_mh1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions scripts/extract_para_sets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

import numpy
import scipy
import pylab as pl
import time
from time import clock
from scipy.stats.stats import pearsonr
import sys
import shared
def main():
# check the given arguments
if len(sys.argv) < 5:
usage()
else:
f = shared.openFile(sys.argv[1], "r")
directory = sys.argv[2]
image_name = sys.argv[3]
threshold = shared.toFlo(sys.argv[4])

print 'Extrating all parameter sets with score less than ' + str(threshold) +' from ' + sys.argv[1]
fw = shared.openFile(directory+image_name+'.txt', 'w')

first_line = True
para_count = 0
current_set = ''

data = [line.split() for line in f]
for line in range(len(data)):

if 'generation:' in data[line] and 'best' in data[line] and 'fitness:' in data[line]:
fitness = float(data[line][-1])
if fitness <= threshold:
if not current_set== data[line+1][2]:
current_set = data[line+1][2]

if not first_line:
fw.write('\n')
fw.write(current_set)
first_line = False
para_count+=1
print 'All parameter sets below threshold are saved into '+ directory + image_name+ '.txt'
f.close()
fw.close()


def usage():
print "Usage: python extract_para_sets.py <file with parameter sets> <directory to store extracted parameters> <file name> <threshold for fitness score>"
exit(0)

main()

47 changes: 47 additions & 0 deletions scripts/feature_to_csv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import numpy
import scipy
import pylab as pl
import time
from time import clock
from scipy.stats.stats import pearsonr
import sys
import shared
import struct
import csv


def main():
# check the given arguments
with open(sys.argv[1]) as f, open('features.csv', 'w') as fw:
fw = csv.DictWriter(fw, ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21'])
fw.writeheader()
for line in f:

line = line.split()
#print len(line)
fw.writerow({'1':line[0],
'2':line[1],
'3':line[4],
'4':line[5],
'5':line[6],
'6':line[7],
'7':str(line[2])+"/"+str(line[3]),
'8':line[8],
'9':str(line[9])+"/"+str(line[10]),
'10':str(line[11])+"/"+str(line[12]),
'11':line[13],
'12':str(line[14])+"/"+str(line[15]),
'13':str(line[16])+"/"+str(line[17]),
'14':str(line[18])+"/"+str(line[19]),
'15':line[20],
'16':line[21],
'17':str(line[22])+"/"+str(line[23]),
'18':str(line[24])+"/"+str(line[25]),
'19':line[26],
'20':str(line[27])+"/"+str(line[28]),
'21':str(line[29])+"/"+str(line[30])})
#0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#28.2708 1 30.3207 28.2708 0 0.8134 -0.540569 -0.689723 0.105733 104.724 124.619 0 127.607 0.403748 14.2342 104.657 1.22888 38.6712
#18 19 20 21 22 23 24 25 26 27 28 29 30
#27.1467 91.2622 0.487785 0.334792 101.69 123.696 0.00204714 118.191 0.18401 27.5067 114.584 19.3371 114.584
main()
Loading