rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
summary = '''<h2><a name="pop_%d">Dataset %d</a></h2>\n''' \ % (popIdx, popIdx) summary += '''<h3>Log file (LD and other statistics): <a href="pop_%d/pop_%d.log">pop_%d.log</a></h3>\n''' \ % (popIdx, popIdx, popIdx)
summary = '''\ <h2><a name="pop_%d">Dataset %d</a></h2> <h3>Log file (LD and other statistics): <a href="pop_%d/pop_%d.log">pop_%d.log</a></h3> ''' % (popIdx, popIdx, popIdx, popIdx, popIdx)
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, dryrun, popIdx): ''' this function organize all previous fun...
if hasRPy: (suc,ldres) = plotLD(pop, epsFile, jpgFile) if suc > 0 : summary += """<p>D' measures on two chromosomes with/without DSL at the last gen: <a href="pop_%d/LD_%d.eps">LD.eps</a></p>\n""" % (popIdx, popIdx) if suc > 1 : summary += '''<img src="pop_%d/LD_%d.jpg" width=800, height=600>''' % (popIdx, popIdx) res...
(suc,ldres) = plotLD(pop, epsFile, jpgFile) if suc > 0 : summary += """<p>D' measures on two chromosomes with/without DSL at the last gen: <a href="pop_%d/LD_%d.eps">LD.eps</a></p>\n""" % (popIdx, popIdx) if suc > 1 : summary += '''<img src="pop_%d/LD_%d.jpg" width=800, height=600>''' % (popIdx, popIdx) result.extend(...
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, dryrun, popIdx): ''' this function organize all previous fun...
result.append(res)
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, dryrun, popIdx): ''' this function organize all previous fun...
if allParam[-3] != '': for i in range(len(allParam[3])): summary.write('<th>TDT%d</th>'%(i+1))
if len(allParam[-8]) > 0: for p in allParam[-8]: summary.write('<th>%s:TDT</th>'%p)
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...
b = runScriptInteractively(filename = sys.argv[1])
b = runScriptInteractively(locals=locals(), filename = sys.argv[1])
def __getattr__(self, key): return getattr(self.file, key)
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)
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)
'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...
'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)....
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...
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
print >> pbs, script
print >> pbs, pbs_script
def allJobs(): ''' list all jobs ''' names = [] for job in alljobs: names.append(job['name']) return names
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
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
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
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
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
os.system('qsub %s.pbs' % job)
def allJobs(): ''' list all jobs ''' names = [] for job in alljobs: names.append(job['name']) return names
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...
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...
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...
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+ "_...
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+ "_...
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+ "_...
(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...
(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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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,...
introFree, selFreeIntensity, initSize, endingSize, growthModel,
initSize, endingSize, growthModel,
def saveAncestors(gen): if gen >= endingGen - savedGen: return savedGen else: return 1
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
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...
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, ...
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 = simulato...
def testNoMaleRec(self): ' male chromosome is not supposed to recombine ' # create such an situation
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...
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...
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...
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...
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
def testBinormialSelection(self):
def testBinomialSelection(self):
def testBinormialSelection(self): 'Testing binomialSelection mating scheme (FIXME: imcomplete)' simu = simulator(population(10, loci=[1], ploidy=1), binomialSelection())
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)
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...
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")
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")
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...
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]
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...
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...
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...
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...
options = {}
options = {'time':96}
def allJobs(): ''' list all jobs ''' names = [] for job in alljobs: names.append(job['name']) return names
print alljobs
def allJobs(): ''' list all jobs ''' names = [] for job in alljobs: names.append(job['name']) return names
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
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
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
'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...
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...
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...
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...
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...
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...
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...
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...
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 = []...
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)
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)
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
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...
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...
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 ...
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...
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...
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...
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...
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
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[...
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[...
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[...
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[...
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...
noDSLChrom = [pop.numLoci(x)==numLoci for x in range(pop.numChrom())].index(True)
try: noDSLChrom = [pop.numLoci(x)==numLoci for x in range(pop.numChrom())].index(True) except: noDSLChrom = -1
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 ...
i = pop.chromBegin( noDSLChrom) noDSLLD = [ [i+x, i+numLoci/2] for x in range(numLoci/2)] + \ [ [i + numLoci/2, i+x] for x in range(numLoci/2+1, numLoci)]
if noDSLChrom > -1: i = pop.chromBegin( noDSLChrom) noDSLLD = [ [i+x, i+numLoci/2] for x in range(numLoci/2)] + \ [ [i + numLoci/2, i+x] for x in range(numLoci/2+1, numLoci)] else: noDSLLD = []
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 ...
print >> output, "\n\nD between a center marker %d (chrom %d) and surrounding markers at gen %d" \ % (pop.chromBegin(noDSLChrom)+numLoci/2, noDSLChrom, gen) for ld in noDSLLD: print >> output, '%.4f ' % pop.dvars().LD[ld[0]][ld[1]],
if noDSLChrom > -1 : print >> output, "\n\nD between a center marker %d (chrom %d) and surrounding markers at gen %d" \ % (pop.chromBegin(noDSLChrom)+numLoci/2, noDSLChrom, gen) for ld in noDSLLD: print >> output, '%.4f ' % pop.dvars().LD[ld[0]][ld[1]],
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 ...
print >> output, "\n\nD' between a center marker %d (chrom %d) and surrounding markers at gen %d" \ % (pop.chromBegin(noDSLChrom)+numLoci/2, noDSLChrom, gen) for ld in noDSLLD: print >> output, '%.4f ' % pop.dvars().LD_prime[ld[0]][ld[1]],
if noDSLChrom > -1: print >> output, "\n\nD' between a center marker %d (chrom %d) and surrounding markers at gen %d" \ % (pop.chromBegin(noDSLChrom)+numLoci/2, noDSLChrom, gen) for ld in noDSLLD: print >> output, '%.4f ' % pop.dvars().LD_prime[ld[0]][ld[1]],
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 ...
for ld in pop.dvars().noDSLLD: if ld[1] == pop.chromBegin(pop.dvars().noDSLChrom) + numLoci/2: dist.append(pop.locusDist(ld[0])) else: dist.append(pop.locusDist(ld[1])) ldprime.append(pop.dvars().LD_prime[ld[0]][ld[1]]) ldvalue.append(pop.dvars().LD[ld[0]][ld[1]]) res['DpNon'] = max(ldprime) res['DNon'] = max(ldvalue) ...
if pop.dvars().noDSLChrom > -1: for ld in pop.dvars().noDSLLD: if ld[1] == pop.chromBegin(pop.dvars().noDSLChrom) + numLoci/2: dist.append(pop.locusDist(ld[0])) else: dist.append(pop.locusDist(ld[1])) ldprime.append(pop.dvars().LD_prime[ld[0]][ld[1]]) ldvalue.append(pop.dvars().LD[ld[0]][ld[1]]) res['DpNon'] = max(ldpr...
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[...
def TDT(DSL, cutoff, dataDir, data, epsFile, jpgFile):
def TDT(geneHunter, DSL, cutoff, dataDir, data, epsFile, jpgFile):
def TDT(DSL, cutoff, 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 i...
if not hasRPy:
if not hasRPy or geneHunter in ['', 'none']:
def TDT(DSL, cutoff, 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 i...
def Linkage(DSL, cutoff, dataDir, data, epsFile, jpgFile):
def Linkage(geneHunter, DSL, cutoff, dataDir, data, epsFile, jpgFile):
def Linkage(DSL, cutoff, 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+...
if not hasRPy:
if not hasRPy or geneHunter in ['', 'none']:
def Linkage(DSL, cutoff, 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+...
mixingGen, popSizeFunc, migrModel, mu, mi, rec, peneFunc, penePara, N, numSample, dryrun, popIdx):
mixingGen, popSizeFunc, migrModel, mu, mi, rec, peneFunc, penePara, N, numSample, geneHunter, dryrun, popIdx):
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...
(suc,res) = TDT(pop.dvars().DSL, -math.log10(0.05/pop.totNumLoci()),
(suc,res) = TDT(geneHunter, pop.dvars().DSL, -math.log10(0.05/pop.totNumLoci()),
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...
(suc,res) = Linkage(pop.dvars().DSL, -math.log10(0.05/pop.totNumLoci()),
(suc,res) = Linkage(geneHunter, pop.dvars().DSL, -math.log10(0.05/pop.totNumLoci()),
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...
dryrun, popIdx)
geneHunter, dryrun, popIdx)
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...