Skip to content

Commit

Permalink
change lphy scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
yxu927 committed Jan 5, 2025
1 parent d711d61 commit 95c255d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 27 deletions.
21 changes: 12 additions & 9 deletions examples/coalescent/exponentialCoalescent.lphy
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
data {
L = 200;

}

model {
GrowthRate ~ Normal(mean=0.055, sd=0.0005);
N0 ~ Normal(mean=30, sd=1.0);
exponentialPopFunc = exponentialPopFunc(GrowthRate=GrowthRate, N0=N0);
times ~ CoalescentPopFunc(popFunc=exponentialPopFunc, n=16);
D ~ PhyloCTMC(tree=times, L=L, Q=jukesCantor());
}
GrowthRate ~ LogNormal(meanlog=2.0, sdlog=0.9);
N0 ~ LogNormal(meanlog=9.2, sdlog=0.12);
NA ~ LogNormal(meanlog=5.2, sdlog=0.12);
I_na ~ UniformDiscrete(lower=0, upper=1);

exponentialPopFunc = exponentialPopFunc(GrowthRate=GrowthRate, N0=N0, NA=NA, I_na=I_na);
tree ~ CoalescentPopFunc(n=40, popFunc=exponentialPopFunc);

D ~ PhyloCTMC(L=2000, Q=jukesCantor(),mu=0.01, tree=tree);
height = tree.rootAge();
length = tree.treeLength();
}
19 changes: 11 additions & 8 deletions examples/coalescent/gompertzCoalescent_f0.lphy
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
data {
L = 500;
L = 1000;
}
model {

N0 ~ LogNormal(meanlog=10,sdlog=0.5);
N0 ~ LogNormal(meanlog=8, sdlog=0.5);
b ~ LogNormal(meanlog=-0.95, sdlog=0.2);
f0 ~ Beta(alpha=20, beta=7);
b ~ Beta(alpha=40, beta=10);
gompertzPopFunc = gompertzPopFunc_f0(N0=N0,f0=f0, b=b);
tree ~ CoalescentPopFunc(n=16, popFunc=gompertzPopFunc);
D ~ PhyloCTMC(tree=tree, L=L, Q=jukesCantor(), mu=1e-9);
}
NA ~ LogNormal(meanlog=4, sdlog=0.3);
I_na ~ UniformDiscrete(lower=0, upper=1);
gompertzPopFunc = gompertzPopFunc_f0(f0=f0, b=b, N0=N0, NA=NA, I_na = I_na);
tree ~ CoalescentPopFunc(n=40, popFunc=gompertzPopFunc);
D ~ PhyloCTMC(L=L, Q=jukesCantor(), mu=0.01, tree=tree);
//height = tree.rootAge();
}

24 changes: 14 additions & 10 deletions examples/coalescent/gompertzCoalescent_t50.lphy
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
data {
L = 500;
L = 1000;
}
model {

NInfinity ~ LogNormal(meanlog=10,sdlog=0.5);
//t50 ~ Beta(alpha=20, beta=7);
t50 ~ Normal(mean=0,sd=0.333);
b ~ Beta(alpha=40, beta=10);
gompertzPopFunc = gompertzPopFunc_t50(NInfinity=NInfinity,t50=t50, b=b,NA=0);
tree ~ CoalescentPopFunc(n=16, popFunc=gompertzPopFunc);
D ~ PhyloCTMC(tree=tree, L=L, Q=jukesCantor(), mu=1e-9);
}
t50 ~ LogNormal(meanlog=2.3, sdlog=0.3);
b ~ LogNormal(meanlog=-1.5, sdlog=0.2);
NInfinity ~ LogNormal(meanlog=6.5, sdlog=0.5);
NA ~ LogNormal(meanlog=2.21, sdlog=0.1);
I_na ~ UniformDiscrete(lower=0, upper=1);
gompertzPopFunc = gompertzPopFunc_t50(NInfinity=NInfinity,t50=t50, b=b, NA=NA,I_na = I_na);
// n0 = gompertzPopFunc.getN0();
// f0=n0/NInfinity;
tree ~ CoalescentPopFunc(n=40, popFunc=gompertzPopFunc);
D ~ PhyloCTMC(tree=tree, L=L, Q=jukesCantor(), mu=1e-2);
height = tree.rootAge();
length = tree.treeLength();
}

0 comments on commit 95c255d

Please sign in to comment.