Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate relaxed clock operator created by lphybeast #5

Open
kche309 opened this issue Sep 15, 2021 · 3 comments
Open

Duplicate relaxed clock operator created by lphybeast #5

kche309 opened this issue Sep 15, 2021 · 3 comments

Comments

@kche309
Copy link
Collaborator

kche309 commented Sep 15, 2021

Running LPhyBeast on an lphy script with a relaxed clock model and error model will generate duplicate clock operators.

lphy script: simpleRelaxedError_lphy.txt

lphybeast output: simpleRelaxedError_xml.txt

@walterxie has worked on a solution by removing the duplicated original Tree and Alignment objects.

The object duplication is because constructTreeAndBranchRate() is called twice, once when constructing PhyloCTMC for the generic non-error tree, and another time by GT16ErrorModelToBeast which constructs a tree with an error model. Internally this duplicates the tree and branch objects and operators.

The ideal solution would be to modify the code to construct a tree only once, or by passing the error model into the tree construction method.

The temporary solution is to add a flag to constructTreeAndBranchRate() in PhyloCTMCToBEAST.java to optionally turn off branch rate operators during tree construction.

https://github.com/kche309/LPhyBeast/blob/6bfa606bc132bc3ecaf42598f15a23be0f34d881/src/lphybeast/tobeast/generators/PhyloCTMCToBEAST.java#L158

@kche309
Copy link
Collaborator Author

kche309 commented Sep 15, 2021

Comments from @alexeid
The logic that duplicates should be fixed at the fundamental level. The fundamental logic should be a single traversal of the graphical model that creates one BEASTObject for every Node.

@walterxie
Copy link
Collaborator

Your data block is illegal, change to this:

data {
  L = 200;
  taxa = taxa(names=1:16);
  numBranches = 30;
}

@walterxie
Copy link
Collaborator

walterxie commented Aug 2, 2022

The only solution to fix this "at the fundamental level", that I can think of, is to make GT16ErrorModel inherit PhyloCTMC and add two parameters epsilon and delta, and then overwrite public RandomVariable<Alignment> sample() {.

Any better ideas?

walterxie added a commit that referenced this issue Aug 2, 2022
EvaLiyt added a commit that referenced this issue Feb 18, 2024
Homozygous and Haploid functions done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants