treetime icon indicating copy to clipboard operation
treetime copied to clipboard

Relaxed clock in NextStrain?

Open NakarinP opened this issue 4 years ago • 2 comments

Hello Richard,

Since there is no relaxed clock argument in "rule refine" in Augur, I have tried to separately run Treetime with --relax argument then put the results back to the pipeline as they're needed for further rules. Briefly, I used "aligned.fasta" from rule align and "tree_raw.nwk" from rule tree as inputs for the Treetime running (treetime --tree tree_raw.nwk --dates metadata.tsv --aln aligned.fasta --outdir out --relax 1.0 0). However, Treetime's outputs couldn't be matched with rule refine's outputs for example "branchlengths.json" of rule refine needs branch_length, clock_length, date, mutation_length, and num_date_confidence for each taxa, but the resulting tree from Treetime only provides only branch_length, mutations, and date.

Is there any way to apply a relaxed clock model into the NextStrain's Augur pipeline or the way to tell Treetime to create some results corresponding to rule refine's output?

Thank you,

Nakarin

NakarinP avatar Feb 15 '21 19:02 NakarinP

you are right, augur doesn't accept arguments for a relaxed clock.

you could write a little script that produces a branchlengths.json from the output of treetime (the tree and tabular output). But it would probably be easier to call treetime from within a little python script. See here for an example

https://github.com/neherlab/treetime_examples/blob/master/scripts/relaxed_clock.py#L32

and then output the desired json.

rneher avatar Mar 04 '21 21:03 rneher

Thank you for the suggestion!

NakarinP avatar Mar 04 '21 22:03 NakarinP