code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
read('protein.nex')
a=var.alignments[0]
a.recodeDayhoff()
a.writeNexus('recoded.nex')
| [
[
8,
0,
0.25,
0.25,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.5,
0.25,
0,
0.66,
0.3333,
475,
6,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.75,
0.25,
0,
0.66,
0.6667... | [
"read('protein.nex')",
"a=var.alignments[0]",
"a.recodeDayhoff()",
"a.writeNexus('recoded.nex')"
] |
read("../d.nex")
d = Data()
t = func.randomTree(taxNames=d.taxNames)
t.data = d
t.newComp(free=1, spec='empirical')
t.newRMatrix(free=1, spec='ones')
t.setNGammaCat(nGammaCat=4)
t.newGdasrv(free=1, val=0.5)
t.setPInvar(free=1, val=0.2)
m = Mcmc(t, nChains=4, runNum=0, sampleInterval=10, checkPointInterval=2000)
m.run(4... | [
[
8,
0,
0.0714,
0.0714,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.1429,
0.0714,
0,
0.66,
0.1,
355,
3,
0,
0,
0,
467,
10,
1
],
[
14,
0,
0.2143,
0.0714,
0,
0.... | [
"read(\"../d.nex\")",
"d = Data()",
"t = func.randomTree(taxNames=d.taxNames)",
"t.data = d",
"t.newComp(free=1, spec='empirical')",
"t.newRMatrix(free=1, spec='ones')",
"t.setNGammaCat(nGammaCat=4)",
"t.newGdasrv(free=1, val=0.5)",
"t.setPInvar(free=1, val=0.2)",
"m = Mcmc(t, nChains=4, runNum=0,... |
tp = TreePartitions("mcmc_trees_0.nex", skip=200)
t = tp.consensus()
# put support on node.name's, for the text drawing
for n in t.iterInternalsNoRoot():
n.name = "%.0f" % (100. * n.br.support)
t.draw()
# Save it
t.writeNexus(fName='cons.nex')
| [
[
14,
0,
0.1,
0.1,
0,
0.66,
0,
53,
3,
2,
0,
0,
73,
10,
1
],
[
14,
0,
0.2,
0.1,
0,
0.66,
0.25,
15,
3,
0,
0,
0,
194,
10,
1
],
[
6,
0,
0.55,
0.2,
0,
0.66,
0.5,
... | [
"tp = TreePartitions(\"mcmc_trees_0.nex\", skip=200)",
"t = tp.consensus()",
"for n in t.iterInternalsNoRoot():\n n.name = \"%.0f\" % (100. * n.br.support)",
" n.name = \"%.0f\" % (100. * n.br.support)",
"t.draw()",
"t.writeNexus(fName='cons.nex')"
] |
read("mcmc_trees_0.nex")
tt = Trees()
var.trees = []
read('cons.nex')
t = var.trees[0]
tt.trackSplitsFromTree(t)
| [
[
8,
0,
0.1667,
0.1667,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.3333,
0.1667,
0,
0.66,
0.2,
266,
3,
0,
0,
0,
964,
10,
1
],
[
14,
0,
0.5,
0.1667,
0,
0.66,... | [
"read(\"mcmc_trees_0.nex\")",
"tt = Trees()",
"var.trees = []",
"read('cons.nex')",
"t = var.trees[0]",
"tt.trackSplitsFromTree(t)"
] |
theRunNum = int(var.argvAfterDoubleDash[0])
read("../d.nex")
d = Data()
t = func.randomTree(taxNames=d.taxNames)
t.data = d
t.newComp(free=1, spec='empirical')
t.newRMatrix(free=1, spec='ones')
t.setNGammaCat(nGammaCat=1)
#t.newGdasrv(free=1, val=0.5)
t.setPInvar(free=0, val=0.0)
m = Mcmc(t, nChains=4, runNum=theRunNu... | [
[
14,
0,
0.0526,
0.0526,
0,
0.66,
0,
711,
3,
1,
0,
0,
901,
10,
1
],
[
8,
0,
0.1579,
0.0526,
0,
0.66,
0.0909,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.2105,
0.0526,
0,
... | [
"theRunNum = int(var.argvAfterDoubleDash[0])",
"read(\"../d.nex\")",
"d = Data()",
"t = func.randomTree(taxNames=d.taxNames)",
"t.data = d",
"t.newComp(free=1, spec='empirical')",
"t.newRMatrix(free=1, spec='ones')",
"t.setNGammaCat(nGammaCat=1)",
"t.setPInvar(free=0, val=0.0)",
"m = Mcmc(t, nChai... |
skip=200
tp = TreePartitions("mcmc_trees_0.nex", skip=skip)
tp.read("mcmc_trees_1.nex", skip=skip)
tp.dump()
t = tp.consensus()
# put support on node.name's, for the text drawing
for n in t.iterInternalsNoRoot():
n.name = "%.0f" % (100. * n.br.support)
t.draw()
# Save it
t.writeNexus(fName='cons.nex')
| [
[
14,
0,
0.0769,
0.0769,
0,
0.66,
0,
171,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.1538,
0.0769,
0,
0.66,
0.1429,
53,
3,
2,
0,
0,
73,
10,
1
],
[
8,
0,
0.2308,
0.0769,
0,
0... | [
"skip=200",
"tp = TreePartitions(\"mcmc_trees_0.nex\", skip=skip)",
"tp.read(\"mcmc_trees_1.nex\", skip=skip)",
"tp.dump()",
"t = tp.consensus()",
"for n in t.iterInternalsNoRoot():\n n.name = \"%.0f\" % (100. * n.br.support)",
" n.name = \"%.0f\" % (100. * n.br.support)",
"t.draw()",
"t.write... |
read("../d.nex")
d = Data()
m = func.unPickleMcmc(0, d)
m.run(2000)
m = func.unPickleMcmc(1, d)
m.run(2000)
#n = Numbers('mcmc_likes_0', col=1)
#n.plot()
| [
[
8,
0,
0.1111,
0.1111,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.2222,
0.1111,
0,
0.66,
0.2,
355,
3,
0,
0,
0,
467,
10,
1
],
[
14,
0,
0.3333,
0.1111,
0,
0.... | [
"read(\"../d.nex\")",
"d = Data()",
"m = func.unPickleMcmc(0, d)",
"m.run(2000)",
"m = func.unPickleMcmc(1, d)",
"m.run(2000)"
] |
cpr = McmcCheckPointReader()
cpr.writeProposalAcceptances()
cpr.writeSwapMatrices()
#cpr.writeProposalProbs()
m = cpr.mm[0]
m.tunings.dump(advice=False)
cpr.compareSplits(2, 3)
print "\n\nComparing all splits from all pairs of checkPoints ..."
cpr.compareSplitsAll()
| [
[
14,
0,
0.1,
0.1,
0,
0.66,
0,
973,
3,
0,
0,
0,
433,
10,
1
],
[
8,
0,
0.2,
0.1,
0,
0.66,
0.1429,
215,
3,
0,
0,
0,
0,
0,
1
],
[
8,
0,
0.3,
0.1,
0,
0.66,
0.2857,
... | [
"cpr = McmcCheckPointReader()",
"cpr.writeProposalAcceptances()",
"cpr.writeSwapMatrices()",
"m = cpr.mm[0]",
"m.tunings.dump(advice=False)",
"cpr.compareSplits(2, 3)",
"print(\"\\n\\nComparing all splits from all pairs of checkPoints ...\")",
"cpr.compareSplitsAll()"
] |
read("../d.nex")
d = Data()
t = func.randomTree(taxNames=d.taxNames)
t.data = d
t.newComp(free=1, spec='empirical')
t.newRMatrix(free=1, spec='ones')
t.setNGammaCat(nGammaCat=4)
t.newGdasrv(free=1, val=0.5)
t.setPInvar(free=1, val=0.2)
m = Mcmc(t, nChains=4, runNum=0, sampleInterval=10, checkPointInterval=2000)
m.autoT... | [
[
8,
0,
0.0556,
0.0556,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.1111,
0.0556,
0,
0.66,
0.0714,
355,
3,
0,
0,
0,
467,
10,
1
],
[
14,
0,
0.1667,
0.0556,
0,
... | [
"read(\"../d.nex\")",
"d = Data()",
"t = func.randomTree(taxNames=d.taxNames)",
"t.data = d",
"t.newComp(free=1, spec='empirical')",
"t.newRMatrix(free=1, spec='ones')",
"t.setNGammaCat(nGammaCat=4)",
"t.newGdasrv(free=1, val=0.5)",
"t.setPInvar(free=1, val=0.2)",
"m = Mcmc(t, nChains=4, runNum=0,... |
tp = TreePartitions("mcmc_trees_0.nex", skip=200)
t = tp.consensus()
# put support on node.name's, for the text drawing
for n in t.iterInternalsNoRoot():
n.name = "%.0f" % (100. * n.br.support)
t.draw()
# Save it
t.writeNexus(fName='cons.nex')
| [
[
14,
0,
0.1,
0.1,
0,
0.66,
0,
53,
3,
2,
0,
0,
73,
10,
1
],
[
14,
0,
0.2,
0.1,
0,
0.66,
0.25,
15,
3,
0,
0,
0,
194,
10,
1
],
[
6,
0,
0.55,
0.2,
0,
0.66,
0.5,
... | [
"tp = TreePartitions(\"mcmc_trees_0.nex\", skip=200)",
"t = tp.consensus()",
"for n in t.iterInternalsNoRoot():\n n.name = \"%.0f\" % (100. * n.br.support)",
" n.name = \"%.0f\" % (100. * n.br.support)",
"t.draw()",
"t.writeNexus(fName='cons.nex')"
] |
allTaxNames = ['t0', 't1', 't2', 't3', 't4', 't5', 't6', 't7', 't8', 't9', 't10', 't11', 't12', 't13', 't14', 't15', 't16', 't17', 't18', 't19', 't20', 't21', 't22', 't23', 't24', 't25', 't26', 't27', 't28', 't29', 't30', 't31', 't32', 't33', 't34', 't35', 't36', 't37', 't38', 't39', 't40', 't41', 't42', 't43', 't44']
... | [
[
14,
0,
0.0769,
0.0769,
0,
0.66,
0,
48,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.2308,
0.0769,
0,
0.66,
0.1,
579,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.3077,
0.0769,
0,
0.66,... | [
"allTaxNames = ['t0', 't1', 't2', 't3', 't4', 't5', 't6', 't7', 't8', 't9', 't10', 't11', 't12', 't13', 't14', 't15', 't16', 't17', 't18', 't19', 't20', 't21', 't22', 't23', 't24', 't25', 't26', 't27', 't28', 't29', 't30', 't31', 't32', 't33', 't34', 't35', 't36', 't37', 't38', 't39', 't40', 't41', 't42', 't43', 't... |
nTax = int(var.argvAfterDoubleDash[0])
nTrees = int(var.argvAfterDoubleDash[1])
#taxNames = list(string.uppercase[:20])
t = func.randomTree(nTax=nTax)
#t.draw()
a = func.newEmptyAlignment(dataType='dna', taxNames=t.taxNames, length=10)
t.data = Data([a])
t.newComp(spec='equal')
t.newRMatrix()
t.setPInvar()
t.setNGamma... | [
[
14,
0,
0.0263,
0.0263,
0,
0.66,
0,
186,
3,
1,
0,
0,
901,
10,
1
],
[
14,
0,
0.0526,
0.0263,
0,
0.66,
0.0556,
935,
3,
1,
0,
0,
901,
10,
1
],
[
14,
0,
0.1316,
0.0263,
0,... | [
"nTax = int(var.argvAfterDoubleDash[0])",
"nTrees = int(var.argvAfterDoubleDash[1])",
"t = func.randomTree(nTax=nTax)",
"a = func.newEmptyAlignment(dataType='dna', taxNames=t.taxNames, length=10)",
"t.data = Data([a])",
"t.newComp(spec='equal')",
"t.newRMatrix()",
"t.setPInvar()",
"t.setNGammaCat()"... |
read('paupConTree.nex')
t = var.trees[0]
# The only point of the data is to get a taxNames list.
read('d.nex')
d = Data()
t.taxNames = d.taxNames
t.readBipartitionsFromPaupLogFile('paupLog')
# The support gets put in node.br.support, as a float from 0-1. To
# see it in a drawing or write it in newick format, we mov... | [
[
8,
0,
0.0476,
0.0476,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.0952,
0.0476,
0,
0.66,
0.125,
15,
6,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.2381,
0.0476,
0,
0.66,... | [
"read('paupConTree.nex')",
"t = var.trees[0]",
"read('d.nex')",
"d = Data()",
"t.taxNames = d.taxNames",
"t.readBipartitionsFromPaupLogFile('paupLog')",
"for n in t.root.iterInternals():\n if n != t.root:\n if n.br.support:\n n.name = '%i' % round(100. * float(n.br.support))",
" ... |
tp = TreePartitions('tt.nex')
tp.writeSplits() # If you like this sort of thing ...
t = tp.consensus()
t.draw()
| [
[
14,
0,
0.25,
0.25,
0,
0.66,
0,
53,
3,
1,
0,
0,
73,
10,
1
],
[
8,
0,
0.5,
0.25,
0,
0.66,
0.3333,
98,
3,
0,
0,
0,
0,
0,
1
],
[
14,
0,
0.75,
0.25,
0,
0.66,
0.666... | [
"tp = TreePartitions('tt.nex')",
"tp.writeSplits() # If you like this sort of thing ...",
"t = tp.consensus()",
"t.draw()"
] |
read(""" 2 2
one
ac
two
gt
""")
read('(one,two);')
t = var.trees[0]
t.data = Data()
t.newComp()
t.newRMatrix()
t.setPInvar()
t.calcLogLike()
| [
[
8,
0,
0.2692,
0.4615,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.5385,
0.0769,
0,
0.66,
0.1429,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.6154,
0.0769,
0,
0.6... | [
"read(\"\"\" 2 2\none\nac\ntwo\ngt\n\"\"\")",
"read('(one,two);')",
"t = var.trees[0]",
"t.data = Data()",
"t.newComp()",
"t.newRMatrix()",
"t.setPInvar()",
"t.calcLogLike()"
] |
taxNames = list(string.uppercase[:7])
for i in range(6):
t = func.randomTree(taxNames)
t.name = 't%i' % (i + 1)
var.trees.append(t)
tt = Trees(taxNames=taxNames)
dm = tt.topologyDistanceMatrix('wrf')
dm.writeNexus()
| [
[
14,
0,
0.1111,
0.1111,
0,
0.66,
0,
585,
3,
1,
0,
0,
430,
10,
1
],
[
6,
0,
0.3889,
0.4444,
0,
0.66,
0.25,
826,
3,
0,
0,
0,
0,
0,
3
],
[
14,
1,
0.3333,
0.1111,
1,
0... | [
"taxNames = list(string.uppercase[:7])",
"for i in range(6):\n t = func.randomTree(taxNames)\n t.name = 't%i' % (i + 1)\n var.trees.append(t)",
" t = func.randomTree(taxNames)",
" t.name = 't%i' % (i + 1)",
" var.trees.append(t)",
"tt = Trees(taxNames=taxNames)",
"dm = tt.topologyDista... |
read('t.nex')
t1 = var.trees[0]
t2 = var.trees[1]
# See page 532 in Felsenstein
print "The 'symmetric distance' = ", t1.topologyDistance(t2, metric='sd')
print "The 'weighted Robinson Foulds distance' = ", t1.topologyDistance(t2, metric='wrf')
ret = t1.topologyDistance(t2, metric='bld')
print "The 'branch score' = %... | [
[
8,
0,
0.0909,
0.0909,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.1818,
0.0909,
0,
0.66,
0.1429,
329,
6,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2727,
0.0909,
0,
0.... | [
"read('t.nex')",
"t1 = var.trees[0]",
"t2 = var.trees[1]",
"print(\"The 'symmetric distance' = \", t1.topologyDistance(t2, metric='sd'))",
"print(\"The 'weighted Robinson Foulds distance' = \", t1.topologyDistance(t2, metric='wrf'))",
"ret = t1.topologyDistance(t2, metric='bld')",
"print(\"The 'branch ... |
var.warnReadNoFile = 0
var.verboseRead = 0
read('d.nex')
d = Data()
taxNames = list(string.uppercase[:5])
read('((A, B), C, (D, E));')
read('((D, E), B, (C, A));')
read('((C, E), (B, D), A);')
for i in range(len(var.trees)):
var.trees[i].name = 't%i' % (i + 1)
for t in var.trees:
t.taxNames = taxNames
t.d... | [
[
14,
0,
0.0476,
0.0476,
0,
0.66,
0,
635,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.0952,
0.0476,
0,
0.66,
0.1111,
141,
1,
0,
0,
0,
0,
1,
0
],
[
8,
0,
0.1429,
0.0476,
0,
0.... | [
"var.warnReadNoFile = 0",
"var.verboseRead = 0",
"read('d.nex')",
"d = Data()",
"taxNames = list(string.uppercase[:5])",
"read('((A, B), C, (D, E));')",
"read('((D, E), B, (C, A));')",
"read('((C, E), (B, D), A);')",
"for i in range(len(var.trees)):\n var.trees[i].name = 't%i' % (i + 1)",
" ... |
var.warnReadNoFile = 0
var.verboseRead = 0
read('((D:0.4, E:0.3):0.03, B:0.5, (C:0.3, A:0.4):0.03);')
taxNames = list(string.uppercase[:5])
var.alignments.append(func.newEmptyAlignment(dataType='dna', taxNames=taxNames, length=500))
d = Data()
t = var.trees[0]
t.data = d
t.taxNames = taxNames
t.newComp(partNum=0, free... | [
[
14,
0,
0.0588,
0.0588,
0,
0.66,
0,
635,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.1176,
0.0588,
0,
0.66,
0.0714,
141,
1,
0,
0,
0,
0,
1,
0
],
[
8,
0,
0.2353,
0.0588,
0,
0.... | [
"var.warnReadNoFile = 0",
"var.verboseRead = 0",
"read('((D:0.4, E:0.3):0.03, B:0.5, (C:0.3, A:0.4):0.03);')",
"taxNames = list(string.uppercase[:5])",
"var.alignments.append(func.newEmptyAlignment(dataType='dna', taxNames=taxNames, length=500))",
"d = Data()",
"t = var.trees[0]",
"t.data = d",
"t.t... |
read('d.nex')
d = Data()
for i in range(3):
read('t%i.p4_tPickle' % (i + 1))
tt = Trees()
tt.data = d
if 1:
tt.consel()
else:
tt.rell()
| [
[
8,
0,
0.0909,
0.0909,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.1818,
0.0909,
0,
0.66,
0.2,
355,
3,
0,
0,
0,
467,
10,
1
],
[
6,
0,
0.3182,
0.1818,
0,
0.6... | [
"read('d.nex')",
"d = Data()",
"for i in range(3):\n read('t%i.p4_tPickle' % (i + 1))",
" read('t%i.p4_tPickle' % (i + 1))",
"tt = Trees()",
"tt.data = d",
"if 1:\n tt.consel()\nelse:\n tt.rell()",
" tt.consel()",
" tt.rell()"
] |
var.verboseRead = 0
var.warnReadNoFile = 0
if 1:
read('((A, B), C, (D, E));')
read('((A, B), D, (E, C));')
read('((C, A), (D, B), E);')
taxNames = list(string.uppercase[:5])
theSplitTax = ['A', 'C']
else:
taxNames = list(string.uppercase[:7])
for i in range(30):
var.trees.append(fun... | [
[
14,
0,
0.0435,
0.0435,
0,
0.66,
0,
141,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.087,
0.0435,
0,
0.66,
0.1667,
635,
1,
0,
0,
0,
0,
1,
0
],
[
4,
0,
0.3913,
0.4783,
0,
0.6... | [
"var.verboseRead = 0",
"var.warnReadNoFile = 0",
"if 1:\n read('((A, B), C, (D, E));')\n read('((A, B), D, (E, C));')\n read('((C, A), (D, B), E);')\n taxNames = list(string.uppercase[:5])\n theSplitTax = ['A', 'C']\nelse:\n taxNames = list(string.uppercase[:7])",
" read('((A, B), C, (D, ... |
var.warnReadNoFile = 0
var.verboseRead = 0
func.reseedCRandomizer(os.getpid())
nTax = 5
taxNames = list(string.uppercase[:nTax])
a = func.newEmptyAlignment(dataType='dna', taxNames=taxNames, length=400)
d = Data([a])
t = func.randomTree(taxNames=taxNames)
t.data = d
c1 = t.newComp(free=1, spec='specified', val=[0.1, ... | [
[
14,
0,
0.0556,
0.0556,
0,
0.66,
0,
635,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.1111,
0.0556,
0,
0.66,
0.0714,
141,
1,
0,
0,
0,
0,
1,
0
],
[
8,
0,
0.1667,
0.0556,
0,
0.... | [
"var.warnReadNoFile = 0",
"var.verboseRead = 0",
"func.reseedCRandomizer(os.getpid())",
"nTax = 5",
"taxNames = list(string.uppercase[:nTax])",
"a = func.newEmptyAlignment(dataType='dna', taxNames=taxNames, length=400)",
"d = Data([a])",
"t = func.randomTree(taxNames=taxNames)",
"t.data = d",
"c1 ... |
import sys
nTrees = 15
nSites = 400
fIn = file('siteLikes')
fOut = file('siteLikes.txt', 'w')
fIn.readline() # skip the first line
fOut.write('Tree\t-lnL\tSite\t-lnL\n')
for i in range(nTrees):
for j in range(nSites):
aLine = fIn.readline()
if not aLine:
print 'no workee! Ran out of l... | [
[
1,
0,
0.037,
0.037,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.0741,
0.037,
0,
0.66,
0.1111,
935,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.1111,
0.037,
0,
0.66... | [
"import sys",
"nTrees = 15",
"nSites = 400",
"fIn = file('siteLikes')",
"fOut = file('siteLikes.txt', 'w')",
"fIn.readline() # skip the first line",
"fOut.write('Tree\\t-lnL\\tSite\\t-lnL\\n')",
"for i in range(nTrees):\n for j in range(nSites):\n aLine = fIn.readline()\n if not aLine... |
from p4.MRP import mrp
read('inTrees.phy')
a = mrp(var.trees)
a.writeNexus('mr.nex')
| [
[
1,
0,
0.25,
0.25,
0,
0.66,
0,
347,
0,
1,
0,
0,
347,
0,
0
],
[
8,
0,
0.5,
0.25,
0,
0.66,
0.3333,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.75,
0.25,
0,
0.66,
0.66... | [
"from p4.MRP import mrp",
"read('inTrees.phy')",
"a = mrp(var.trees)",
"a.writeNexus('mr.nex')"
] |
tp = TreePartitions("mcmc_trees_0.nex", skip=500)
tp.read("mcmc_trees_1.nex", skip=500)
t = tp.consensus(minimumProportion=0.5)
for n in t.iterInternalsNoRoot():
n.name = "%.0f" % (100. * n.br.support)
t.draw()
t.name = 'stMcmc'
t.writeNexus('stMcmcCons.nex')
| [
[
14,
0,
0.125,
0.125,
0,
0.66,
0,
53,
3,
2,
0,
0,
73,
10,
1
],
[
8,
0,
0.25,
0.125,
0,
0.66,
0.1667,
453,
3,
2,
0,
0,
0,
0,
1
],
[
14,
0,
0.375,
0.125,
0,
0.66,
... | [
"tp = TreePartitions(\"mcmc_trees_0.nex\", skip=500)",
"tp.read(\"mcmc_trees_1.nex\", skip=500)",
"t = tp.consensus(minimumProportion=0.5)",
"for n in t.iterInternalsNoRoot():\n n.name = \"%.0f\" % (100. * n.br.support)",
" n.name = \"%.0f\" % (100. * n.br.support)",
"t.draw()",
"t.name = 'stMcmc'... |
n = Numbers('mcmc_likes_0', col=1)
n.plot()
if os.path.isfile('mcmc_prams_0'):
n = Numbers('mcmc_prams_0', col=1)
n.plot()
| [
[
14,
0,
0.2,
0.2,
0,
0.66,
0,
773,
3,
2,
0,
0,
818,
10,
1
],
[
8,
0,
0.4,
0.2,
0,
0.66,
0.5,
929,
3,
0,
0,
0,
0,
0,
1
],
[
4,
0,
0.8,
0.6,
0,
0.66,
1,
0,
... | [
"n = Numbers('mcmc_likes_0', col=1)",
"n.plot()",
"if os.path.isfile('mcmc_prams_0'):\n n = Numbers('mcmc_prams_0', col=1)\n n.plot()",
" n = Numbers('mcmc_prams_0', col=1)",
" n.plot()"
] |
read('inTrees.phy')
inTrees = var.trees
var.trees = []
read('stMcmcCons.nex')
read('mrpMajRuleConsTree.nex')
read('mrpStrictConsTree.nex')
var.trees[1].name = 'mrpMajRule'
var.trees[2].name = 'mrpStrict'
tt = Trees(taxNames=var.trees[0].taxNames)
tt.inputTreesToSuperTreeDistances(inTrees)
| [
[
8,
0,
0.0714,
0.0714,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.1429,
0.0714,
0,
0.66,
0.1111,
593,
7,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2143,
0.0714,
0,
0.... | [
"read('inTrees.phy')",
"inTrees = var.trees",
"var.trees = []",
"read('stMcmcCons.nex')",
"read('mrpMajRuleConsTree.nex')",
"read('mrpStrictConsTree.nex')",
"var.trees[1].name = 'mrpMajRule'",
"var.trees[2].name = 'mrpStrict'",
"tt = Trees(taxNames=var.trees[0].taxNames)",
"tt.inputTreesToSuperTre... |
#os.system("rm -f mcmc*")
# (self, inTrees, modelName='SR2008_rf_aZ', beta=1.0, stRFCalc='purePython1', runNum=0, sampleInterval=100, checkPointInterval=None)
# Choose one of these, the fastest available
myCalc='purePython1'
myCalc='bitarray'
#myCalc='fastReducedRF'
read('inTrees.phy')
stm = STMcmc(var.trees, modelN... | [
[
14,
0,
0.3571,
0.0714,
0,
0.66,
0,
669,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.4286,
0.0714,
0,
0.66,
0.1667,
669,
1,
0,
0,
0,
0,
3,
0
],
[
8,
0,
0.6429,
0.0714,
0,
0.... | [
"myCalc='purePython1'",
"myCalc='bitarray'",
"read('inTrees.phy')",
"stm = STMcmc(var.trees, modelName='SR2008_rf_aZ', beta=1.2, stRFCalc=myCalc, runNum=0, sampleInterval=20, checkPointInterval=10000)",
"stm.run(20000)",
"stm = STMcmc(var.trees, modelName='SR2008_rf_aZ', beta=1.2, stRFCalc=myCalc, runNum=... |
cpr = STMcmcCheckPointReader()
cpr.writeProposalAcceptances()
cpr.compareSplits(-2, -1)
| [
[
14,
0,
0.25,
0.25,
0,
0.66,
0,
973,
3,
0,
0,
0,
675,
10,
1
],
[
8,
0,
0.5,
0.25,
0,
0.66,
0.5,
215,
3,
0,
0,
0,
0,
0,
1
],
[
8,
0,
0.75,
0.25,
0,
0.66,
1,
... | [
"cpr = STMcmcCheckPointReader()",
"cpr.writeProposalAcceptances()",
"cpr.compareSplits(-2, -1)"
] |
read('inTrees.phy')
inTrees = var.trees
var.trees = []
read('stMcmcCons.nex')
read('mrpMajRuleConsTree.nex')
read('mrpStrictConsTree.nex')
var.trees[1].name = 'mrpMajRule'
var.trees[2].name = 'mrpStrict'
from p4.SuperTreeSupport import SuperTreeSupport
print "%20s %6s %6s %6s %6s %6s" % (' ', 'S', 'P', 'Q', 'R',... | [
[
8,
0,
0.037,
0.037,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.0741,
0.037,
0,
0.66,
0.1,
593,
7,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1111,
0.037,
0,
0.66,
... | [
"read('inTrees.phy')",
"inTrees = var.trees",
"var.trees = []",
"read('stMcmcCons.nex')",
"read('mrpMajRuleConsTree.nex')",
"read('mrpStrictConsTree.nex')",
"var.trees[1].name = 'mrpMajRule'",
"var.trees[2].name = 'mrpStrict'",
"from p4.SuperTreeSupport import SuperTreeSupport",
"print(\"%20s %6s... |
read('inTrees.phy')
stm = STMcmc(var.trees, sampleInterval=10, beta=2.0)
stm.run(500)
tp = TreePartitions("mcmc_trees_0.nex", skip=25)
t = tp.consensus(minimumProportion=0.5)
for n in t.iterInternalsNoRoot():
n.name = "%.0f" % (100. * n.br.support)
t.draw()
| [
[
8,
0,
0.1,
0.1,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.3,
0.1,
0,
0.66,
0.1667,
580,
3,
3,
0,
0,
927,
10,
1
],
[
8,
0,
0.4,
0.1,
0,
0.66,
0.3333,
... | [
"read('inTrees.phy')",
"stm = STMcmc(var.trees, sampleInterval=10, beta=2.0)",
"stm.run(500)",
"tp = TreePartitions(\"mcmc_trees_0.nex\", skip=25)",
"t = tp.consensus(minimumProportion=0.5)",
"for n in t.iterInternalsNoRoot():\n n.name = \"%.0f\" % (100. * n.br.support)",
" n.name = \"%.0f\" % (10... |
read('master.nex')
t = var.trees[0]
for n in t.iterInternalsNoRoot():
n.name = None
if 1:
one = t.dupe()
one.draw()
one.collapseNode(one.node(36))
| [
[
8,
0,
0.1,
0.1,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.2,
0.1,
0,
0.66,
0.3333,
15,
6,
0,
0,
0,
0,
0,
0
],
[
6,
0,
0.35,
0.2,
0,
0.66,
0.6667,
... | [
"read('master.nex')",
"t = var.trees[0]",
"for n in t.iterInternalsNoRoot():\n n.name = None",
" n.name = None",
"if 1:\n one = t.dupe()\n one.draw()\n one.collapseNode(one.node(36))",
" one = t.dupe()",
" one.draw()",
" one.collapseNode(one.node(36))"
] |
read('t.1111.nex')
read('t555.nex')
read('t43.nex')
read('t39.nex')
read('sets1.nex')
if 1:
t = var.trees[0]
t.setNexusSets()
t.btv()
t = var.trees[1]
t.btv()
# Out with the old nexusSets, in with the new.
var.nexusSets = None
read('sets2.nex')
t = var.trees[2]
t.setNexusSets()
t.tv()
t = var.t... | [
[
8,
0,
0.0357,
0.0357,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.0714,
0.0357,
0,
0.66,
0.0769,
453,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.1071,
0.0357,
0,
0.66... | [
"read('t.1111.nex')",
"read('t555.nex')",
"read('t43.nex')",
"read('t39.nex')",
"read('sets1.nex')",
"if 1:\n t = var.trees[0]\n t.setNexusSets()\n t.btv()\n\n t = var.trees[1]\n t.btv()",
" t = var.trees[0]",
" t.setNexusSets()",
" t.btv()",
" t = var.trees[1]",
" ... |
read('dB.nex')
a = var.alignments[0]
read('mbout.con')
tMB = var.trees[0]
var.trees.pop()
read('paupBootTree.nex')
tPAUP = var.trees[1]
tMB.taxNames = a.taxNames
tPAUP.taxNames = a.taxNames
tMB.tvTopologyCompare(tPAUP)
read('combinedSupportsTree.nex')
tCombined = var.trees[2]
tCombined.tv()
| [
[
8,
0,
0.05,
0.05,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.1,
0.05,
0,
0.66,
0.0833,
475,
6,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.15,
0.05,
0,
0.66,
0.1667... | [
"read('dB.nex')",
"a = var.alignments[0]",
"read('mbout.con')",
"tMB = var.trees[0]",
"var.trees.pop()",
"read('paupBootTree.nex')",
"tPAUP = var.trees[1]",
"tMB.taxNames = a.taxNames",
"tPAUP.taxNames = a.taxNames",
"tMB.tvTopologyCompare(tPAUP)",
"read('combinedSupportsTree.nex')",
"tCombine... |
# Use the mb cons tree as the master, and add supports from the paup boot tree.
# We need an ordered list of taxNames.
read('dB.nex')
a = var.alignments[0]
# a.taxNames is the list we want.
# Read in the two trees. The mrbayes con file has 2 trees; we only
# want the first one.
read('mbout.con')
tMB = var.trees[0] #... | [
[
8,
0,
0.093,
0.0233,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.1163,
0.0233,
0,
0.66,
0.0714,
475,
6,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.2326,
0.0233,
0,
0.66... | [
"read('dB.nex')",
"a = var.alignments[0]",
"read('mbout.con')",
"tMB = var.trees[0] # name the first",
"var.trees.pop() # discard the second",
"read('paupBootTree.nex')",
"tPAUP = var.trees[1] # name it",
"tMB.taxNames = a.taxNames",
"tPAUP.taxNames = a.taxNames",
"tMB.makeSplitKeys()",
"tPAU... |
t = func.randomTree(nTax=20)
t.eps()
t.write()
t.draw()
#os.system('sleep 1; rm random.eps')
| [
[
14,
0,
0.125,
0.125,
0,
0.66,
0,
15,
3,
1,
0,
0,
569,
10,
1
],
[
8,
0,
0.25,
0.125,
0,
0.66,
0.3333,
68,
3,
0,
0,
0,
0,
0,
1
],
[
8,
0,
0.375,
0.125,
0,
0.66,
... | [
"t = func.randomTree(nTax=20)",
"t.eps()",
"t.write()",
"t.draw()"
] |
var.doCheckForDuplicateSequences = False
read('ds.nex')
a=var.alignments[0]
a.writePhylip(None)
b = a.subsetUsingCharSet('cs2')
b.writePhylip(None)
if 0: # Turn on to see some details
a.nexusSets.dump()
| [
[
14,
0,
0.1,
0.1,
0,
0.66,
0,
782,
1,
0,
0,
0,
0,
4,
0
],
[
8,
0,
0.2,
0.1,
0,
0.66,
0.1667,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.3,
0.1,
0,
0.66,
0.3333,
... | [
"var.doCheckForDuplicateSequences = False",
"read('ds.nex')",
"a=var.alignments[0]",
"a.writePhylip(None)",
"b = a.subsetUsingCharSet('cs2')",
"b.writePhylip(None)",
"if 0: # Turn on to see some details\n a.nexusSets.dump()",
" a.nexusSets.dump()"
] |
read('d.nex')
a=var.alignments[0]
a.writePhylip()
m = func.maskFromNexusCharacterList("1 3-5 7 11", a.length, invert=0)
print m
b = a.subsetUsingMask(m)
b.writePhylip()
| [
[
8,
0,
0.1429,
0.1429,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.2857,
0.1429,
0,
0.66,
0.1667,
475,
6,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.4286,
0.1429,
0,
0.6... | [
"read('d.nex')",
"a=var.alignments[0]",
"a.writePhylip()",
"m = func.maskFromNexusCharacterList(\"1 3-5 7 11\", a.length, invert=0)",
"print(m)",
"b = a.subsetUsingMask(m)",
"b.writePhylip()"
] |
var.doCheckForDuplicateSequences=False
read('d.nex')
a=var.alignments[0]
a.setCharPartition('cp1')
d = Data()
d.alignments[0].writePhylip()
oneBoot = d.bootstrap()
oneBoot.alignments[0].writePhylip()
| [
[
14,
0,
0.0909,
0.0909,
0,
0.66,
0,
782,
1,
0,
0,
0,
0,
4,
0
],
[
8,
0,
0.1818,
0.0909,
0,
0.66,
0.1429,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.2727,
0.0909,
0,
0.... | [
"var.doCheckForDuplicateSequences=False",
"read('d.nex')",
"a=var.alignments[0]",
"a.setCharPartition('cp1')",
"d = Data()",
"d.alignments[0].writePhylip()",
"oneBoot = d.bootstrap()",
"oneBoot.alignments[0].writePhylip()"
] |
var.verboseRead = 0
var.doCheckForDuplicateSequences=False
read('ds.nex')
if 0:
var.nexusSets.dump()
if 1:
a=var.alignments[0]
a.writePhylip(None)
c = a.subsetUsingCharSet('cs2', inverse=True)
c.writePhylip(None)
if 1:
b = var.alignments[1]
b.writePhylip(None)
c = b.subsetUsingCharSet... | [
[
14,
0,
0.0556,
0.0556,
0,
0.66,
0,
141,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.1111,
0.0556,
0,
0.66,
0.2,
782,
1,
0,
0,
0,
0,
4,
0
],
[
8,
0,
0.2222,
0.0556,
0,
0.66,... | [
"var.verboseRead = 0",
"var.doCheckForDuplicateSequences=False",
"read('ds.nex')",
"if 0:\n var.nexusSets.dump()",
" var.nexusSets.dump()",
"if 1:\n a=var.alignments[0]\n a.writePhylip(None)\n c = a.subsetUsingCharSet('cs2', inverse=True)\n c.writePhylip(None)",
" a=var.alignments[0... |
var.doCheckForDuplicateSequences = False
var.verboseRead = 0
read('ds.nex')
b = var.alignments[1]
b.writePhylip()
b.excludeCharSet('cs2')
b.writePhylip()
b.setCharPartition('cD')
d = Data()
d.dump()
b.setCharPartition(None)
d = Data()
d.dump()
| [
[
14,
0,
0.0625,
0.0625,
0,
0.66,
0,
782,
1,
0,
0,
0,
0,
4,
0
],
[
14,
0,
0.125,
0.0625,
0,
0.66,
0.0833,
141,
1,
0,
0,
0,
0,
1,
0
],
[
8,
0,
0.25,
0.0625,
0,
0.66,... | [
"var.doCheckForDuplicateSequences = False",
"var.verboseRead = 0",
"read('ds.nex')",
"b = var.alignments[1]",
"b.writePhylip()",
"b.excludeCharSet('cs2')",
"b.writePhylip()",
"b.setCharPartition('cD')",
"d = Data()",
"d.dump()",
"b.setCharPartition(None)",
"d = Data()",
"d.dump()"
] |
# Do an MCMC.
read("d.nex")
d = Data()
t = func.randomTree(taxNames=d.taxNames)
t.data = d
t.newComp(free=1, spec='empirical')
t.newRMatrix(free=1, spec='ones')
t.setNGammaCat(nGammaCat=4)
t.newGdasrv(free=1, val=0.5)
t.setPInvar(free=1, val=0.2)
m = Mcmc(t, nChains=4, runNum=0, sampleInterval=1000, checkPointInterval=... | [
[
8,
0,
0.1333,
0.0667,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.2,
0.0667,
0,
0.66,
0.0909,
355,
3,
0,
0,
0,
467,
10,
1
],
[
14,
0,
0.2667,
0.0667,
0,
0.... | [
"read(\"d.nex\")",
"d = Data()",
"t = func.randomTree(taxNames=d.taxNames)",
"t.data = d",
"t.newComp(free=1, spec='empirical')",
"t.newRMatrix(free=1, spec='ones')",
"t.setNGammaCat(nGammaCat=4)",
"t.newGdasrv(free=1, val=0.5)",
"t.setPInvar(free=1, val=0.2)",
"m = Mcmc(t, nChains=4, runNum=0, sa... |
# Simulate data
if 0:
read("d.nex")
d = Data()
if 1:
nTax = 5
taxNames = list(string.uppercase[:nTax])
a = func.newEmptyAlignment(dataType='dna', taxNames=taxNames, length=200)
d = Data([a])
if 0:
read("t.nex")
t = var.trees[0]
#t.taxNames = taxNames
if 0:
read('(B:0.5, ((D:0.4,... | [
[
4,
0,
0.0833,
0.0833,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
2
],
[
8,
1,
0.0833,
0.0278,
1,
0.3,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
1,
0.1111,
0.0278,
1,
0.3,
1,... | [
"if 0:\n read(\"d.nex\")\n d = Data()",
" read(\"d.nex\")",
" d = Data()",
"if 1:\n nTax = 5\n taxNames = list(string.uppercase[:nTax])\n a = func.newEmptyAlignment(dataType='dna', taxNames=taxNames, length=200)\n d = Data([a])",
" nTax = 5",
" taxNames = list(string.uppercas... |
# Make a consensus tree, with variations.
mySkip = 500
tp = TreePartitions("mcmc_trees_0.nex", skip=mySkip)
# read another file
tp.read("mcmc_trees_1.nex", skip=mySkip)
t = tp.consensus()
# Re-root
t.reRoot(t.node('myOutTaxon').parent)
# Collapse poorly supported nodes
toCollapse = [n for n in t.iterInternalsNoRoot... | [
[
14,
0,
0.087,
0.0435,
0,
0.66,
0,
8,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.1304,
0.0435,
0,
0.66,
0.1111,
53,
3,
2,
0,
0,
73,
10,
1
],
[
8,
0,
0.2609,
0.0435,
0,
0.66... | [
"mySkip = 500",
"tp = TreePartitions(\"mcmc_trees_0.nex\", skip=mySkip)",
"tp.read(\"mcmc_trees_1.nex\", skip=mySkip)",
"t = tp.consensus()",
"t.reRoot(t.node('myOutTaxon').parent)",
"toCollapse = [n for n in t.iterInternalsNoRoot() if n.br.support < 0.7]",
"for n in toCollapse:\n t.collapseNode(n)",... |
# Make a consensus tree, uncomplicated.
tp = TreePartitions("mcmc_trees_0.nex", skip=500)
t = tp.consensus()
for n in t.iterInternalsNoRoot():
n.name = "%.0f" % (100. * n.br.support)
t.draw()
t.writeNexus('cons.nex')
| [
[
14,
0,
0.2857,
0.1429,
0,
0.66,
0,
53,
3,
2,
0,
0,
73,
10,
1
],
[
14,
0,
0.4286,
0.1429,
0,
0.66,
0.25,
15,
3,
0,
0,
0,
194,
10,
1
],
[
6,
0,
0.6429,
0.2857,
0,
0... | [
"tp = TreePartitions(\"mcmc_trees_0.nex\", skip=500)",
"t = tp.consensus()",
"for n in t.iterInternalsNoRoot():\n n.name = \"%.0f\" % (100. * n.br.support)",
" n.name = \"%.0f\" % (100. * n.br.support)",
"t.draw()",
"t.writeNexus('cons.nex')"
] |
# Calculate likelihood with more than one data partition.
read("d.nex")
a = var.alignments[0]
a.setCharPartition('p1')
d = Data()
#d.dump()
read("t.nex")
t = var.trees[0]
t.data = d
pNum = 0
t.newComp(partNum=pNum, free=0, spec='empirical')
t.newRMatrix(partNum=pNum, free=1, spec='ones')
t.setNGammaCat(partNum=pNum, ... | [
[
8,
0,
0.0588,
0.0294,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.0882,
0.0294,
0,
0.66,
0.0435,
475,
6,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.1176,
0.0294,
0,
0.6... | [
"read(\"d.nex\")",
"a = var.alignments[0]",
"a.setCharPartition('p1')",
"d = Data()",
"read(\"t.nex\")",
"t = var.trees[0]",
"t.data = d",
"pNum = 0",
"t.newComp(partNum=pNum, free=0, spec='empirical')",
"t.newRMatrix(partNum=pNum, free=1, spec='ones')",
"t.setNGammaCat(partNum=pNum, nGammaCat=4... |
# Calculate a likelihood.
read("d.nex")
d = Data()
read("t.nex")
t = var.trees[0]
t.data = d
t.newComp(free=1, spec='empirical')
t.newRMatrix(free=0, spec='ones')
t.setNGammaCat(nGammaCat=4)
t.newGdasrv(free=1, val=0.5)
t.setPInvar(free=1, val=0.2)
t.optLogLike()
t.writeNexus('optTree.nex')
t.model.dump()
| [
[
8,
0,
0.1111,
0.0556,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.1667,
0.0556,
0,
0.66,
0.0833,
355,
3,
0,
0,
0,
467,
10,
1
],
[
8,
0,
0.2778,
0.0556,
0,
... | [
"read(\"d.nex\")",
"d = Data()",
"read(\"t.nex\")",
"t = var.trees[0]",
"t.data = d",
"t.newComp(free=1, spec='empirical')",
"t.newRMatrix(free=0, spec='ones')",
"t.setNGammaCat(nGammaCat=4)",
"t.newGdasrv(free=1, val=0.5)",
"t.setPInvar(free=1, val=0.2)",
"t.optLogLike()",
"t.writeNexus('optT... |
# Restart an MCMC.
read("d.nex")
d = Data()
m = func.unPickleMcmc(0, d)
if 0:
m.tunings.chainTemp = 0.15
m.tunings.relRate = 1.2
#m.tunings.parts[0].rMatrix = 1000.0
#m.tunings.parts[0].comp = 50.
#m.prob.comp = 0
m.run(4000)
| [
[
8,
0,
0.1538,
0.0769,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.2308,
0.0769,
0,
0.66,
0.25,
355,
3,
0,
0,
0,
467,
10,
1
],
[
14,
0,
0.3077,
0.0769,
0,
0... | [
"read(\"d.nex\")",
"d = Data()",
"m = func.unPickleMcmc(0, d)",
"if 0:\n m.tunings.chainTemp = 0.15\n m.tunings.relRate = 1.2",
" m.tunings.chainTemp = 0.15",
" m.tunings.relRate = 1.2",
"m.run(4000)"
] |
# Simulate very hetero data
# Below you specify the dataType, length, and relRate of each data
# partition (and symbols, if it is standard dataType). There is one
# part per alignment, in this example. You also specify the number of
# taxa in the tree
import random
import math
def randomNumbersThatSumTo1(length, m... | [
[
1,
0,
0.1053,
0.0132,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.1184,
0.0132,
0,
0.66,
0.0476,
526,
0,
1,
0,
0,
526,
0,
0
],
[
2,
0,
0.1974,
0.1184,
0,
... | [
"import random",
"import math",
"def randomNumbersThatSumTo1(length, minimum):\n maximum = 1.0 - ((length - 1) * minimum)\n myRange = maximum - minimum\n rnn = [random.random() for i in range(length)]\n mySum = sum(rnn)\n rnn = [minimum + (rn / (mySum / myRange)) for rn in rnn]\n assert math.f... |
# Read checkPoints from an MCMC.
# Read them in ...
cpr = McmcCheckPointReader(theGlob='*')
# A table of acceptances
cpr.writeProposalAcceptances()
# Compare splits using average std deviation of split frequencies
#cpr.compareSplitsAll()
# or between only two checkpoints ...
#cpr.compareSplits(0, 1)
# How was swapp... | [
[
14,
0,
0.1667,
0.0417,
0,
0.66,
0,
973,
3,
1,
0,
0,
433,
10,
1
],
[
8,
0,
0.2917,
0.0417,
0,
0.66,
0.5,
215,
3,
0,
0,
0,
0,
0,
1
],
[
4,
0,
0.875,
0.125,
0,
0.66,... | [
"cpr = McmcCheckPointReader(theGlob='*')",
"cpr.writeProposalAcceptances()",
"if 0:\n m = cpr.mm[0]\n print(m.tunings)",
" m = cpr.mm[0]",
" print(m.tunings)"
] |
# Do an MCMC with more than one data partition.
read("d.nex")
a = var.alignments[0]
a.setCharPartition('p1')
d = Data()
t = func.randomTree(taxNames=d.taxNames)
t.data = d
pNum = 0
t.newComp(partNum=pNum, free=1, spec='empirical')
t.newRMatrix(partNum=pNum, free=1, spec='ones')
t.setNGammaCat(partNum=pNum, nGammaCat=4... | [
[
8,
0,
0.0645,
0.0323,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.0968,
0.0323,
0,
0.66,
0.0455,
475,
6,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.129,
0.0323,
0,
0.66... | [
"read(\"d.nex\")",
"a = var.alignments[0]",
"a.setCharPartition('p1')",
"d = Data()",
"t = func.randomTree(taxNames=d.taxNames)",
"t.data = d",
"pNum = 0",
"t.newComp(partNum=pNum, free=1, spec='empirical')",
"t.newRMatrix(partNum=pNum, free=1, spec='ones')",
"t.setNGammaCat(partNum=pNum, nGammaCa... |
# Simulate data with more than one data partition.
nTax = 5
taxNames = list(string.uppercase[:nTax])
dnaAlign = func.newEmptyAlignment(dataType='dna', taxNames=taxNames, length=300)
read(r"#nexus begin sets; charpartition p1 = first:1-100, second:101-.; end;")
dnaAlign.setCharPartition('p1')
d = Data([dnaAlign])
#d.du... | [
[
14,
0,
0.0588,
0.0294,
0,
0.66,
0,
186,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.0882,
0.0294,
0,
0.66,
0.0417,
585,
3,
1,
0,
0,
430,
10,
1
],
[
14,
0,
0.1471,
0.0294,
0,
... | [
"nTax = 5",
"taxNames = list(string.uppercase[:nTax])",
"dnaAlign = func.newEmptyAlignment(dataType='dna', taxNames=taxNames, length=300)",
"read(r\"#nexus begin sets; charpartition p1 = first:1-100, second:101-.; end;\")",
"dnaAlign.setCharPartition('p1')",
"d = Data([dnaAlign])",
"read(\"t.nex\")",
... |
read("d3_noDupes.phy")
a = var.alignments[0]
dm = a.pDistances()
t = dm.njUsingPaup()
t.draw(addToBrLen=0.0)
t.writeNexus('njTree.nex')
| [
[
8,
0,
0.1667,
0.1667,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.3333,
0.1667,
0,
0.66,
0.2,
475,
6,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.5,
0.1667,
0,
0.66,
... | [
"read(\"d3_noDupes.phy\")",
"a = var.alignments[0]",
"dm = a.pDistances()",
"t = dm.njUsingPaup()",
"t.draw(addToBrLen=0.0)",
"t.writeNexus('njTree.nex')"
] |
nTax = 10
taxNames = list(string.uppercase[:nTax])
a = func.newEmptyAlignment(dataType='dna', taxNames=taxNames, length=96)
d = Data([a])
t = func.randomTree(taxNames=taxNames)
t.data = d
t.newComp(free=0, spec='specified', val=[0.1, 0.2, 0.3])
t.newRMatrix(free=0, spec='specified', val=[2., 3., 4., 5., 6., 7.])
t.setN... | [
[
14,
0,
0.0278,
0.0278,
0,
0.66,
0,
186,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.0556,
0.0278,
0,
0.66,
0.0667,
585,
3,
1,
0,
0,
430,
10,
1
],
[
14,
0,
0.0833,
0.0278,
0,
... | [
"nTax = 10",
"taxNames = list(string.uppercase[:nTax])",
"a = func.newEmptyAlignment(dataType='dna', taxNames=taxNames, length=96)",
"d = Data([a])",
"t = func.randomTree(taxNames=taxNames)",
"t.data = d",
"t.newComp(free=0, spec='specified', val=[0.1, 0.2, 0.3])",
"t.newRMatrix(free=0, spec='specifie... |
read('d3.nex')
a = var.alignments[0]
a.checkForDuplicateSequences(removeDupes=True, makeDict=True)
a.writePhylip(fName='d3_noDupes.phy')
| [
[
8,
0,
0.1667,
0.1667,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.3333,
0.1667,
0,
0.66,
0.3333,
475,
6,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.5,
0.1667,
0,
0.66,
... | [
"read('d3.nex')",
"a = var.alignments[0]",
"a.checkForDuplicateSequences(removeDupes=True, makeDict=True)",
"a.writePhylip(fName='d3_noDupes.phy')"
] |
read('njTree.nex')
t = var.trees[0]
t.restoreDupeTaxa()
t.draw(addToBrLen=0.0)
t.writeNexus(fName='restoredNJTree.nex')
| [
[
8,
0,
0.2,
0.2,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.4,
0.2,
0,
0.66,
0.25,
15,
6,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.6,
0.2,
0,
0.66,
0.5,
459,
... | [
"read('njTree.nex')",
"t = var.trees[0]",
"t.restoreDupeTaxa()",
"t.draw(addToBrLen=0.0)",
"t.writeNexus(fName='restoredNJTree.nex')"
] |
var.warnReadNoFile = False
instring = """CLUSTAL W (1.83) multiple sequence alignment
two ACCGTATGCTATCGTATTAGCGTATCGTATTAGGCTATT-ATGCGTAATCG---------
four ACCGTATTCT-TAGCGT-AGCTTAGCGGCATTCGGTACG-ATTCGTATTCGGTTAGCTAG
three ACCGTATCGTATCGTAT--TCGGTACGTAGTATATTACGTATGCTTATTACGTATTATCG
o... | [
[
14,
0,
0.0526,
0.0526,
0,
0.66,
0,
635,
1,
0,
0,
0,
0,
4,
0
],
[
14,
0,
0.4474,
0.7368,
0,
0.66,
0.3333,
627,
1,
0,
0,
0,
0,
3,
0
],
[
8,
0,
0.8947,
0.0526,
0,
0.... | [
"var.warnReadNoFile = False",
"instring = \"\"\"CLUSTAL W (1.83) multiple sequence alignment\n\n\ntwo ACCGTATGCTATCGTATTAGCGTATCGTATTAGGCTATT-ATGCGTAATCG---------\nfour ACCGTATTCT-TAGCGT-AGCTTAGCGGCATTCGGTACG-ATTCGTATTCGGTTAGCTAG\nthree ACCGTATCGTATCGTAT--TCGGTACGTAGTATATTACGTATGC... |
from p4.LeafSupport import CherryRemover
#These three lines removes the cherries and saves the resulting trees in a file.
rc = CherryRemover('../input.nex')
rc.removeCherries()
rc.saveTrees('input.cherries.removed.nex')
ls = LeafSupport('input.cherries.removed.nex')
ls.defineClade(['Pholiderpeton','Proterogyrinus',... | [
[
1,
0,
0.0238,
0.0238,
0,
0.66,
0,
633,
0,
1,
0,
0,
633,
0,
0
],
[
14,
0,
0.0952,
0.0238,
0,
0.66,
0.0714,
401,
3,
1,
0,
0,
242,
10,
1
],
[
8,
0,
0.119,
0.0238,
0,
... | [
"from p4.LeafSupport import CherryRemover",
"rc = CherryRemover('../input.nex')",
"rc.removeCherries()",
"rc.saveTrees('input.cherries.removed.nex')",
"ls = LeafSupport('input.cherries.removed.nex')",
"ls.defineClade(['Pholiderpeton','Proterogyrinus', 'Baphetes',\n 'Megalocephalus', 'Loxomm... |
from p4.LeafSupport import CherryRemover
#These three lines removes the cherries and saves the resulting trees in a file.
rc = CherryRemover('../input.nex')
rc.removeCherries()
rc.saveTrees('input.cherries.removed.nex')
#The file is then used to calculate the leaf stabilities
ls = LeafSupport('input.cherries.removed... | [
[
1,
0,
0.0625,
0.0625,
0,
0.66,
0,
633,
0,
1,
0,
0,
633,
0,
0
],
[
14,
0,
0.25,
0.0625,
0,
0.66,
0.1667,
401,
3,
1,
0,
0,
242,
10,
1
],
[
8,
0,
0.3125,
0.0625,
0,
... | [
"from p4.LeafSupport import CherryRemover",
"rc = CherryRemover('../input.nex')",
"rc.removeCherries()",
"rc.saveTrees('input.cherries.removed.nex')",
"ls = LeafSupport('input.cherries.removed.nex')",
"ls.removeCherries=True",
"ls.leafSupport()"
] |
ls = LeafSupport('../input.nex')
# Defining a tax set will create a list of stabilities using only
# quartets or triplets defined by the members of set. This allows the
# user to investigate any set of taxa and there relative stabilities.
ls.defineTaxSet(['Eusthenoperon','Baphetes', 'Megalocephalus',
... | [
[
14,
0,
0.0714,
0.0714,
0,
0.66,
0,
174,
3,
1,
0,
0,
137,
10,
1
],
[
8,
0,
0.5357,
0.1429,
0,
0.66,
0.5,
350,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.7143,
0.0714,
0,
0.6... | [
"ls = LeafSupport('../input.nex')",
"ls.defineTaxSet(['Eusthenoperon','Baphetes', 'Megalocephalus',\n 'Loxomma','Crassigyrinus' ,'Eucritta' ,'Whatcheeria'])",
"ls.leafSupport()"
] |
ls = LeafSupport('../input.nex')
# A group of taxa is defined like so. Defining a group will create a
# list of stabilities based on the quartets or triplets defined by the
# boundary of the group, i.e. only quartets that have one side in the
# group and the other outside the group will be included. This will
# make i... | [
[
14,
0,
0.05,
0.05,
0,
0.66,
0,
174,
3,
1,
0,
0,
137,
10,
1
],
[
8,
0,
0.575,
0.2,
0,
0.66,
0.5,
684,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.8,
0.05,
0,
0.66,
1,
... | [
"ls = LeafSupport('../input.nex')",
"ls.defineGroup(['Pholiderpeton', 'Proterogyrinus', 'Baphetes',\n 'Megalocephalus', 'Loxomma', 'Balanerpeton'\n ,'Dendrerpeton' ,'Gephyrostegus', 'Crassigyrinus'\n ,'Eucritta' ,'Whatcheeria'])",
"ls.leafSupport()"
] |
ls = LeafSupport('../input.nex')
#Set writeCsv to true to output the resulting lists to a csv file.
ls.writeCsv = False
#The csv filename can be specified, default name is leafSupport.csv
ls.csvFilename='leafSupport.csv'
ls.leafSupport()
| [
[
14,
0,
0.0909,
0.0909,
0,
0.66,
0,
174,
3,
1,
0,
0,
137,
10,
1
],
[
14,
0,
0.3636,
0.0909,
0,
0.66,
0.3333,
264,
1,
0,
0,
0,
0,
4,
0
],
[
14,
0,
0.5455,
0.0909,
0,
... | [
"ls = LeafSupport('../input.nex')",
"ls.writeCsv = False",
"ls.csvFilename='leafSupport.csv'",
"ls.leafSupport()"
] |
ls = LeafSupport('../input.nex')
#Setting the proportion of quartets or triplets to sample, range 0.0 - 1.0
ls.useAllQuartets = False
ls.noQuartetsToUse=0.4
ls.leafSupport()
| [
[
14,
0,
0.125,
0.125,
0,
0.66,
0,
174,
3,
1,
0,
0,
137,
10,
1
],
[
14,
0,
0.5,
0.125,
0,
0.66,
0.3333,
131,
1,
0,
0,
0,
0,
4,
0
],
[
14,
0,
0.625,
0.125,
0,
0.66,
... | [
"ls = LeafSupport('../input.nex')",
"ls.useAllQuartets = False",
"ls.noQuartetsToUse=0.4",
"ls.leafSupport()"
] |
ls = LeafSupport('../input.nex')
# A clade can be specified using the taxon names in the following
# way. This will produce a list of stabilities using only the quartets
# or triplets that are defined by the taxa in the clade.
ls.defineClade(['Pholiderpeton', 'Proterogyrinus', 'Baphetes',
'Megalocephal... | [
[
14,
0,
0.0385,
0.0385,
0,
0.66,
0,
174,
3,
1,
0,
0,
137,
10,
1
],
[
8,
0,
0.2885,
0.1538,
0,
0.66,
0.3333,
817,
3,
1,
0,
0,
0,
0,
1
],
[
4,
0,
0.6923,
0.1154,
0,
... | [
"ls = LeafSupport('../input.nex')",
"ls.defineClade(['Pholiderpeton', 'Proterogyrinus', 'Baphetes',\n 'Megalocephalus', 'Loxomma', 'Balanerpeton'\n ,'Dendrerpeton' ,'Gephyrostegus', 'Crassigyrinus'\n ,'Eucritta' ,'Whatcheeria'])",
"if 0:\n ls.exploreClades=True\n ... |
read('../../noTRuberNoGapsNoAmbiguities.nex')
d = Data()
read('../../tt.nex')
for t in var.trees:
t.data = d
t.newComp(free=1, spec='empirical')
t.newRMatrix(free=1, spec='ones')
t.setNGammaCat(nGammaCat=4)
t.newGdasrv(free=1, val=0.5)
t.setPInvar(free=0, val=0.0)
t.optLogLike()
tt = Trees... | [
[
8,
0,
0.0556,
0.0556,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.1111,
0.0556,
0,
0.66,
0.1667,
355,
3,
0,
0,
0,
467,
10,
1
],
[
8,
0,
0.1667,
0.0556,
0,
... | [
"read('../../noTRuberNoGapsNoAmbiguities.nex')",
"d = Data()",
"read('../../tt.nex')",
"for t in var.trees:\n t.data = d\n t.newComp(free=1, spec='empirical')\n t.newRMatrix(free=1, spec='ones')\n t.setNGammaCat(nGammaCat=4)\n t.newGdasrv(free=1, val=0.5)\n t.setPInvar(free=0, val=0.0)\n ... |
theRunNum = 0
read('../../noTRuberNoGapsNoAmbiguities.nex')
d = Data()
t = func.randomTree(taxNames=d.taxNames)
t.data = d
t.newComp(free=1, spec='empirical')
t.newRMatrix(free=1, spec='ones')
t.setNGammaCat(nGammaCat=4)
t.newGdasrv(free=1, val=0.5)
t.setPInvar(free=0, val=0.0)
m = Mcmc(t, nChains=4, runNum=theRunNum... | [
[
14,
0,
0.0222,
0.0222,
0,
0.66,
0,
711,
1,
0,
0,
0,
0,
1,
0
],
[
8,
0,
0.0667,
0.0222,
0,
0.66,
0.0588,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.0889,
0.0222,
0,
0.... | [
"theRunNum = 0",
"read('../../noTRuberNoGapsNoAmbiguities.nex')",
"d = Data()",
"t = func.randomTree(taxNames=d.taxNames)",
"t.data = d",
"t.newComp(free=1, spec='empirical')",
"t.newRMatrix(free=1, spec='ones')",
"t.setNGammaCat(nGammaCat=4)",
"t.newGdasrv(free=1, val=0.5)",
"t.setPInvar(free=0, ... |
tp = TreePartitions('mcmc_trees_0.nex', skip=1000)
t = tp.consensus()
for n in t.iterInternalsNoRoot():
n.name = '%.0f' % (100.0 * n.br.support)
t.write()
t.draw(width=30, showNodeNums=0)
| [
[
14,
0,
0.1111,
0.1111,
0,
0.66,
0,
53,
3,
2,
0,
0,
73,
10,
1
],
[
14,
0,
0.2222,
0.1111,
0,
0.66,
0.25,
15,
3,
0,
0,
0,
194,
10,
1
],
[
6,
0,
0.5,
0.2222,
0,
0.66... | [
"tp = TreePartitions('mcmc_trees_0.nex', skip=1000)",
"t = tp.consensus()",
"for n in t.iterInternalsNoRoot():\n n.name = '%.0f' % (100.0 * n.br.support)",
" n.name = '%.0f' % (100.0 * n.br.support)",
"t.write()",
"t.draw(width=30, showNodeNums=0)"
] |
read('../../noTRuberNoGapsNoAmbiguities.nex')
d = Data()
# Unconstrained likelihood
d.calcUnconstrainedLogLikelihood2() # Installs the result in d.unconstrainedLogLikelihood
unk = d.unconstrainedLogLikelihood
n = Numbers('mcmc_sims_0', col=1, skip=1000)
print 'Original unconstrained log like is %s' % unk
print 'Here i... | [
[
8,
0,
0.0455,
0.0455,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.0909,
0.0455,
0,
0.66,
0.0625,
355,
3,
0,
0,
0,
467,
10,
1
],
[
8,
0,
0.2273,
0.0455,
0,
... | [
"read('../../noTRuberNoGapsNoAmbiguities.nex')",
"d = Data()",
"d.calcUnconstrainedLogLikelihood2() # Installs the result in d.unconstrainedLogLikelihood",
"unk = d.unconstrainedLogLikelihood",
"n = Numbers('mcmc_sims_0', col=1, skip=1000)",
"print('Original unconstrained log like is %s' % unk)",
"print... |
read('../../tt.nex')
t = var.trees[1] # Under this model, the attract tree is the ML tree
read('../../noTRuberNoGapsNoAmbiguities.nex')
t.data = Data()
t.newComp(free=1, spec='empirical')
t.newRMatrix(free=1, spec='ones')
t.setNGammaCat(nGammaCat=4)
t.newGdasrv(free=1, val=0.5)
t.setPInvar(free=0, val=0.0)
t.optLogLike... | [
[
8,
0,
0.0769,
0.0769,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.1538,
0.0769,
0,
0.66,
0.0909,
15,
6,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.2308,
0.0769,
0,
0.66... | [
"read('../../tt.nex')",
"t = var.trees[1] # Under this model, the attract tree is the ML tree",
"read('../../noTRuberNoGapsNoAmbiguities.nex')",
"t.data = Data()",
"t.newComp(free=1, spec='empirical')",
"t.newRMatrix(free=1, spec='ones')",
"t.setNGammaCat(nGammaCat=4)",
"t.newGdasrv(free=1, val=0.5)",... |
var.verboseRead = 0
read('../../noTRuberNoGapsNoAmbiguities.nex')
d = Data()
read('opt.p4_tPickle')
t = var.trees[0]
t.data = d
t.compoTestUsingSimulations(nSims=100, doIndividualSequences=0, doChiSquare=1, verbose=1)
| [
[
14,
0,
0.1429,
0.1429,
0,
0.66,
0,
141,
1,
0,
0,
0,
0,
1,
0
],
[
8,
0,
0.2857,
0.1429,
0,
0.66,
0.1667,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.4286,
0.1429,
0,
0.... | [
"var.verboseRead = 0",
"read('../../noTRuberNoGapsNoAmbiguities.nex')",
"d = Data()",
"read('opt.p4_tPickle')",
"t = var.trees[0]",
"t.data = d",
"t.compoTestUsingSimulations(nSims=100, doIndividualSequences=0, doChiSquare=1, verbose=1)"
] |
read('../../noTRuberNoGapsNoAmbiguities.nex')
d = Data()
read('../../tt.nex')
for t in var.trees:
t.data = d
c1 = t.newComp(free=1, spec='empirical')
c2 = t.newComp(free=1, spec='empirical')
t.newRMatrix(free=1, spec='ones')
t.setNGammaCat(nGammaCat=4)
t.newGdasrv(free=1, val=0.5)
t.setPInv... | [
[
8,
0,
0.0455,
0.0455,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.0909,
0.0455,
0,
0.66,
0.1667,
355,
3,
0,
0,
0,
467,
10,
1
],
[
8,
0,
0.1364,
0.0455,
0,
... | [
"read('../../noTRuberNoGapsNoAmbiguities.nex')",
"d = Data()",
"read('../../tt.nex')",
"for t in var.trees:\n t.data = d\n c1 = t.newComp(free=1, spec='empirical')\n c2 = t.newComp(free=1, spec='empirical')\n t.newRMatrix(free=1, spec='ones')\n t.setNGammaCat(nGammaCat=4)\n t.newGdasrv(free=... |
read('../../noTRuberNoGapsNoAmbiguities.nex')
d = Data()
t = func.randomTree(taxNames=d.taxNames)
t.data = d
t.newComp(free=1, spec='empirical')
t.newComp(free=1, spec='empirical')
t.newRMatrix(free=1, spec='ones')
t.setNGammaCat(nGammaCat=4)
t.newGdasrv(free=1, val=0.5)
t.setPInvar(free=0, val=0.0)
t.setModelThingsRa... | [
[
8,
0,
0.0222,
0.0222,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.0444,
0.0222,
0,
0.66,
0.0556,
355,
3,
0,
0,
0,
467,
10,
1
],
[
14,
0,
0.0889,
0.0222,
0,
... | [
"read('../../noTRuberNoGapsNoAmbiguities.nex')",
"d = Data()",
"t = func.randomTree(taxNames=d.taxNames)",
"t.data = d",
"t.newComp(free=1, spec='empirical')",
"t.newComp(free=1, spec='empirical')",
"t.newRMatrix(free=1, spec='ones')",
"t.setNGammaCat(nGammaCat=4)",
"t.newGdasrv(free=1, val=0.5)",
... |
tp = TreePartitions('mcmc_trees_0.nex', skip=1000)
t = tp.consensus()
for n in t.iterInternalsNoRoot():
n.name = '%.0f' % (100.0 * n.br.support)
t.write()
t.draw(width=30, showNodeNums=0)
| [
[
14,
0,
0.1111,
0.1111,
0,
0.66,
0,
53,
3,
2,
0,
0,
73,
10,
1
],
[
14,
0,
0.2222,
0.1111,
0,
0.66,
0.25,
15,
3,
0,
0,
0,
194,
10,
1
],
[
6,
0,
0.5,
0.2222,
0,
0.66... | [
"tp = TreePartitions('mcmc_trees_0.nex', skip=1000)",
"t = tp.consensus()",
"for n in t.iterInternalsNoRoot():\n n.name = '%.0f' % (100.0 * n.br.support)",
" n.name = '%.0f' % (100.0 * n.br.support)",
"t.write()",
"t.draw(width=30, showNodeNums=0)"
] |
read('../../noTRuberNoGapsNoAmbiguities.nex')
d = Data()
# Unconstrained likelihood
d.calcUnconstrainedLogLikelihood2() # Installs the result in d.unconstrainedLogLikelihood
unc = d.unconstrainedLogLikelihood
n = Numbers('mcmc_sims_0', col=1, skip=1000)
print 'Original unconstrained log like is %s' % unc
print 'Here i... | [
[
8,
0,
0.0526,
0.0526,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.1053,
0.0526,
0,
0.66,
0.0667,
355,
3,
0,
0,
0,
467,
10,
1
],
[
8,
0,
0.2632,
0.0526,
0,
... | [
"read('../../noTRuberNoGapsNoAmbiguities.nex')",
"d = Data()",
"d.calcUnconstrainedLogLikelihood2() # Installs the result in d.unconstrainedLogLikelihood",
"unc = d.unconstrainedLogLikelihood",
"n = Numbers('mcmc_sims_0', col=1, skip=1000)",
"print('Original unconstrained log like is %s' % unc)",
"print... |
read('../noTRuberNoGapsNoAmbiguities.nex')
a=var.alignments[0]
dm = a.compositionEuclideanDistanceMatrix()
dm.writeNexus('compDistMatrix.nex')
| [
[
8,
0,
0.25,
0.25,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.5,
0.25,
0,
0.66,
0.3333,
475,
6,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.75,
0.25,
0,
0.66,
0.666... | [
"read('../noTRuberNoGapsNoAmbiguities.nex')",
"a=var.alignments[0]",
"dm = a.compositionEuclideanDistanceMatrix()",
"dm.writeNexus('compDistMatrix.nex')"
] |
read('../noTRuberNoGapsNoAmbiguities.nex')
a = var.alignments[0]
d = Data()
print 'Using all sites ...'
d.compoChiSquaredTest(verbose=1)
a.setNexusSets()
a.excludeCharSet('constant')
d = Data()
print 'After constant sites removal ...'
d.compoChiSquaredTest(verbose=1)
| [
[
8,
0,
0.1,
0.1,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.2,
0.1,
0,
0.66,
0.1111,
475,
6,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3,
0.1,
0,
0.66,
0.2222,
... | [
"read('../noTRuberNoGapsNoAmbiguities.nex')",
"a = var.alignments[0]",
"d = Data()",
"print('Using all sites ...')",
"d.compoChiSquaredTest(verbose=1)",
"a.setNexusSets()",
"a.excludeCharSet('constant')",
"d = Data()",
"print('After constant sites removal ...')",
"d.compoChiSquaredTest(verbose=1)"... |
read('../noTRuberNoGapsNoAmbiguities.nex')
a=var.alignments[0]
tList = []
print "Doing bootstrap ..."
for i in range(200):
b = a.bootstrap()
dm = b.compositionEuclideanDistanceMatrix()
t = dm.njUsingPaup()
tList.append(t)
tt = Trees(tList, taxNames=a.taxNames)
tp = TreePartitions(tt)
t = tp.consensus()... | [
[
8,
0,
0.0625,
0.0625,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.125,
0.0625,
0,
0.66,
0.1111,
475,
6,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1875,
0.0625,
0,
0.6... | [
"read('../noTRuberNoGapsNoAmbiguities.nex')",
"a=var.alignments[0]",
"tList = []",
"print(\"Doing bootstrap ...\")",
"for i in range(200):\n b = a.bootstrap()\n dm = b.compositionEuclideanDistanceMatrix()\n t = dm.njUsingPaup()\n tList.append(t)",
" b = a.bootstrap()",
" dm = b.composi... |
read('noOpt.p4_tPickle')
t = var.trees[0]
read('d.nex')
t.data = Data()
t.optLogLike(newtAndBrentPowell=1, allBrentPowell=0, verbose=1)
t.model.dump()
t.tPickle('opt')
| [
[
8,
0,
0.125,
0.125,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.25,
0.125,
0,
0.66,
0.1667,
15,
6,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.375,
0.125,
0,
0.66,
0... | [
"read('noOpt.p4_tPickle')",
"t = var.trees[0]",
"read('d.nex')",
"t.data = Data()",
"t.optLogLike(newtAndBrentPowell=1, allBrentPowell=0, verbose=1)",
"t.model.dump()",
"t.tPickle('opt')"
] |
var.verboseRead = 0
read('d.nex')
d = Data()
d.compoChiSquaredTest(verbose=1, skipColumnZeros=1, useConstantSites=1, skipTaxNums=None, getRows=0)
read('opt.p4_tPickle')
t = var.trees[0]
t.data = d
t.simsForModelFitTests(reps=83)
t.modelFitTests()
| [
[
14,
0,
0.1,
0.1,
0,
0.66,
0,
141,
1,
0,
0,
0,
0,
1,
0
],
[
8,
0,
0.2,
0.1,
0,
0.66,
0.125,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.3,
0.1,
0,
0.66,
0.25,
3... | [
"var.verboseRead = 0",
"read('d.nex')",
"d = Data()",
"d.compoChiSquaredTest(verbose=1, skipColumnZeros=1, useConstantSites=1, skipTaxNums=None, getRows=0)",
"read('opt.p4_tPickle')",
"t = var.trees[0]",
"t.data = d",
"t.simsForModelFitTests(reps=83)",
"t.modelFitTests()"
] |
read('t.nex')
t = var.trees[0]
var.alignments.append(func.newEmptyAlignment(dataType='dna', symbols=None, taxNames=t.taxNames, length=1000))
d = Data()
t.data = d
c1 = t.newComp(free=1, spec='specified', val=[0.1, 0.2, 0.3])
c2 = t.newComp(free=1, spec='specified', val=[0.4, 0.3, 0.1])
t.setModelThing(c1, node=0, clad... | [
[
8,
0,
0.0588,
0.0588,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.1176,
0.0588,
0,
0.66,
0.0714,
15,
6,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.1765,
0.0588,
0,
0.66... | [
"read('t.nex')",
"t = var.trees[0]",
"var.alignments.append(func.newEmptyAlignment(dataType='dna', symbols=None, taxNames=t.taxNames, length=1000))",
"d = Data()",
"t.data = d",
"c1 = t.newComp(free=1, spec='specified', val=[0.1, 0.2, 0.3])",
"c2 = t.newComp(free=1, spec='specified', val=[0.4, 0.3, 0.1]... |
taxNames = list(string.uppercase[:4])
t = func.randomTree(taxNames)
t.writeNexus('t.nex')
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
585,
3,
1,
0,
0,
430,
10,
1
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
15,
3,
1,
0,
0,
569,
10,
1
],
[
8,
0,
1,
0.3333,
0,
0.66,... | [
"taxNames = list(string.uppercase[:4])",
"t = func.randomTree(taxNames)",
"t.writeNexus('t.nex')"
] |
var.doCheckForBlankSequences=False
read('noOpt.p4_tPickle')
t = var.trees[0]
read('d.nex')
t.data = Data()
t.optLogLike(newtAndBrentPowell=1, allBrentPowell=0, verbose=1)
t.tPickle('opt')
| [
[
14,
0,
0.125,
0.125,
0,
0.66,
0,
784,
1,
0,
0,
0,
0,
4,
0
],
[
8,
0,
0.25,
0.125,
0,
0.66,
0.1667,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.375,
0.125,
0,
0.66,
... | [
"var.doCheckForBlankSequences=False",
"read('noOpt.p4_tPickle')",
"t = var.trees[0]",
"read('d.nex')",
"t.data = Data()",
"t.optLogLike(newtAndBrentPowell=1, allBrentPowell=0, verbose=1)",
"t.tPickle('opt')"
] |
var.doCheckForBlankSequences=False
var.verboseRead = 0
read('d.nex')
d = Data()
read('opt.p4_tPickle')
t = var.trees[0]
t.data = d
t.simsForModelFitTests(reps=11)
t.modelFitTests()
| [
[
14,
0,
0.1111,
0.1111,
0,
0.66,
0,
784,
1,
0,
0,
0,
0,
4,
0
],
[
14,
0,
0.2222,
0.1111,
0,
0.66,
0.125,
141,
1,
0,
0,
0,
0,
1,
0
],
[
8,
0,
0.3333,
0.1111,
0,
0.6... | [
"var.doCheckForBlankSequences=False",
"var.verboseRead = 0",
"read('d.nex')",
"d = Data()",
"read('opt.p4_tPickle')",
"t = var.trees[0]",
"t.data = d",
"t.simsForModelFitTests(reps=11)",
"t.modelFitTests()"
] |
read('t.nex')
t = var.trees[0]
var.alignments.append(func.newEmptyAlignment(dataType='dna', symbols=None, taxNames=t.taxNames, length=1000))
var.alignments.append(func.newEmptyAlignment(dataType='dna', symbols=None, taxNames=t.taxNames, length=700))
d = Data()
t.data = d
c1 = t.newComp(partNum=0, free=1, spec='specifi... | [
[
8,
0,
0.0357,
0.0357,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.0714,
0.0357,
0,
0.66,
0.0435,
15,
6,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.1071,
0.0357,
0,
0.66... | [
"read('t.nex')",
"t = var.trees[0]",
"var.alignments.append(func.newEmptyAlignment(dataType='dna', symbols=None, taxNames=t.taxNames, length=1000))",
"var.alignments.append(func.newEmptyAlignment(dataType='dna', symbols=None, taxNames=t.taxNames, length=700))",
"d = Data()",
"t.data = d",
"c1 = t.newCom... |
taxNames = list(string.uppercase[:5])
t = func.randomTree(taxNames)
t.writeNexus('t.nex')
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
585,
3,
1,
0,
0,
430,
10,
1
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
15,
3,
1,
0,
0,
569,
10,
1
],
[
8,
0,
1,
0.3333,
0,
0.66,... | [
"taxNames = list(string.uppercase[:5])",
"t = func.randomTree(taxNames)",
"t.writeNexus('t.nex')"
] |
from p4.SuperTreeSupport import SuperTreeInputTrees
stit = SuperTreeInputTrees('balanced64.nex')
stit.writeInputTreesToFile = True
stit.outputFile = 'inputtrees.tre'
stit.noTaxaToRemove = 32
stit.noOutputTrees = 20
stit.generateInputTrees()
| [
[
1,
0,
0.1,
0.1,
0,
0.66,
0,
318,
0,
1,
0,
0,
318,
0,
0
],
[
14,
0,
0.3,
0.1,
0,
0.66,
0.1667,
195,
3,
1,
0,
0,
939,
10,
1
],
[
14,
0,
0.4,
0.1,
0,
0.66,
0.333... | [
"from p4.SuperTreeSupport import SuperTreeInputTrees",
"stit = SuperTreeInputTrees('balanced64.nex')",
"stit.writeInputTreesToFile = True",
"stit.outputFile = 'inputtrees.tre'",
"stit.noTaxaToRemove = 32",
"stit.noOutputTrees = 20",
"stit.generateInputTrees()"
] |
from p4.SuperTreeSupport import SuperTreeInputTrees
stit = SuperTreeInputTrees('balanced64.nex', distributionTrees='FelidaeRVS.tre')
stit.writeInputTreesToFile = True
stit.outputFile = 'inputtreesBuiltDist.tre'
stit.noOutputTrees = 20
stit.generateInputTrees()
| [
[
1,
0,
0.1111,
0.1111,
0,
0.66,
0,
318,
0,
1,
0,
0,
318,
0,
0
],
[
14,
0,
0.3333,
0.1111,
0,
0.66,
0.2,
195,
3,
2,
0,
0,
939,
10,
1
],
[
14,
0,
0.4444,
0.1111,
0,
... | [
"from p4.SuperTreeSupport import SuperTreeInputTrees",
"stit = SuperTreeInputTrees('balanced64.nex', distributionTrees='FelidaeRVS.tre')",
"stit.writeInputTreesToFile = True",
"stit.outputFile = 'inputtreesBuiltDist.tre'",
"stit.noOutputTrees = 20",
"stit.generateInputTrees()"
] |
from p4.SuperTreeSupport import SuperTreeInputTrees
stit = SuperTreeInputTrees('balanced64.nex')
stit.writeInputTreesToFile = True
stit.outputFile = 'inputtreesWithDist.tre'
stit.useTaxonDistribution = True
stit.noOutputTrees = 20
stit.generateInputTrees()
| [
[
1,
0,
0.125,
0.125,
0,
0.66,
0,
318,
0,
1,
0,
0,
318,
0,
0
],
[
14,
0,
0.375,
0.125,
0,
0.66,
0.1667,
195,
3,
1,
0,
0,
939,
10,
1
],
[
14,
0,
0.5,
0.125,
0,
0.66,... | [
"from p4.SuperTreeSupport import SuperTreeInputTrees",
"stit = SuperTreeInputTrees('balanced64.nex')",
"stit.writeInputTreesToFile = True",
"stit.outputFile = 'inputtreesWithDist.tre'",
"stit.useTaxonDistribution = True",
"stit.noOutputTrees = 20",
"stit.generateInputTrees()"
] |
from p4.SuperTreeSupport import SuperTreeSupport
sts = SuperTreeSupport('supertree.nex', 'input.nex')
sts.doSaveDecoratedTree = False
sts.decoratedFilename='mytree.nex'
sts.verbose=2
sts.doDrawTree=True
sts.superTreeSupport() | [
[
1,
0,
0.125,
0.125,
0,
0.66,
0,
318,
0,
1,
0,
0,
318,
0,
0
],
[
14,
0,
0.375,
0.125,
0,
0.66,
0.1667,
123,
3,
2,
0,
0,
307,
10,
1
],
[
14,
0,
0.5,
0.125,
0,
0.66,... | [
"from p4.SuperTreeSupport import SuperTreeSupport",
"sts = SuperTreeSupport('supertree.nex', 'input.nex')",
"sts.doSaveDecoratedTree = False",
"sts.decoratedFilename='mytree.nex'",
"sts.verbose=2",
"sts.doDrawTree=True",
"sts.superTreeSupport()"
] |
read("mcmc_trees_0.nex")
tt = Trees()
# Use a previously-made cons tree
var.trees = []
read("cons.nex")
t = var.trees[0]
tt.trackSplitsFromTree(t)
| [
[
8,
0,
0.1429,
0.1429,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.2857,
0.1429,
0,
0.66,
0.2,
266,
3,
0,
0,
0,
964,
10,
1
],
[
14,
0,
0.5714,
0.1429,
0,
0.... | [
"read(\"mcmc_trees_0.nex\")",
"tt = Trees()",
"var.trees = []",
"read(\"cons.nex\")",
"t = var.trees[0]",
"tt.trackSplitsFromTree(t)"
] |
read("d.nex")
a = var.alignments[0]
dm = a.logDet(correction='L94', doPInvarOfConstants=True,
pInvar=None, pInvarOfConstants=None,
missingCharacterStrategy='fudge', minCompCount=1,
nonPositiveDetStrategy='invert')
dm.writeNexus("dm.nex")
t = dm.bionj()
#t.taxNames = a.taxNames
... | [
[
8,
0,
0.0909,
0.0909,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.1818,
0.0909,
0,
0.66,
0.2,
475,
6,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.4091,
0.3636,
0,
0.66,... | [
"read(\"d.nex\")",
"a = var.alignments[0]",
"dm = a.logDet(correction='L94', doPInvarOfConstants=True,\n pInvar=None, pInvarOfConstants=None,\n missingCharacterStrategy='fudge', minCompCount=1,\n nonPositiveDetStrategy='invert')",
"dm.writeNexus(\"dm.nex\")",
"t = dm.b... |
read('noOpt.p4_tPickle')
t = var.trees[0]
read('d.nex')
t.data = Data()
t.optLogLike(newtAndBrentPowell=1, allBrentPowell=0, verbose=1)
t.model.dump()
t.tPickle('opt')
| [
[
8,
0,
0.125,
0.125,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.25,
0.125,
0,
0.66,
0.1667,
15,
6,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.375,
0.125,
0,
0.66,
0... | [
"read('noOpt.p4_tPickle')",
"t = var.trees[0]",
"read('d.nex')",
"t.data = Data()",
"t.optLogLike(newtAndBrentPowell=1, allBrentPowell=0, verbose=1)",
"t.model.dump()",
"t.tPickle('opt')"
] |
var.verboseRead = 0
read('d.nex')
d = Data()
d.compoChiSquaredTest(verbose=1, skipColumnZeros=1, useConstantSites=1, skipTaxNums=None, getRows=0)
read('opt.p4_tPickle')
t = var.trees[0]
t.data = d
t.compoTestUsingSimulations(nSims=100, doIndividualSequences=0, doChiSquare=0, verbose=1)
| [
[
14,
0,
0.1111,
0.1111,
0,
0.66,
0,
141,
1,
0,
0,
0,
0,
1,
0
],
[
8,
0,
0.2222,
0.1111,
0,
0.66,
0.1429,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.3333,
0.1111,
0,
0.... | [
"var.verboseRead = 0",
"read('d.nex')",
"d = Data()",
"d.compoChiSquaredTest(verbose=1, skipColumnZeros=1, useConstantSites=1, skipTaxNums=None, getRows=0)",
"read('opt.p4_tPickle')",
"t = var.trees[0]",
"t.data = d",
"t.compoTestUsingSimulations(nSims=100, doIndividualSequences=0, doChiSquare=0, verb... |
read('t.nex')
t = var.trees[0]
var.alignments.append(func.newEmptyAlignment(dataType='dna', symbols=None, taxNames=t.taxNames, length=300))
d = Data()
t.data = d
c1 = t.newComp(free=1, spec='specified', val=[0.0, 0.2, 0.3])
t.newRMatrix(free=1, spec='specified', val=[1.2, 6.5, 1.3, 9.8, 1.1, 1.0])
t.setPInvar(free=1, ... | [
[
8,
0,
0.0667,
0.0667,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.1333,
0.0667,
0,
0.66,
0.0833,
15,
6,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.2,
0.0667,
0,
0.66,
... | [
"read('t.nex')",
"t = var.trees[0]",
"var.alignments.append(func.newEmptyAlignment(dataType='dna', symbols=None, taxNames=t.taxNames, length=300))",
"d = Data()",
"t.data = d",
"c1 = t.newComp(free=1, spec='specified', val=[0.0, 0.2, 0.3])",
"t.newRMatrix(free=1, spec='specified', val=[1.2, 6.5, 1.3, 9.... |
taxNames = list(string.uppercase[:4])
t = func.randomTree(taxNames)
t.writeNexus('t.nex')
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
585,
3,
1,
0,
0,
430,
10,
1
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
15,
3,
1,
0,
0,
569,
10,
1
],
[
8,
0,
1,
0.3333,
0,
0.66,... | [
"taxNames = list(string.uppercase[:4])",
"t = func.randomTree(taxNames)",
"t.writeNexus('t.nex')"
] |
# We need to have a tree with its data. The tree needs a model, and
# it needs to have model parameters optimized.
# Read in the tree and give it a name
read("myTree.nex")
t = var.trees[0]
# Read in the data and give it a name
read("myData.nex")
d = Data()
# Attach the data and a model to the tree.
t.data = d
t.new... | [
[
8,
0,
0.1724,
0.0345,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.2069,
0.0345,
0,
0.66,
0.0909,
15,
6,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.3103,
0.0345,
0,
0.66... | [
"read(\"myTree.nex\")",
"t = var.trees[0]",
"read(\"myData.nex\")",
"d = Data()",
"t.data = d",
"t.newComp(free=0, spec='empirical')",
"t.newRMatrix(free=0, spec='rtRev')",
"t.setNGammaCat(nGammaCat=4)",
"t.newGdasrv(free=1, val=0.5)",
"t.setPInvar(free=0, val=0.0)",
"t.optLogLike()",
"t.compo... |
read('noOpt.p4_tPickle')
t = var.trees[0]
var.doCheckForBlankSequences = False
read('dA.nex')
read('dB.nex')
t.data = Data()
t.optLogLike(newtAndBrentPowell=1, allBrentPowell=0, verbose=1)
t.tPickle('opt')
| [
[
8,
0,
0.1111,
0.1111,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.2222,
0.1111,
0,
0.66,
0.1429,
15,
6,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3333,
0.1111,
0,
0.6... | [
"read('noOpt.p4_tPickle')",
"t = var.trees[0]",
"var.doCheckForBlankSequences = False",
"read('dA.nex')",
"read('dB.nex')",
"t.data = Data()",
"t.optLogLike(newtAndBrentPowell=1, allBrentPowell=0, verbose=1)",
"t.tPickle('opt')"
] |
var.verboseRead = 0
var.doCheckForBlankSequences = False
read('dA.nex')
read('dB.nex')
d = Data()
d.compoChiSquaredTest(verbose=1, skipColumnZeros=1, useConstantSites=1, skipTaxNums=[[2], []], getRows=1)
read('opt.p4_tPickle')
t = var.trees[0]
t.data = d
t.compoTestUsingSimulations(nSims=100, doIndividualSequences=1, ... | [
[
14,
0,
0.0909,
0.0909,
0,
0.66,
0,
141,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.1818,
0.0909,
0,
0.66,
0.1111,
784,
1,
0,
0,
0,
0,
4,
0
],
[
8,
0,
0.2727,
0.0909,
0,
0.... | [
"var.verboseRead = 0",
"var.doCheckForBlankSequences = False",
"read('dA.nex')",
"read('dB.nex')",
"d = Data()",
"d.compoChiSquaredTest(verbose=1, skipColumnZeros=1, useConstantSites=1, skipTaxNums=[[2], []], getRows=1)",
"read('opt.p4_tPickle')",
"t = var.trees[0]",
"t.data = d",
"t.compoTestUsin... |
read('t.nex')
t = var.trees[0]
var.alignments.append(func.newEmptyAlignment(dataType='dna', symbols=None, taxNames=t.taxNames, length=1000))
var.alignments.append(func.newEmptyAlignment(dataType='dna', symbols=None, taxNames=t.taxNames, length=700))
d = Data()
t.data = d
t.newComp(partNum=0, free=1, spec='specified', ... | [
[
8,
0,
0.04,
0.04,
0,
0.66,
0,
453,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.08,
0.04,
0,
0.66,
0.0526,
15,
6,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.12,
0.04,
0,
0.66,
0.1053... | [
"read('t.nex')",
"t = var.trees[0]",
"var.alignments.append(func.newEmptyAlignment(dataType='dna', symbols=None, taxNames=t.taxNames, length=1000))",
"var.alignments.append(func.newEmptyAlignment(dataType='dna', symbols=None, taxNames=t.taxNames, length=700))",
"d = Data()",
"t.data = d",
"t.newComp(par... |
taxNames = list(string.uppercase[:5])
t = func.randomTree(taxNames)
t.writeNexus('t.nex')
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
585,
3,
1,
0,
0,
430,
10,
1
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
15,
3,
1,
0,
0,
569,
10,
1
],
[
8,
0,
1,
0.3333,
0,
0.66,... | [
"taxNames = list(string.uppercase[:5])",
"t = func.randomTree(taxNames)",
"t.writeNexus('t.nex')"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.