rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
b = runScriptInteractively(filename = sys.argv[1])
b = runScriptInteractively(locals=locals(), filename = sys.argv[1])
def __getattr__(self, key): return getattr(self.file, key)
1c28b1d51f03d6b759dce14dc6f42cef5a748730 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/1c28b1d51f03d6b759dce14dc6f42cef5a748730/runSampleCode.py
SWIG = 'swig -O -templatereduce -shadow -python -c++ -keyword -nodefaultctor -w-503,-312,-511,-362,-383,-384,-389,-315,-525'
SWIG = 'swig -O -templatereduce -shadow -python -outdir src -c++ -keyword -nodefaultctor -w-503,-312,-511,-362,-383,-384,-389,-315,-525'
def swig_version(): ''' get the version of swig ''' fout = os.popen('swig -version') # try: version = re.match('SWIG Version\s*(\d+).(\d+).(\d+).*', fout.readlines()[1]).groups() except: print 'Can not obtain swig version, please install swig' sys.exit(1) return map(int, version)
8f04c4582242d345612a60cf2fc688b05d7eb9b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/8f04c4582242d345612a60cf2fc688b05d7eb9b2/setup.py
SWIG = 'swig -shadow -c++ -python -keyword -w-312,-401,-503,-511,-362,-383,-384,-389,-315,-525'
SWIG = 'swig -shadow -c++ -python -outdir src -keyword -w-312,-401,-503,-511,-362,-383,-384,-389,-315,-525'
def swig_version(): ''' get the version of swig ''' fout = os.popen('swig -version') # try: version = re.match('SWIG Version\s*(\d+).(\d+).(\d+).*', fout.readlines()[1]).groups() except: print 'Can not obtain swig version, please install swig' sys.exit(1) return map(int, version)
8f04c4582242d345612a60cf2fc688b05d7eb9b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/8f04c4582242d345612a60cf2fc688b05d7eb9b2/setup.py
'Tsting counting number of male'
'Testing counting number of male'
def testNumOfMale(self): 'Tsting counting number of male' pop = population(subPop=[200, 800]) for i in range(100): pop.individual(i,0).setSex(Male) pop.individual(i,1).setSex(Male) for i in range(100,200): pop.individual(i,0).setSex(Female) for i in range(100,800): pop.individual(i,1).setSex(Female) Stat(pop, numOfMale...
b6008f11a8360d847f0ee1141c803ba514cfa6ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/b6008f11a8360d847f0ee1141c803ba514cfa6ff/test_08_opStat.py
'Tsting counting number of affected individuals'
'Testing counting number of affected individuals'
def testNumOfAffected(self): 'Tsting counting number of affected individuals' pop = population(subPop=[200, 800]) for i in range(100): pop.individual(i,0).setAffected(True) pop.individual(i,1).setAffected(True) for i in range(100,200): pop.individual(i,0).setAffected(False) for i in range(100,800): pop.individual(i,1)....
b6008f11a8360d847f0ee1141c803ba514cfa6ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/b6008f11a8360d847f0ee1141c803ba514cfa6ff/test_08_opStat.py
def simuCDCV(numDSL, initSpec, selModel, selModelAllDSL, selCoef, mutaModel, maxAllele, mutaRate, initSize, finalSize, burnin, noMigrGen, mixingGen, growth, numSubPop, migrModel, migrRate, update, dispPlot, saveAt, savePop, resume, resumeAtGen, name, dryrun): ''' parameters are self-expanary. See help info for detailed...
8c66adc766ef2a075cf1c7e8ea5e6b04bb3b4e49 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/8c66adc766ef2a075cf1c7e8ea5e6b04bb3b4e49/simuCDCV.py
penFun = customPene(penePara)
penFun = custom(penePara)
def drawSamples(pop, peneFunc, penePara, numSample, saveFormat, dataDir, reAnalyzeOnly ): ''' get samples of different type using a penetrance function, and save samples in dataDir in saveFormat pop: population peneFunc: penetrance function name, can be recessive1 etc penePara: parameter of the penetrance function num...
3a83a32f87b7cbb738a7f683eaa316b45fdc5470 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3a83a32f87b7cbb738a7f683eaa316b45fdc5470/simuComplexDisease.py
print "\nList script", proc_jobs[0] script = getScript(proc_jobs[0], options)
print "\nList pbs_script", proc_jobs[0] pbs_script = getScript(proc_jobs[0], options)
def allJobs(): ''' list all jobs ''' names = [] for job in alljobs: names.append(job['name']) return names
3b8b6236b41f92dafdcc326a6bc9eb16e029ae73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3b8b6236b41f92dafdcc326a6bc9eb16e029ae73/simuCluster.py
print >> pbs, script
print >> pbs, pbs_script
def allJobs(): ''' list all jobs ''' names = [] for job in alljobs: names.append(job['name']) return names
3b8b6236b41f92dafdcc326a6bc9eb16e029ae73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3b8b6236b41f92dafdcc326a6bc9eb16e029ae73/simuCluster.py
print script if '$' in script:
print pbs_script if '$' in pbs_script:
def allJobs(): ''' list all jobs ''' names = [] for job in alljobs: names.append(job['name']) return names
3b8b6236b41f92dafdcc326a6bc9eb16e029ae73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3b8b6236b41f92dafdcc326a6bc9eb16e029ae73/simuCluster.py
print 'Warning: symbol $ exists in the script, indicating unsubstituted variables' print for line in script.split():
print 'Warning: symbol $ exists in the pbs_script, indicating unsubstituted variables' print for line in pbs_script.split():
def allJobs(): ''' list all jobs ''' names = [] for job in alljobs: names.append(job['name']) return names
3b8b6236b41f92dafdcc326a6bc9eb16e029ae73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3b8b6236b41f92dafdcc326a6bc9eb16e029ae73/simuCluster.py
script = getScript(job, options)
pbs_script = getScript(job, options)
def allJobs(): ''' list all jobs ''' names = [] for job in alljobs: names.append(job['name']) return names
3b8b6236b41f92dafdcc326a6bc9eb16e029ae73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3b8b6236b41f92dafdcc326a6bc9eb16e029ae73/simuCluster.py
print >> pbs, script
print >> pbs, pbs_script
def allJobs(): ''' list all jobs ''' names = [] for job in alljobs: names.append(job['name']) return names
3b8b6236b41f92dafdcc326a6bc9eb16e029ae73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3b8b6236b41f92dafdcc326a6bc9eb16e029ae73/simuCluster.py
if '$' in script and not force: print script print print 'Warning: symbol $ exists in the script, indicating unsubstituted variables' print for line in script.split():
if '$' in pbs_script and not force: print pbs_script print print 'Warning: symbol $ exists in the pbs_script, indicating unsubstituted variables' print for line in pbs_script.split():
def allJobs(): ''' list all jobs ''' names = [] for job in alljobs: names.append(job['name']) return names
3b8b6236b41f92dafdcc326a6bc9eb16e029ae73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3b8b6236b41f92dafdcc326a6bc9eb16e029ae73/simuCluster.py
print 'Please check your script, if there is no problem, please use option -f (--force)'
print 'Please check your pbs_script, if there is no problem, please use option -f (--force)'
def allJobs(): ''' list all jobs ''' names = [] for job in alljobs: names.append(job['name']) return names
3b8b6236b41f92dafdcc326a6bc9eb16e029ae73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3b8b6236b41f92dafdcc326a6bc9eb16e029ae73/simuCluster.py
os.system('qsub %s.pbs' % job)
def allJobs(): ''' list all jobs ''' names = [] for job in alljobs: names.append(job['name']) return names
3b8b6236b41f92dafdcc326a6bc9eb16e029ae73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3b8b6236b41f92dafdcc326a6bc9eb16e029ae73/simuCluster.py
def TDT(DSL, dataDir, data, epsFile, jpgFile):
def TDT(DSL, cutoff, dataDir, data, epsFile, jpgFile):
def TDT(DSL, dataDir, data, epsFile, jpgFile): ''' use TDT method to analyze the results. Has to have rpy installed ''' if not hasRPy: return (0,[]) # write a batch file and call gh allPvalue = [] print "Applying TDT method to affected sibpairs " for ch in range(numChrom): inputfile = dataDir+data+ "_%d" % ch if not os...
38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d/simuComplexDisease.py
xlab="chromosome", ylab="-log10 p-value", type='l', axes=False)
xlab="chromosome", ylab="-log10 p-value", type='l', axes=False, ylim=[0.01, 5])
def TDT(DSL, dataDir, data, epsFile, jpgFile): ''' use TDT method to analyze the results. Has to have rpy installed ''' if not hasRPy: return (0,[]) # write a batch file and call gh allPvalue = [] print "Applying TDT method to affected sibpairs " for ch in range(numChrom): inputfile = dataDir+data+ "_%d" % ch if not os...
38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d/simuComplexDisease.py
r.abline( h = -math.log10(0.05))
r.abline( h = cutoff )
def TDT(DSL, dataDir, data, epsFile, jpgFile): ''' use TDT method to analyze the results. Has to have rpy installed ''' if not hasRPy: return (0,[]) # write a batch file and call gh allPvalue = [] print "Applying TDT method to affected sibpairs " for ch in range(numChrom): inputfile = dataDir+data+ "_%d" % ch if not os...
38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d/simuComplexDisease.py
def Linkage(DSL, dataDir, data, epsFile, jpgFile):
def Linkage(DSL, cutoff, dataDir, data, epsFile, jpgFile):
def Linkage(DSL, dataDir, data, epsFile, jpgFile): ''' use Linkage method to analyze the results. Has to have rpy installed ''' if not hasRPy: return (0,[]) # write a batch file and call gh allPvalue = [] print "Applying Linkage (LOD) method to affected sibpairs " for ch in range(numChrom): inputfile = dataDir+data+ "_...
38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d/simuComplexDisease.py
r.plot(allPvalue, main="-log10(P-value) for each marker (TDT)",
r.plot(allPvalue, main="-log10(P-value) for each marker (LOD)", ylim=[0.01,5],
def Linkage(DSL, dataDir, data, epsFile, jpgFile): ''' use Linkage method to analyze the results. Has to have rpy installed ''' if not hasRPy: return (0,[]) # write a batch file and call gh allPvalue = [] print "Applying Linkage (LOD) method to affected sibpairs " for ch in range(numChrom): inputfile = dataDir+data+ "_...
38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d/simuComplexDisease.py
r.abline( h = -math.log10(0.05))
r.abline( h = cutoff )
def Linkage(DSL, dataDir, data, epsFile, jpgFile): ''' use Linkage method to analyze the results. Has to have rpy installed ''' if not hasRPy: return (0,[]) # write a batch file and call gh allPvalue = [] print "Applying Linkage (LOD) method to affected sibpairs " for ch in range(numChrom): inputfile = dataDir+data+ "_...
38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d/simuComplexDisease.py
(suc,res) = TDT(pop.dvars().DSL, penDir, "/Linkage/Aff", penDir + "/TDT.eps", penDir + "/TDT.jpg")
(suc,res) = TDT(pop.dvars().DSL, -math.log10(0.05/pop.totNumLoci()), penDir, "/Linkage/Aff", penDir + "/TDT.eps", penDir + "/TDT.jpg")
def processOnePopulation(dataDir, numChrom, numLoci, markerType, DSLafter, DSLdist, initSize, meanInitAllele, burnin, introGen, minAlleleFreq, maxAlleleFreq, fitness, mlSelModel, numSubPop, finalSize, noMigrGen, mixingGen, popSizeFunc, migrModel, mu, mi, rec, peneFunc, penePara, N, numSample, dryrun, popIdx): ''' this...
38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d/simuComplexDisease.py
(suc,res) = Linkage(pop.dvars().DSL, penDir, "/Linkage/Aff", penDir + "/LOD.eps", penDir + "/LOD.jpg")
(suc,res) = Linkage(pop.dvars().DSL, -math.log10(0.05/pop.totNumLoci()), penDir, "/Linkage/Aff", penDir + "/LOD.eps", penDir + "/LOD.jpg")
def processOnePopulation(dataDir, numChrom, numLoci, markerType, DSLafter, DSLdist, initSize, meanInitAllele, burnin, introGen, minAlleleFreq, maxAlleleFreq, fitness, mlSelModel, numSubPop, finalSize, noMigrGen, mixingGen, popSizeFunc, migrModel, mu, mi, rec, peneFunc, penePara, N, numSample, dryrun, popIdx): ''' this...
38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d/simuComplexDisease.py
DSL, allele frequency at DSL, -log10 p-values (TDT method and Linkage method) at all relevant DSL. </p>
DSL, allele frequency at DSL, -log10 p-values (TDT method and Linkage method, + for exceeds and - for less than cutoff value -log10(pvalue/total number of loci) ) at all relevant DSL. Other statistics include K (population prevalence), Ks (sibling recurrance risk), Ls (lambda_s, sibling recurrance ratio), P11 (P(NN | a...
def writeReport(content, allParam, results): ''' write a HTML file. The parts for each population has been written but we need a summary table. ''' print "Writing a report (saved in summary.htm )" try: summary = open(outputDir + "/summary.htm", 'w') except: raise exceptions.IOError("Can not open a summary file : " + ou...
38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d/simuComplexDisease.py
summary.write('<td>%.5g</td>' % res['Fst']) summary.write('<td>%.5g</td>' % res['AvgHet']) summary.write('<td>%.5g/%.5g</td>' % (res['DpDSL'], res['DpNon'])) summary.write('<td>%.5g/%.5g</td>' % (res['DDSL'], res['DNon'])) for i in range(len(allParam[3])):
summary.write('<td>%.2g</td>' % res['Fst']) summary.write('<td>%.2g</td>' % res['AvgHet']) summary.write('<td>%.2g</td>' % res['DpDSL']) summary.write('<td>%.2g</td>' % res['DDSL']) summary.write('<td>%.2g</td>' % res['DpNon']) summary.write('<td>%.2g</td>' % res['DNon']) for i in range(len(allParam[3])):
def writeReport(content, allParam, results): ''' write a HTML file. The parts for each population has been written but we need a summary table. ''' print "Writing a report (saved in summary.htm )" try: summary = open(outputDir + "/summary.htm", 'w') except: raise exceptions.IOError("Can not open a summary file : " + ou...
38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d/simuComplexDisease.py
for met in ['TDT', 'LOD']: for p in allParam[-9]:
for p in allParam[-9]: summary.write('<td>%.2g</td>' % res[p+'_K']) summary.write('<td>%.2g</td>' % res[p+'_Ks']) summary.write('<td>%.2g</td>' % res[p+'_Ls']) summary.write('<td>' + ','.join( ['%.2g'%x for x in res[p+'_P11'] ]) + '</td>') summary.write('<td>' + ','.join( ['%.2g'%x for x in res[p+'_P12'] ]) + '</td>') ...
def writeReport(content, allParam, results): ''' write a HTML file. The parts for each population has been written but we need a summary table. ''' print "Writing a report (saved in summary.htm )" try: summary = open(outputDir + "/summary.htm", 'w') except: raise exceptions.IOError("Can not open a summary file : " + ou...
38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d/simuComplexDisease.py
plusMinus = '<td>' for p in res[met+'_'+p+'_'+str(num)]: if p > -math.log10(0.01/400.):
plusMinus = '' for pvalue in res[met+'_'+p+'_'+str(num)]: if pvalue > -math.log10(0.05/(allParam[0]*allParam[1])):
def writeReport(content, allParam, results): ''' write a HTML file. The parts for each population has been written but we need a summary table. ''' print "Writing a report (saved in summary.htm )" try: summary = open(outputDir + "/summary.htm", 'w') except: raise exceptions.IOError("Can not open a summary file : " + ou...
38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d/simuComplexDisease.py
summary.write(plusMinus+'</td>')
summary.write('<td>'+plusMinus+'</td>')
def writeReport(content, allParam, results): ''' write a HTML file. The parts for each population has been written but we need a summary table. ''' print "Writing a report (saved in summary.htm )" try: summary = open(outputDir + "/summary.htm", 'w') except: raise exceptions.IOError("Can not open a summary file : " + ou...
38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/38652794248d6f9c5f20e2bc4e7e7d850fd5fa1d/simuComplexDisease.py
if len(traj) < max(2, minMutAge):
if True in [len(t) < max(2, minMutAge) for t in traj]:
def FreqTrajectoryMultiStochWithSubPop( curGen, numLoci, freq, NtFunc, fitness, minMutAge, maxMutAge, mode = 'uneven', ploidy=2, restartIfFail=True): ''' Simulate frequency trajectory with subpopulation structure, migration is currently ignored. The essential part of this script is to simulate the trajectory of each su...
59936139d93659d3a20096d82fcc9ca20c155bbd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/59936139d93659d3a20096d82fcc9ca20c155bbd/simuUtil.py
print 'Info:'
print "len: ", [len(t) for t in traj]
def FreqTrajectoryMultiStochWithSubPop( curGen, numLoci, freq, NtFunc, fitness, minMutAge, maxMutAge, mode = 'uneven', ploidy=2, restartIfFail=True): ''' Simulate frequency trajectory with subpopulation structure, migration is currently ignored. The essential part of this script is to simulate the trajectory of each su...
59936139d93659d3a20096d82fcc9ca20c155bbd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/59936139d93659d3a20096d82fcc9ca20c155bbd/simuUtil.py
if len(traj) == 0:
if len(traj) == 1:
def FreqTrajectoryMultiStochWithSubPop( curGen, numLoci, freq, NtFunc, fitness, minMutAge, maxMutAge, mode = 'uneven', ploidy=2, restartIfFail=True): ''' Simulate frequency trajectory with subpopulation structure, migration is currently ignored. The essential part of this script is to simulate the trajectory of each su...
c04115316d55d6d425fcf0c9b8e30aa7d152ee20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/c04115316d55d6d425fcf0c9b8e30aa7d152ee20/simuUtil.py
if maxMutAge == 0: maxMutAge = endGen
def FreqTrajectoryMultiStochWithSubPop( curGen, numLoci, freq, NtFunc, fitness, minMutAge, maxMutAge, mode = 'uneven', ploidy=2, restartIfFail=True): ''' Simulate frequency trajectory with subpopulation structure, migration is currently ignored. The essential part of this script is to simulate the trajectory of each su...
c04115316d55d6d425fcf0c9b8e30aa7d152ee20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/c04115316d55d6d425fcf0c9b8e30aa7d152ee20/simuUtil.py
introFree, selFreeIntensity, initSize, endingSize, growthModel,
initSize, endingSize, growthModel,
def simuComplexDisease(numChrom, numLoci, markerType, DSLafter, DSLdistTmp, introFree, selFreeIntensity, initSize, endingSize, growthModel, burninGen, splitGen, mixingGen, endingGen, numSubPop, migrModel, migrRate, alleleDistInSubPop, curAlleleFreqTmp, minMutAge, maxMutAge, fitnessTmp, mlSelModelTmp, mutaRate, recRate,...
6192e8ac3832ae52136a6066f5b44a030344c709 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/6192e8ac3832ae52136a6066f5b44a030344c709/simuComplexDisease.py
introFree, selFreeIntensity, initSize, endingSize, growthModel,
initSize, endingSize, growthModel,
def saveAncestors(gen): if gen >= endingGen - savedGen: return savedGen else: return 1
6192e8ac3832ae52136a6066f5b44a030344c709 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/6192e8ac3832ae52136a6066f5b44a030344c709/simuComplexDisease.py
introFree, selFreeIntensity, initSize, endingSize, growthModel,
initSize, endingSize, growthModel,
def saveAncestors(gen): if gen >= endingGen - savedGen: return savedGen else: return 1
6192e8ac3832ae52136a6066f5b44a030344c709 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/6192e8ac3832ae52136a6066f5b44a030344c709/simuComplexDisease.py
options['command'] = 'qsub'
def readConfigFile(): ''' read variables from configuration file ''' config = os.path.join(os.environ['HOME'], '.simuCluster') tmp = {} res = {} if os.path.isfile(config): execfile(config, tmp, res) return res
9196075d336d8fbd744a287cfa316ce3d834d290 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/9196075d336d8fbd744a287cfa316ce3d834d290/simuCluster.py
assert (simu.dvars(0).haploFreq['0-1']['2-3'] - 0.05) < 0.01 assert (simu.dvars(0).haploFreq['0-1']['3-4'] - 0.05) < 0.01 assert (simu.dvars(0).haploFreq['0-1']['4-5'] - 0.25) < 0.01 assert (simu.dvars(0).haploFreq['0-1']['5-6'] - 0.05) < 0.01
assert (simu.dvars(0).haploFreq['2-3']['1-2'] - 0.05) < 0.01 assert (simu.dvars(0).haploFreq['3-4']['1-2'] - 0.05) < 0.01 assert (simu.dvars(0).haploFreq['4-5']['1-2'] - 0.25) < 0.01 assert (simu.dvars(0).haploFreq['5-6']['1-2'] - 0.05) < 0.01 def testRecRates(self): ' see if we actually recombine at this rate ' pop =...
def testRecRate(self): ' see if we actually recombine at this rate ' pop = population(10000, loci=[2,3,2]) InitByValue(pop, value=[1]*7+[2]*7) simu = simulator(pop, randomMating()) simu.step( [ stat( haploFreq = [[0,1], [2,3], [3,4], [4,5], [5,6]]), recombinator(rate = 0.1) ] ) # the supposed proportions are 1-1: 0.5-r...
497e2e46b1db4af7f42af0cb4e820210ec7b8ccf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/497e2e46b1db4af7f42af0cb4e820210ec7b8ccf/test_recombination.py
def testCrossBetweenChrom(self): ' see if chromsomes are crossed by default' pop = population(10000, loci=[2,3,2]) InitByValue(pop, value=[1]*7+[2]*7) simu = simulator(pop, randomMating()) #TurnOnDebug(DBG_RECOMBINATOR) simu.step( [ stat( haploFreq = [[0,1], [2,3], [2,4], [5,6], [0,2], [0,6], [3,6]], stage=PrePostMatin...
497e2e46b1db4af7f42af0cb4e820210ec7b8ccf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/497e2e46b1db4af7f42af0cb4e820210ec7b8ccf/test_recombination.py
def testRecombine(self):
def testRecProportion(self):
def testRecombine(self): ' verify table 4 of H&C 3nd edition P49 ' N = 10000 r = 0.1 genoDad = [[1,1],[1,1],[1,1],[1,1],[1,2],[1,2],[1,2],[2,1],[2,1],[2,2]] genoMom = [[1,1],[1,2],[2,1],[2,2],[1,2],[2,1],[2,2],[2,1],[2,2],[2,2]] prop = [ [1, 0, 0, 0], [.5, .5, 0, 0], [.5, 0, 0.5, 0], [0.5-r/2, r/2, r/2, 0.5-r/2], [0, ...
497e2e46b1db4af7f42af0cb4e820210ec7b8ccf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/497e2e46b1db4af7f42af0cb4e820210ec7b8ccf/test_recombination.py
pass
r = 0.1 N = 100 pop = population(size=N, loci=[2,5], sexChrom=True) InitByValue(pop, indRange=[0,N/2-1], sex=[Male]*(N/2), atPloidy=0, value=[1]*7) InitByValue(pop, indRange=[0,N/2-1], sex=[Male]*(N/2), atPloidy=1, value=[3]*7) InitByValue(pop, indRange=[N/2,N-1], sex=[Female]*(N/2), value=[1]*7+[2]*7) simu = simula...
def testNoMaleRec(self): ' male chromosome is not supposed to recombine ' # create such an situation
497e2e46b1db4af7f42af0cb4e820210ec7b8ccf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/497e2e46b1db4af7f42af0cb4e820210ec7b8ccf/test_recombination.py
selection = maSelector( loci=range(numDSL), fitness=selCoef, wildtype=[1] )
selection = maSelector( loci=range(numDSL), fitness=selCoef, wildtype=[0] )
def simuCDCV( numDSL, initSpec, selModel, selModelAllDSL, selCoef, mutaModel, maxAllele, mutaRate, initSize, finalSize, burnin, noMigrGen, mixingGen, growth, numSubPop, migrModel, migrRate, update, dispPlot, saveAt, savePop, resume, resumeAtGen, name, dryrun): ''' parameters are self-expanary. See help info for detaile...
ed7f5913f23271d4c22dbdf8629493f8e56e689e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/ed7f5913f23271d4c22dbdf8629493f8e56e689e/simuCDCV.py
sel.append( maSelector(locus=d, fitness=[1,1,1-selCoef[d]], wildtype=[1]))
sel.append( maSelector(locus=d, fitness=[1,1,1-selCoef[d]], wildtype=[0]))
def simuCDCV( numDSL, initSpec, selModel, selModelAllDSL, selCoef, mutaModel, maxAllele, mutaRate, initSize, finalSize, burnin, noMigrGen, mixingGen, growth, numSubPop, migrModel, migrRate, update, dispPlot, saveAt, savePop, resume, resumeAtGen, name, dryrun): ''' parameters are self-expanary. See help info for detaile...
ed7f5913f23271d4c22dbdf8629493f8e56e689e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/ed7f5913f23271d4c22dbdf8629493f8e56e689e/simuCDCV.py
sel.append( maSelector(locus=d, fitness=[1,1-selCoef[d]/2.,1-selCoef[d]], wildtype=[1]))
sel.append( maSelector(locus=d, fitness=[1,1-selCoef[d]/2.,1-selCoef[d]], wildtype=[0]))
def simuCDCV( numDSL, initSpec, selModel, selModelAllDSL, selCoef, mutaModel, maxAllele, mutaRate, initSize, finalSize, burnin, noMigrGen, mixingGen, growth, numSubPop, migrModel, migrRate, update, dispPlot, saveAt, savePop, resume, resumeAtGen, name, dryrun): ''' parameters are self-expanary. See help info for detaile...
ed7f5913f23271d4c22dbdf8629493f8e56e689e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/ed7f5913f23271d4c22dbdf8629493f8e56e689e/simuCDCV.py
pyEval(r"'%d\t%d\n' % (gen, popSize)", step=50),
pyEval(r"'%d\t%d\t%f\n' % (gen, popSize, alleleFreq[0][0])", step=50),
def simuCDCV( numDSL, initSpec, selModel, selModelAllDSL, selCoef, mutaModel, maxAllele, mutaRate, initSize, finalSize, burnin, noMigrGen, mixingGen, growth, numSubPop, migrModel, migrRate, update, dispPlot, saveAt, savePop, resume, resumeAtGen, name, dryrun): ''' parameters are self-expanary. See help info for detaile...
ed7f5913f23271d4c22dbdf8629493f8e56e689e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/ed7f5913f23271d4c22dbdf8629493f8e56e689e/simuCDCV.py
if j not in proc_jobs and n in all_jobs:
if j not in proc_jobs and j in all_jobs:
def allJobs(): ''' list all jobs ''' names = [] for job in alljobs: names.append(job['name']) return names
f7fd2fb7208a2d7f1456a2df21e408ffb1cfaf42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/f7fd2fb7208a2d7f1456a2df21e408ffb1cfaf42/simuCluster.py
def testBinormialSelection(self):
def testBinomialSelection(self):
def testBinormialSelection(self): 'Testing binomialSelection mating scheme (FIXME: imcomplete)' simu = simulator(population(10, loci=[1], ploidy=1), binomialSelection())
32974d49e22ad0ba5cbb95441e40f0751594cb81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/32974d49e22ad0ba5cbb95441e40f0751594cb81/test_05_matings.py
def getFamSize(self, mate, endGen=0, size=1000 ):
def getFamSize(self, mate, endGen=0, size=1000):
def getFamSize(self, mate, endGen=0, size=1000 ): TurnOnDebug(DBG_MATING) simu = simulator(population(size, loci=[1]), mate) simu.evolve(ops=[], end=endGen) return simu.population(0).dvars().famSizes
32974d49e22ad0ba5cbb95441e40f0751594cb81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/32974d49e22ad0ba5cbb95441e40f0751594cb81/test_05_matings.py
self.getFamSize( binomialSelection(numOffspring=2) ),
self.getFamSize(binomialSelection(numOffspring=2)),
def testNumOffspring(self): 'Testing means to control number of offspring (FIXME: check distribution)' self.assertEqual( self.getFamSize( binomialSelection(numOffspring=2) ), [2]*500) # numOffspringFunc def nos(gen): return gen%2+1 self.assertEqual( self.getFamSize( binomialSelection(numOffspringFunc=nos), endGen=1), [...
32974d49e22ad0ba5cbb95441e40f0751594cb81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/32974d49e22ad0ba5cbb95441e40f0751594cb81/test_05_matings.py
self.getFamSize( binomialSelection(numOffspringFunc=nos), endGen=1),
self.getFamSize(binomialSelection(numOffspringFunc=nos), endGen=1),
def nos(gen): return gen%2+1
32974d49e22ad0ba5cbb95441e40f0751594cb81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/32974d49e22ad0ba5cbb95441e40f0751594cb81/test_05_matings.py
self.getFamSize( binomialSelection(numOffspringFunc=nos), endGen=2),
self.getFamSize(binomialSelection(numOffspringFunc=nos), endGen=2),
def nos(gen): return gen%2+1
32974d49e22ad0ba5cbb95441e40f0751594cb81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/32974d49e22ad0ba5cbb95441e40f0751594cb81/test_05_matings.py
cnt = self.getFamSize( randomMating(numOffspringFunc=nos) )
cnt = self.getFamSize(randomMating(numOffspringFunc=nos) )
def nos(gen): return random.randrange(1,4)
32974d49e22ad0ba5cbb95441e40f0751594cb81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/32974d49e22ad0ba5cbb95441e40f0751594cb81/test_05_matings.py
return with_mode(NO_CONVERSION, r.do_call)('rbind', mat)
return r.do_call('rbind', mat)
def rmatrix(mat): ''' VERY IMPORTANT convert a Python 2d list to r matrix format that can be passed to functions like image directly. ''' return with_mode(NO_CONVERSION, r.do_call)('rbind', mat)
0731ae08adccf41d053f6aa3359994cd77496a34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/0731ae08adccf41d053f6aa3359994cd77496a34/simuRPy.py
self.mfrow = mfrow
self.mfrow = [int(x) for x in mfrow]
def __init__(self, nplot, update, title, xlab, ylab, axes, lty, col, mfrow, plotType, saveAs, leaveOpen, dev='', width=0, height=0): """ initialization function of base properties (layout etc) of all plotters """ # save parameters self.nplot = nplot self.axes = axes if lty==[]: self.lty = range(1, nplot+1) else: self.l...
0731ae08adccf41d053f6aa3359994cd77496a34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/0731ae08adccf41d053f6aa3359994cd77496a34/simuRPy.py
self.mfrow[0] = int(math.ceil(math.sqrt( self.nplot ))) self.mfrow[1] = int(math.ceil(self.nplot/float(self.mfrow[0]) ))
self.mfrow[0] = int(ceil(sqrt( self.nplot))) self.mfrow[1] = int(ceil(self.nplot/float(self.mfrow[0])))
def layout(self): # calculate layout if self.mfrow != [1,1] and self.mfrow[0]*self.mfrow[1] < self.nplot: raise ValueError("mfrow is not enough to hold " + str(self.nplot) + " figures")
0731ae08adccf41d053f6aa3359994cd77496a34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/0731ae08adccf41d053f6aa3359994cd77496a34/simuRPy.py
if i*self.mfrow[1]+2+j <= self.nplot + 1:
if i*self.mfrow[1]+2+j <= self.nplot + 1:
def layout(self): # calculate layout if self.mfrow != [1,1] and self.mfrow[0]*self.mfrow[1] < self.nplot: raise ValueError("mfrow is not enough to hold " + str(self.nplot) + " figures")
0731ae08adccf41d053f6aa3359994cd77496a34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/0731ae08adccf41d053f6aa3359994cd77496a34/simuRPy.py
w = 7 * r.par("csi") * 2.54
w = 7 * with_mode(BASIC_CONVERSION, r.par)("csi") * 2.54
def layout(self): # calculate layout if self.mfrow != [1,1] and self.mfrow[0]*self.mfrow[1] < self.nplot: raise ValueError("mfrow is not enough to hold " + str(self.nplot) + " figures")
0731ae08adccf41d053f6aa3359994cd77496a34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/0731ae08adccf41d053f6aa3359994cd77496a34/simuRPy.py
levels = r.seq(lim[0], lim[1], length=level)
levels = with_mode(BASIC_CONVERSION, r.seq)(lim[0], lim[1], length=level)
def colorBar(self, level, lim): " draw a color bar to the right of the plot" mar = [0]*4 mar[0] = [5, 1, 4, 2] self.color = r.rainbow(level, start=.7, end=.1) r.par(mar=mar) levels = r.seq(lim[0], lim[1], length=level) r.plot_new() r.plot_window(xlim = [0, 1], ylim = lim, xaxs = "i", yaxs = "i") r.rect(0, levels[:(len...
0731ae08adccf41d053f6aa3359994cd77496a34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/0731ae08adccf41d053f6aa3359994cd77496a34/simuRPy.py
d.extend( data[i]) r.image( z= r.t(r.matrix( d, ncol=len(data))),
d.extend(data[i]) r.image( z= r.t(r.matrix(d, ncol=len(data))),
def plot(self, pop, expr): gen = pop.gen() rep = pop.rep() data = pop.evaluate(expr) # if type(data) == type(0) or type(data) == type(0.): data = [data] if rep >= self.numRep: raise ValueError("Replicate out of range. (forget to set numRep?)") # plot data if rep==-1 or rep == 0: # inc ... if not self.CanUpdate(True):...
0731ae08adccf41d053f6aa3359994cd77496a34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/0731ae08adccf41d053f6aa3359994cd77496a34/simuRPy.py
if self.plotType == "image":
if self.plotType == "image":
def plot(self, pop, expr): gen = pop.gen() rep = pop.rep() data = pop.evaluate(expr) _data = data # now start! if type(_data) == type(0) or type(_data) == type(0.): _data = [_data]
0731ae08adccf41d053f6aa3359994cd77496a34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/0731ae08adccf41d053f6aa3359994cd77496a34/simuRPy.py
xlim=self.xlim, z= r.t(r.matrix( self.data[rep].flatData(), byrow=True, ncol=len(self.data[rep].gen))),xlab=self.xlab,
xlim=self.xlim, z=r.t(r.matrix(self.data[rep].flatData(), byrow=True, ncol=len(self.data[rep].gen))), xlab=self.xlab,
def plot(self, pop, expr): gen = pop.gen() rep = pop.rep() data = pop.evaluate(expr) _data = data # now start! if type(_data) == type(0) or type(_data) == type(0.): _data = [_data]
0731ae08adccf41d053f6aa3359994cd77496a34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/0731ae08adccf41d053f6aa3359994cd77496a34/simuRPy.py
xlim=self.xlim, z= r.t(r.matrix( self.data[rep].flatData(),axes=self.axes, byrow=True, ncol=len(self.data[rep].data[0]))),xlab=self.xlab,
xlim=self.xlim, z= r.t(r.matrix(self.data[rep].flatData(), byrow=True, ncol=len(self.data[rep].data[0]))), xlab=self.xlab, axes=self.axes,
def plot(self, pop, expr): gen = pop.gen() rep = pop.rep() data = pop.evaluate(expr) _data = data # now start! if type(_data) == type(0) or type(_data) == type(0.): _data = [_data]
0731ae08adccf41d053f6aa3359994cd77496a34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/0731ae08adccf41d053f6aa3359994cd77496a34/simuRPy.py
def getScript(name):
def getScript(name, options):
def getScript(name): ''' return the script for simulation 'name' ''' if not globals().has_key('script'): print 'Vairable script is not defined' sys.exit(0) # for job in alljobs: # a dictionary if job['name'] == name: s = script print alljobs, job for k,v in job.items(): # subsitute in script if '"' in 'v': s = re.sub(r...
91f966b3d3340c218a61c914f3341d9f258b7b2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/91f966b3d3340c218a61c914f3341d9f258b7b2b/simuCluster.py
print alljobs, job for k,v in job.items():
for k,v in (job.items() + options.items()):
def getScript(name): ''' return the script for simulation 'name' ''' if not globals().has_key('script'): print 'Vairable script is not defined' sys.exit(0) # for job in alljobs: # a dictionary if job['name'] == name: s = script print alljobs, job for k,v in job.items(): # subsitute in script if '"' in 'v': s = re.sub(r...
91f966b3d3340c218a61c914f3341d9f258b7b2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/91f966b3d3340c218a61c914f3341d9f258b7b2b/simuCluster.py
if '"' in 'v': s = re.sub(r'\$%s\s' % k, "'%s' " % v, s) s = re.sub(r'\$\{%s\}' % k, "'%s' " % v, s)
if True in [x in str(v) for x in [' ', '*', ',', '[', ']']]: if '"' in str(v): quote = '"' else: quote = "'" s = re.sub(r'\$%s(\W)' % k, r"%s%s%s\1" % (quote, str(v), quote), s) s = re.sub(r'\$\{%s\}' % k, "%s%s%s" % (quote, str(v), quote), s)
def getScript(name): ''' return the script for simulation 'name' ''' if not globals().has_key('script'): print 'Vairable script is not defined' sys.exit(0) # for job in alljobs: # a dictionary if job['name'] == name: s = script print alljobs, job for k,v in job.items(): # subsitute in script if '"' in 'v': s = re.sub(r...
91f966b3d3340c218a61c914f3341d9f258b7b2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/91f966b3d3340c218a61c914f3341d9f258b7b2b/simuCluster.py
s = re.sub(r'\$%s\s' % k, '"%s" ' % v, s) s = re.sub(r'\$\{%s\}' % k, '"%s" ' % v, s) for k, v in options.items(): if '"' in 'v': s = re.sub(r'\$%s\s' % k, "'%s' " % v, s) s = re.sub(r'\$\{%s\}' % k, "'%s' " % v, s) else: s = re.sub(r'\$%s\s' % k, '"%s" ' % v, s) s = re.sub(r'\$\{%s\}' % k, '"%s" ' % v, s)
s = re.sub(r'\$%s(\W)' % k, r"%s\1" % str(v), s) s = re.sub(r'\$\{%s\}' % k, str(v), s)
def getScript(name): ''' return the script for simulation 'name' ''' if not globals().has_key('script'): print 'Vairable script is not defined' sys.exit(0) # for job in alljobs: # a dictionary if job['name'] == name: s = script print alljobs, job for k,v in job.items(): # subsitute in script if '"' in 'v': s = re.sub(r...
91f966b3d3340c218a61c914f3341d9f258b7b2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/91f966b3d3340c218a61c914f3341d9f258b7b2b/simuCluster.py
options = {}
options = {'time':96}
def allJobs(): ''' list all jobs ''' names = [] for job in alljobs: names.append(job['name']) return names
91f966b3d3340c218a61c914f3341d9f258b7b2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/91f966b3d3340c218a61c914f3341d9f258b7b2b/simuCluster.py
print alljobs
def allJobs(): ''' list all jobs ''' names = [] for job in alljobs: names.append(job['name']) return names
91f966b3d3340c218a61c914f3341d9f258b7b2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/91f966b3d3340c218a61c914f3341d9f258b7b2b/simuCluster.py
print getScript(proc_jobs[0])
print getScript(proc_jobs[0], options)
def allJobs(): ''' list all jobs ''' names = [] for job in alljobs: names.append(job['name']) return names
91f966b3d3340c218a61c914f3341d9f258b7b2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/91f966b3d3340c218a61c914f3341d9f258b7b2b/simuCluster.py
print >> pbs, getScript(job)
print >> pbs, getScript(job, options)
def allJobs(): ''' list all jobs ''' names = [] for job in alljobs: names.append(job['name']) return names
91f966b3d3340c218a61c914f3341d9f258b7b2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/91f966b3d3340c218a61c914f3341d9f258b7b2b/simuCluster.py
os.system('qsub ' + job + '.pbs')
print "Submitting job via 'qsub %s.pbs'" % job os.system('qsub %s.pbs' % job)
def allJobs(): ''' list all jobs ''' names = [] for job in alljobs: names.append(job['name']) return names
91f966b3d3340c218a61c914f3341d9f258b7b2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/91f966b3d3340c218a61c914f3341d9f258b7b2b/simuCluster.py
'simuUtil', 'simuSciPy', 'simuMatPlt', 'simuRPy', 'simuViewPop' ],
'simuPOP_ba', 'simuPOP_baop', 'simuUtil', 'simuSciPy', 'simuMatPlt', 'simuRPy', 'simuViewPop' ],
def buildStaticLibrary(sourceFiles, libName, libDir, compiler): '''Build libraries to be linked to simuPOP modules''' # get a c compiler print 'Creating library', libName comp = new_compiler(compiler=compiler, verbose=True) objFiles = comp.compile(sourceFiles, include_dirs=['.']) comp.create_static_lib(objFiles, libNam...
2af26b2f527c184e916fda4fc42fbf45876b115e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/2af26b2f527c184e916fda4fc42fbf45876b115e/setup.py
self.assertUnqqual([x.allele(0,0) for x in pop.individuals(0)], [int(x) for x in pop.indInfo('a', 0, False)])
def testRearrange(self): 'Test if info and genotype are migrated with individuals' if alleleType() == 'binary': return #TurnOnDebug(DBG_POPULATION) pop = population(subPop=[4, 6], loci=[1], infoFields=['a','b']) pop.arrGenotype(True)[:] = range(20) pop.arrIndInfo(True)[:] = range(20) self.assertEqual([x.allele(0,0) for...
ac8e869b484afeab5cab4bcba046c2f2aeaae1bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/ac8e869b484afeab5cab4bcba046c2f2aeaae1bd/test_12_migration.py
self.assertEqual(simu.population(i), simu.population(i))
self.assertEqual(simu.population(i), simu1.population(i))
def testClone(self): 'Testing cloning of simulator' pop = population(subPop=[10,4], loci=[2,5]) simu = simulator(pop, randomMating(), rep = 3) simu.evolve( preOps = [initByFreq([0.3, .7])], ops = [stat(alleleFreq=range(pop.totNumLoci()))], end = 10 ) simu1 = simu.clone() for i in range(3): self.assertEqual(simu.populat...
9f497954751696f83965f669701090c3c3afd209 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/9f497954751696f83965f669701090c3c3afd209/test_04_simulator.py
define_macros = [ ('SIMUPOP_MODULE', '"simuPOP_std"')] + serial_macro,
define_macros = [ ('SIMUPOP_MODULE', 'simuPOP_std')] + serial_macro,
def addCarrayEntry(file): ' add a line at the wrap file for carray type definition' shutil.copy(file, file+'tmp') ofile = open(file, 'w') ifile = open(file+'tmp', 'r') for line in ifile.readlines(): if line.find('static PyMethodDef SwigMethods[] = ') != -1: ofile.write('''static PyMethodDef SwigMethods[] = { /* add car...
14d9c19c36ce4097d8b2722411d2b682acf8a600 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/14d9c19c36ce4097d8b2722411d2b682acf8a600/setup.py
define_macros = [ ('SIMUPOP_MODULE', '"simuPOP_op"'), ('OPTIMIZED', None)] + serial_macro,
define_macros = [ ('SIMUPOP_MODULE', 'simuPOP_op'), ('OPTIMIZED', None)] + serial_macro,
def addCarrayEntry(file): ' add a line at the wrap file for carray type definition' shutil.copy(file, file+'tmp') ofile = open(file, 'w') ifile = open(file+'tmp', 'r') for line in ifile.readlines(): if line.find('static PyMethodDef SwigMethods[] = ') != -1: ofile.write('''static PyMethodDef SwigMethods[] = { /* add car...
14d9c19c36ce4097d8b2722411d2b682acf8a600 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/14d9c19c36ce4097d8b2722411d2b682acf8a600/setup.py
define_macros = [ ('SIMUPOP_MODULE', '"simuPOP_la"'), ('LONGALLELE', None) ] + serial_macro,
define_macros = [ ('SIMUPOP_MODULE', 'simuPOP_la'), ('LONGALLELE', None) ] + serial_macro,
def addCarrayEntry(file): ' add a line at the wrap file for carray type definition' shutil.copy(file, file+'tmp') ofile = open(file, 'w') ifile = open(file+'tmp', 'r') for line in ifile.readlines(): if line.find('static PyMethodDef SwigMethods[] = ') != -1: ofile.write('''static PyMethodDef SwigMethods[] = { /* add car...
14d9c19c36ce4097d8b2722411d2b682acf8a600 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/14d9c19c36ce4097d8b2722411d2b682acf8a600/setup.py
define_macros = [ ('SIMUPOP_MODULE', '"simuPOP_laop"'), ('LONGALLELE', None), ('OPTIMIZED', None) ] + serial_macro,
define_macros = [ ('SIMUPOP_MODULE', 'simuPOP_laop'), ('LONGALLELE', None), ('OPTIMIZED', None) ] + serial_macro,
def addCarrayEntry(file): ' add a line at the wrap file for carray type definition' shutil.copy(file, file+'tmp') ofile = open(file, 'w') ifile = open(file+'tmp', 'r') for line in ifile.readlines(): if line.find('static PyMethodDef SwigMethods[] = ') != -1: ofile.write('''static PyMethodDef SwigMethods[] = { /* add car...
14d9c19c36ce4097d8b2722411d2b682acf8a600 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/14d9c19c36ce4097d8b2722411d2b682acf8a600/setup.py
for a in range(2,len(alleleNum[i])):
for a in range(1,len(alleleNum[i])):
def simuCDCV(numDSL, initSpec, selModel, selModelAllDSL, selCoef, mutaModel, maxAllele, mutaRate, initSize, finalSize, burnin, noMigrGen, mixingGen, growth, numSubPop, migrModel, migrRate, update, dispPlot, saveAt, savePop, resume, resumeAtGen, name, dryrun): ''' parameters are self-expanary. See help info for detailed...
1c33e44e958fcfbc5bebc93a6c3559cb2101b102 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/1c33e44e958fcfbc5bebc93a6c3559cb2101b102/simuCDCV.py
ancNum += num[al-2]
ancNum += num[al-1]
def getStats(v, highest): # the following are statistics for each DSL perc = [] # percentage numAllele = [] # number of alleles effNumAllele = [] # effective number of alleles overallFreq = [] # size of disease percMostCommon = []...
9a4741083e9c0c019b582af1e74d24e7a38feb50 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/9a4741083e9c0c019b582af1e74d24e7a38feb50/simuCDCV.py
MODU_INFO[modu]['libraries'] = ['libboost_serialization-mgw-mt-s-1_33_1', 'libboost_iostreams-mgw-mt-s-1_33_1', 'stdc++']
MODU_INFO[modu]['libraries'] = ['libboost_serialization-%s' % TOOLSET, 'libboost_iostreams-%s' % TOOLSET]
def swig_version(): ''' get the version of swig ''' fout = os.popen('swig -version') # try: version = re.match('SWIG Version\s*(\d+).(\d+).(\d+).*', fout.readlines()[1]).groups() except: print 'Can not obtain swig version, please install swig' sys.exit(1) return map(int, version)
aafe2a1d10ef37244bf6cd63bb0d95409d37d7d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/aafe2a1d10ef37244bf6cd63bb0d95409d37d7d3/setup.py
MODU_INFO[modu]['libraries'] = ['boost_serialization-%s' % TOOLSET, 'boost_iostreams-%s' % TOOLSET, 'stdc++']
MODU_INFO[modu]['libraries'] = ['boost_serialization', 'boost_iostreams', 'stdc++']
def swig_version(): ''' get the version of swig ''' fout = os.popen('swig -version') # try: version = re.match('SWIG Version\s*(\d+).(\d+).(\d+).*', fout.readlines()[1]).groups() except: print 'Can not obtain swig version, please install swig' sys.exit(1) return map(int, version)
aafe2a1d10ef37244bf6cd63bb0d95409d37d7d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/aafe2a1d10ef37244bf6cd63bb0d95409d37d7d3/setup.py
self.assertEqual(simu.pop(0).indInfo('info1'), tuple([6.0]*10)) self.assertEqual(simu.pop(0).indInfo('info2'), tuple([12.]*10))
self.assertEqual(simu.population(0).indInfo('info1'), tuple([6.0]*10)) self.assertEqual(simu.population(0).indInfo('info2'), tuple([12.]*10))
def indFunc1(ind, param): 'do something to info2' ind.setInfo(ind.info('info2')+param[1], 'info2') return True
a435b11df2d7d7fb6018bc8d134c677d4cf639ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/a435b11df2d7d7fb6018bc8d134c677d4cf639ae/test_09_pyOperator.py
MODU_INFO[modu]['src'].extend(GSL_FILES + SERIAL_FILES + IOSTREAMS_FILES)
def buildStaticLibrary(sourceFiles, libName, libDir, compiler): '''Build libraries to be linked to simuPOP modules''' # get a c compiler print 'Creating library', libName comp = new_compiler(compiler=compiler, verbose=True) objFiles = comp.compile(sourceFiles, include_dirs=['.']) comp.create_static_lib(objFiles, libNam...
1e0994efe0821a5050fe42bbb7bd97424b7b442b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/1e0994efe0821a5050fe42bbb7bd97424b7b442b/setup.py
if modu in src:
if '_'+modu in src:
def buildStaticLibrary(sourceFiles, libName, libDir, compiler): '''Build libraries to be linked to simuPOP modules''' # get a c compiler print 'Creating library', libName comp = new_compiler(compiler=compiler, verbose=True) objFiles = comp.compile(sourceFiles, include_dirs=['.']) comp.create_static_lib(objFiles, libNam...
1e0994efe0821a5050fe42bbb7bd97424b7b442b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/1e0994efe0821a5050fe42bbb7bd97424b7b442b/setup.py
toCtrDist = [abs(pop.locusDist(x)-numLoci/2) for x in DSL]
toCtrDist = [abs(pop.locusPos(x)-numLoci/2) for x in DSL]
def outputStatistics(pop, args): ''' this function will be working with a pyOperator to output statistics. Many parameters will be passed, packed as a tuple. We need to output 1. LD (D') from a central marker to all others on a non-DSL chromosome, at burnin and before and after migration 2. LD (D') from a central DSL ...
3048db801937fd19a95ac18edc460a40a051066f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3048db801937fd19a95ac18edc460a40a051066f/simuComplexDisease.py
def simuComplexDisease( numChrom, numLoci, markerType, DSLafter, DSLdist, initSize, meanInitAllele, burnin, introGen, minAlleleFreq, maxAlleleFreq, fitness, mlSelModel, numSubPop, finalSize, noMigrGen, mixingGen, popSizeFunc, migrModel, mu, mi, rec, dryrun, logFile): ''' run a simulation of complex disease with given p...
3048db801937fd19a95ac18edc460a40a051066f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3048db801937fd19a95ac18edc460a40a051066f/simuComplexDisease.py
def simuComplexDisease( numChrom, numLoci, markerType, DSLafter, DSLdist, initSize, meanInitAllele, burnin, introGen, minAlleleFreq, maxAlleleFreq, fitness, mlSelModel, numSubPop, finalSize, noMigrGen, mixingGen, popSizeFunc, migrModel, mu, mi, rec, dryrun, logFile): ''' run a simulation of complex disease with given p...
3048db801937fd19a95ac18edc460a40a051066f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3048db801937fd19a95ac18edc460a40a051066f/simuComplexDisease.py
lociDist = []
lociPos = []
def simuComplexDisease( numChrom, numLoci, markerType, DSLafter, DSLdist, initSize, meanInitAllele, burnin, introGen, minAlleleFreq, maxAlleleFreq, fitness, mlSelModel, numSubPop, finalSize, noMigrGen, mixingGen, popSizeFunc, migrModel, mu, mi, rec, dryrun, logFile): ''' run a simulation of complex disease with given p...
3048db801937fd19a95ac18edc460a40a051066f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3048db801937fd19a95ac18edc460a40a051066f/simuComplexDisease.py
lociDist.append([])
lociPos.append([])
def simuComplexDisease( numChrom, numLoci, markerType, DSLafter, DSLdist, initSize, meanInitAllele, burnin, introGen, minAlleleFreq, maxAlleleFreq, fitness, mlSelModel, numSubPop, finalSize, noMigrGen, mixingGen, popSizeFunc, migrModel, mu, mi, rec, dryrun, logFile): ''' run a simulation of complex disease with given p...
3048db801937fd19a95ac18edc460a40a051066f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3048db801937fd19a95ac18edc460a40a051066f/simuComplexDisease.py
lociDist[ch].append(loc+1) lociDist[ch].append(loc+1 + DSLdist[j])
lociPos[ch].append(loc+1) lociPos[ch].append(loc+1 + DSLdist[j])
def simuComplexDisease( numChrom, numLoci, markerType, DSLafter, DSLdist, initSize, meanInitAllele, burnin, introGen, minAlleleFreq, maxAlleleFreq, fitness, mlSelModel, numSubPop, finalSize, noMigrGen, mixingGen, popSizeFunc, migrModel, mu, mi, rec, dryrun, logFile): ''' run a simulation of complex disease with given p...
3048db801937fd19a95ac18edc460a40a051066f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3048db801937fd19a95ac18edc460a40a051066f/simuComplexDisease.py
lociDist[ch].append(loc+1)
lociPos[ch].append(loc+1)
def simuComplexDisease( numChrom, numLoci, markerType, DSLafter, DSLdist, initSize, meanInitAllele, burnin, introGen, minAlleleFreq, maxAlleleFreq, fitness, mlSelModel, numSubPop, finalSize, noMigrGen, mixingGen, popSizeFunc, migrModel, mu, mi, rec, dryrun, logFile): ''' run a simulation of complex disease with given p...
3048db801937fd19a95ac18edc460a40a051066f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3048db801937fd19a95ac18edc460a40a051066f/simuComplexDisease.py
loci = loci, maxAllele = maxAle, lociDist = lociDist)
loci = loci, maxAllele = maxAle, lociPos = lociPos)
def last_two(gen): if gen >= endGen -2: return 2 else: return 1
3048db801937fd19a95ac18edc460a40a051066f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3048db801937fd19a95ac18edc460a40a051066f/simuComplexDisease.py
dist.append(pop.locusDist(ld[0]))
dist.append(pop.locusPos(ld[0]))
def plotLD(pop, epsFile, jpgFile): ''' plot LD values in R and convert to jpg if possible ''' # return max LD res = {} # dist: distance (location) of marker # ldprime: D' value dist = [] ldprime = [] # D' ldvalue = [] # D for ld in pop.dvars().ctrDSLLD: if ld[1] == pop.dvars().ctrChromDSL: dist.append(pop.locusDist(ld[...
3048db801937fd19a95ac18edc460a40a051066f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3048db801937fd19a95ac18edc460a40a051066f/simuComplexDisease.py
dist.append(pop.locusDist(ld[1]))
dist.append(pop.locusPos(ld[1]))
def plotLD(pop, epsFile, jpgFile): ''' plot LD values in R and convert to jpg if possible ''' # return max LD res = {} # dist: distance (location) of marker # ldprime: D' value dist = [] ldprime = [] # D' ldvalue = [] # D for ld in pop.dvars().ctrDSLLD: if ld[1] == pop.dvars().ctrChromDSL: dist.append(pop.locusDist(ld[...
3048db801937fd19a95ac18edc460a40a051066f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3048db801937fd19a95ac18edc460a40a051066f/simuComplexDisease.py
r.abline( v = pop.locusDist(pop.dvars().ctrChromDSL), lty=3 ) r.axis( 1, [pop.locusDist(pop.dvars().ctrChromDSL)], ['DSL'])
r.abline( v = pop.locusPos(pop.dvars().ctrChromDSL), lty=3 ) r.axis( 1, [pop.locusPos(pop.dvars().ctrChromDSL)], ['DSL'])
def plotLD(pop, epsFile, jpgFile): ''' plot LD values in R and convert to jpg if possible ''' # return max LD res = {} # dist: distance (location) of marker # ldprime: D' value dist = [] ldprime = [] # D' ldvalue = [] # D for ld in pop.dvars().ctrDSLLD: if ld[1] == pop.dvars().ctrChromDSL: dist.append(pop.locusDist(ld[...
3048db801937fd19a95ac18edc460a40a051066f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3048db801937fd19a95ac18edc460a40a051066f/simuComplexDisease.py
dist.append(pop.locusDist(ld[0]))
dist.append(pop.locusPos(ld[0]))
def plotLD(pop, epsFile, jpgFile): ''' plot LD values in R and convert to jpg if possible ''' # return max LD res = {} # dist: distance (location) of marker # ldprime: D' value dist = [] ldprime = [] # D' ldvalue = [] # D for ld in pop.dvars().ctrDSLLD: if ld[1] == pop.dvars().ctrChromDSL: dist.append(pop.locusDist(ld[...
3048db801937fd19a95ac18edc460a40a051066f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3048db801937fd19a95ac18edc460a40a051066f/simuComplexDisease.py
dist.append(pop.locusDist(ld[1]))
dist.append(pop.locusPos(ld[1]))
def plotLD(pop, epsFile, jpgFile): ''' plot LD values in R and convert to jpg if possible ''' # return max LD res = {} # dist: distance (location) of marker # ldprime: D' value dist = [] ldprime = [] # D' ldvalue = [] # D for ld in pop.dvars().ctrDSLLD: if ld[1] == pop.dvars().ctrChromDSL: dist.append(pop.locusDist(ld[...
3048db801937fd19a95ac18edc460a40a051066f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3048db801937fd19a95ac18edc460a40a051066f/simuComplexDisease.py
r.abline( v = pop.locusDist(pop.chromBegin(pop.dvars().noDSLChrom)+pop.dvars().numLoci/2), lty=3 )
r.abline( v = pop.locusPos(pop.chromBegin(pop.dvars().noDSLChrom)+pop.dvars().numLoci/2), lty=3 )
def plotLD(pop, epsFile, jpgFile): ''' plot LD values in R and convert to jpg if possible ''' # return max LD res = {} # dist: distance (location) of marker # ldprime: D' value dist = [] ldprime = [] # D' ldvalue = [] # D for ld in pop.dvars().ctrDSLLD: if ld[1] == pop.dvars().ctrChromDSL: dist.append(pop.locusDist(ld[...
3048db801937fd19a95ac18edc460a40a051066f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/3048db801937fd19a95ac18edc460a40a051066f/simuComplexDisease.py
summary.write('<th>K</th><th>Ks</th><th>Ks/K</th>') summary.write('<th>P11</th><th>P12</th><th>P22</th>') summary.write("<th>F'</th>")
def writeReport(content, allParam, numChrom, numLoci, DSLafter, peneFunc, numSample, results): ''' write a HTML file. The parts for each population has been written but we need a summary table. ''' print "Writing a report (saved in summary.htm )" try: summary = open(outputDir + "/summary.htm", 'w') except: raise except...
d379644a58630edb67630adaed9cae085c3172b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/d379644a58630edb67630adaed9cae085c3172b8/simuComplexDisease.py