#cp simSCZpop_manipulateOutputOnly_varsize.py simSCZpop_cortical.py
import sys
import os
import pickle
from os.path import exists
from pylab import *
#drawfig_venn: unique([strs_all[i] for i in range(0,len(inperouts_vec)) if inperouts_vec[i][0] >= 1 and inperouts_vec[i][1] >= 1 and inperouts_vec[i][2] >= 1 and inperouts_vec[i][3] >= 1 and NoutputInsides_vec[i][0] >= 32 and NoutputInsides_vec[i][1] >= 32 and NoutputInsides_vec[i][2] >= 32 and NoutputInsides_vec[i][3] >= 32 ])[::-1] gives this:
goodOnes = ['python3 sim_mmns_2pm_sep_noISDIDD_savespikesonly_limtau.py 40 0.3 150 130 17.5 30.0 80.0 5.827500000000001 9.99 26.64 35.0 35.0 1000 0.0 0.95 10.0 10.0 10.0 250.0',
'python3 sim_mmns_2pm_sep_noISDIDD_savespikesonly_limtau.py 40 0.3 150 130 17.5 30.0 80.0 5.827500000000001 9.99 26.64 35.0 35.0 1000 0.0 0.9 10.0 10.0 10.0 250.0',
'python3 sim_mmns_2pm_sep_noISDIDD_savespikesonly_limtau.py 40 0.3 150 130 17.5 30.0 80.0 5.827500000000001 9.99 26.64 30.0 30.0 1000 0.0 0.95 10.0 10.0 10.0 250.0',
'python3 sim_mmns_2pm_sep_noISDIDD_savespikesonly_limtau.py 40 0.3 150 130 17.5 30.0 80.0 5.827500000000001 9.99 26.64 30.0 30.0 1000 0.0 0.9 10.0 10.0 10.0 250.0',
'python3 sim_mmns_2pm_sep_noISDIDD_savespikesonly_limtau.py 40 0.3 150 130 17.5 30.0 80.0 5.827500000000001 9.99 26.64 25.0 25.0 1000 0.0 0.95 10.0 10.0 10.0 250.0',
'python3 sim_mmns_2pm_sep_noISDIDD_savespikesonly_limtau.py 40 0.3 150 130 17.5 30.0 80.0 5.827500000000001 9.99 26.64 25.0 25.0 1000 0.0 0.9 10.0 10.0 10.0 250.0',
'python3 sim_mmns_2pm_sep_noISDIDD_savespikesonly_limtau.py 40 0.3 150 130 17.5 30.0 80.0 5.827500000000001 9.99 26.64 20.0 20.0 1000 0.0 0.9 10.0 10.0 10.0 250.0 ',
'python3 sim_mmns_2pm_sep_noISDIDD_savespikesonly_limtau.py 40 0.3 150 130 17.5 30.0 80.0 5.827500000000001 9.99 26.64 15.0 15.0 1000 0.0 0.95 10.0 10.0 10.0 250.0',
'python3 sim_mmns_2pm_sep_noISDIDD_savespikesonly_limtau.py 40 0.3 150 130 17.5 30.0 80.0 5.827500000000001 9.99 26.64 15.0 15.0 1000 0.0 0.9 10.0 10.0 10.0 250.0',
'python3 sim_mmns_2pm_sep_noISDIDD_savespikesonly_limtau.py 40 0.3 140 120 17.5 30.0 80.0 5.827500000000001 9.99 26.64 35.0 35.0 1000 0.0 0.9 10.0 10.0 10.0 250.0 ',
'python3 sim_mmns_2pm_sep_noISDIDD_savespikesonly_limtau.py 40 0.3 140 120 17.5 30.0 80.0 5.827500000000001 9.99 26.64 30.0 30.0 1000 0.0 0.9 10.0 10.0 10.0 250.0 ',
'python3 sim_mmns_2pm_sep_noISDIDD_savespikesonly_limtau.py 40 0.3 140 120 17.5 30.0 80.0 5.827500000000001 9.99 26.64 10.0 10.0 1000 0.0 0.9 10.0 10.0 10.0 250.0',
'python3 sim_mmns_2pm_sep_noISDIDD_savespikesonly_limtau.py 40 0.3 125 105 17.5 40.0 140.0 5.827500000000001 13.32 46.620000000000005 25.0 25.0 1000 0.0 0.9 10.0 10.0 10.0 250.0',
'python3 sim_mmns_2pm_sep_noISDIDD_savespikesonly_limtau.py 40 0.3 125 105 17.5 40.0 140.0 5.827500000000001 13.32 46.620000000000005 10.0 10.0 1000 0.0 0.9 10.0 10.0 10.0 250.0',
'python3 sim_mmns_2pm_sep_noISDIDD_savespikesonly_limtau.py 40 0.3 125 105 17.5 40.0 100.0 5.827500000000001 13.32 33.300000000000004 25.0 25.0 1000 0.0 0.9 10.0 10.0 10.0 200.0',
'python3 sim_mmns_2pm_sep_noISDIDD_savespikesonly_limtau.py 40 0.3 125 105 17.5 40.0 100.0 5.827500000000001 13.32 33.300000000000004 10.0 10.0 1000 0.0 0.9 10.0 10.0 10.0 200.0']
myseed = 1
Nperpop = 40
paramSD = 0.3
if len(sys.argv) > 1:
myseed = int(sys.argv[1])
if len(sys.argv) > 2:
Nperpop = int(sys.argv[2])
if len(sys.argv) > 3:
paramSD = float(sys.argv[3])
goodOnes_new = []
for igoodOne in range(0,len(goodOnes)):
splitted = goodOnes[igoodOne].replace('sim_mmns_2pm_sep_noISDIDD_savespikesonly_limtau.py 40 0.3','sim_mmns_2pm_sep_noISDIDD_withnoisyfittedcortical_savespikesonly_limtau.py '+str(Nperpop)+' '+str(paramSD)).split(' ')
NMDA_AMPAratio = float(splitted[9])/float(splitted[6])
splitted.insert(9,'3000.0')
splitted.insert(13,str(3000.0*NMDA_AMPAratio))
splitted.insert(23,'580.0')
splitted.insert(24,'1750.0')
goodOnes_new.append(' '.join(splitted))
goodOnes_old = goodOnes[:]
goodOnes = goodOnes_new[:]
def mystr(x):
y = '{:.3f}'.format(x)
while y.find('.') > -1 and y[-1] == '0':
y = y[0:-1]
return y
myseedAdd = '' if myseed == 1 else '_seed'+str(myseed)
areas = ['ACC','PFC','CTRL']
for iarea in [0,1,2]:
area = areas[iarea]
if iarea < 2:
unpicklefile = open('taus_cortical_subjectwise_'+area+'.sav','rb')
unpickledlist = pickle.load(unpicklefile,encoding='bytes')
unpicklefile.close()
tau_interpolated,AUCdata,tau_interpolated_pop,isubjs_HC,isubjs_SCZ = unpickledlist[0],unpickledlist[1],unpickledlist[2],unpickledlist[3],unpickledlist[4]
for imodel in range(0,len(goodOnes)):
attrs = goodOnes[imodel].split(' ')
these_attrs = attrs[:]
if iarea < 2:
mychange = [[[23],mystr(mean([tau_interpolated[i] for i in isubjs_SCZ]))]] #The 23rd attribute is the 800.0 indicating the time constant/membrane capacitance of the cortical population
for ichange in range(0,len(mychange)):
if type(mychange[ichange][0]) is list:
for imany in range(0,len(mychange[ichange][0])):
these_attrs[mychange[ichange][0][imany]] = mychange[ichange][1]
else:
these_attrs[mychange[ichange][0]] = mychange[ichange][1]
this_str = ' '.join(these_attrs)
if not exists('MMNs_2pm_sep_noISDIDD_limtau_Nperpop'+these_attrs[2]+'_paramSD'+these_attrs[3]+'_stimA'+these_attrs[4]+'_'+these_attrs[5]+'_gAMPA'+these_attrs[6]+'_'+these_attrs[7]+'_'+these_attrs[8]+'_'+these_attrs[9]+'_gNMDA'+these_attrs[10]+'_'+these_attrs[11]+'_'+these_attrs[12]+'_'+these_attrs[13]+'_gGABA'+these_attrs[14]+'_'+these_attrs[15]+'_dep'+these_attrs[16]+'_'+these_attrs[17]+'_'+these_attrs[18]+'_tau'+these_attrs[19]+'_'+these_attrs[20]+'_'+these_attrs[21]+'_'+these_attrs[22]+'_'+these_attrs[23]+'_noise'+these_attrs[24]+myseedAdd+'.mat') and not exists('MMNs_2pm_sep_noISDIDD_limtau_withnoisyfittedcortical_Nperpop'+str(Nperpop)+'_SD'+str(paramSD)+'_model'+str(imodel)+'_'+area+'pop_seed'+str(myseed)+'.mat'):
print('MMNs_2pm_sep_noISDIDD_limtau_Nperpop'+these_attrs[2]+'_paramSD'+these_attrs[3]+'_stimA'+these_attrs[4]+'_'+these_attrs[5]+'_gAMPA'+these_attrs[6]+'_'+these_attrs[7]+'_'+these_attrs[8]+'_'+these_attrs[9]+'_gNMDA'+these_attrs[10]+'_'+these_attrs[11]+'_'+these_attrs[12]+'_'+these_attrs[13]+'_gGABA'+these_attrs[14]+'_'+these_attrs[15]+'_dep'+these_attrs[16]+'_'+these_attrs[17]+'_'+these_attrs[18]+'_tau'+these_attrs[19]+'_'+these_attrs[20]+'_'+these_attrs[21]+'_'+these_attrs[22]+'_'+these_attrs[23]+'_noise'+these_attrs[24]+myseedAdd+'.mat and MMNs_2pm_sep_noISDIDD_limtau_withnoisyfittedcortical_Nperpop'+str(Nperpop)+'_SD'+str(paramSD)+'_model'+str(imodel)+'_'+area+'pop_seed'+str(myseed)+'.mat do not exist')
print(this_str+' '+str(myseed))
os.system(this_str+' '+str(myseed))
else:
print('MMNs_2pm_sep_noISDIDD_limtau_Nperpop'+these_attrs[2]+'_paramSD'+these_attrs[3]+'_stimA'+these_attrs[4]+'_'+these_attrs[5]+'_gAMPA'+these_attrs[6]+'_'+these_attrs[7]+'_'+these_attrs[8]+'_'+these_attrs[9]+'_gNMDA'+these_attrs[10]+'_'+these_attrs[11]+'_'+these_attrs[12]+'_'+these_attrs[13]+'_gGABA'+these_attrs[14]+'_'+these_attrs[15]+'_dep'+these_attrs[16]+'_'+these_attrs[17]+'_'+these_attrs[18]+'_tau'+these_attrs[19]+'_'+these_attrs[20]+'_'+these_attrs[21]+'_'+these_attrs[22]+'_'+these_attrs[23]+'_noise'+these_attrs[24]+myseedAdd+'.mat or MMNs_2pm_sep_noISDIDD_limtau_withnoisyfittedcortical_Nperpop'+str(Nperpop)+'_SD'+str(paramSD)+'_model'+str(imodel)+'_'+area+'pop_seed'+str(myseed)+'.mat exists')
print('mv MMNs_2pm_sep_noISDIDD_limtau_Nperpop'+these_attrs[2]+'_paramSD'+these_attrs[3]+'_stimA'+these_attrs[4]+'_'+these_attrs[5]+'_gAMPA'+these_attrs[6]+'_'+these_attrs[7]+'_'+these_attrs[8]+'_'+these_attrs[9]+'_gNMDA'+these_attrs[10]+'_'+these_attrs[11]+'_'+these_attrs[12]+'_'+these_attrs[13]+'_gGABA'+these_attrs[14]+'_'+these_attrs[15]+'_dep'+these_attrs[16]+'_'+these_attrs[17]+'_'+these_attrs[18]+'_tau'+these_attrs[19]+'_'+these_attrs[20]+'_'+these_attrs[21]+'_'+these_attrs[22]+'_'+these_attrs[23]+'_noise'+these_attrs[24]+myseedAdd+'.mat MMNs_2pm_sep_noISDIDD_limtau_withnoisyfittedcortical_Nperpop'+str(Nperpop)+'_SD'+str(paramSD)+'_model'+str(imodel)+'_'+area+'pop_seed'+str(myseed)+'.mat')
os.system('mv MMNs_2pm_sep_noISDIDD_limtau_Nperpop'+these_attrs[2]+'_paramSD'+these_attrs[3]+'_stimA'+these_attrs[4]+'_'+these_attrs[5]+'_gAMPA'+these_attrs[6]+'_'+these_attrs[7]+'_'+these_attrs[8]+'_'+these_attrs[9]+'_gNMDA'+these_attrs[10]+'_'+these_attrs[11]+'_'+these_attrs[12]+'_'+these_attrs[13]+'_gGABA'+these_attrs[14]+'_'+these_attrs[15]+'_dep'+these_attrs[16]+'_'+these_attrs[17]+'_'+these_attrs[18]+'_tau'+these_attrs[19]+'_'+these_attrs[20]+'_'+these_attrs[21]+'_'+these_attrs[22]+'_'+these_attrs[23]+'_noise'+these_attrs[24]+myseedAdd+'.mat MMNs_2pm_sep_noISDIDD_limtau_withnoisyfittedcortical_Nperpop'+str(Nperpop)+'_SD'+str(paramSD)+'_model'+str(imodel)+'_'+area+'pop_seed'+str(myseed)+'.mat')