beast2
beast2 copied to clipboard
Guess dates function works in 1.8.4 but fails in 2.4.6 and 2.4.7
I have taxon names that look like this:
with exact dates: H4N6|A/Domestic_Duck/Republic_of_Georgia/11/2016|OD|2016-08-30 H2N3|A/Tufted_duck/Republic_of_Georgia/1/2012|OD|2012-12-22 H4N6|A/Mallard/Republic_of_Georgia/7/2016|MD|2016-08-30 H13N8|A/yellow-legged_gull/Republic_of_Georgia/5/2013|YAG|2013-11-11 H13N8|A/armenian_gull/Republic_of_Georgia/2/2013|YAG|2013-8-11 H16N3|A/black-headed_gull/Republic_of_Georgia/4/2012|BMG|2012-1-9
OR
with only year (or year and month and no day): H13N8|A/Yellow-legged_Gull/Republic_of_Georgia/1/2011|YAG|2011
Beauti 1.8.4 is able to read all without any problems but Beauti2 cannot. I've tried replacing pipes with _, __, @ etc. and it still doesn't work. I've asked it to read everything after the last |or _ or __ or @ as the case was and I get nothing.
I closed this issue earlier as I thought importing the dates would work but that didn't either. Any help on this appreciated!
PS this was an issue in earlier beast2 iterations too: https://github.com/CompEvol/beast2/issues/181 - which I am not sure was fixed...
Hi @delfinut, when you say "read without problems", what happens to the dates for which only the year is known? Does BEAST 1 assign a uniform prior for the tip date being within the chosen year? Or is a particular day in the year chosen arbitrarily?
Hi @tgvaughan. In 1.8.4, I ask guess dates to define by prefix and order (last), and tick the box for "parse calendar dates with variable precision". When there's only the year - in the Date column I get just the year (eg. 2011.0) and the precision value is set to 1.0 instead of 0.0. Does that answer your question? (Is that what a uniform prior is?)
Thanks.
PS Beauti2 is unable to read dates even if I only use sequences with the full date in the taxon label.
Hi @delfinut, yes that's what I meant by a uniform prior - BEAUti 2 can't currently set up tip dates with variable precision, as far as I know. This is a definite problem.
Regarding parsing the fixed-precision date strings though (e.g. the first 6 examples in your post, which I've turned into a dummy fasta file, I've confirmed that the current release version of BEAUti can't handle this. However, there's an open pull request (#730, but see also the discussion under #729) which adds the ability to handle a much wider range of input date formats, and this allows the dates from the test file to be added without issue. Hopefully this can be merged soon and incorporated into the next release.
Excellent, thank you. I will keep an eye out for updates and the next release and plough on with 1.8.4 meanwhile. I did not know Beauti2 could not handle variable precision in dates. Perhaps that's the reason importing dates from file also didn't work.
Do you know why even the fixed-precision date strings (in what I think is the recommended format yyyy-mm-dd) are not parsed in this version?
I'm not sure it's already out there but it might be useful in BEAST documentation to include suggestions/best practices for taxon labels with information on e.g. delimiters to use or avoid, functions that are available or not?
I could be wrong regarding the variable precision dates, it could be that I've just never used this myself - BEAST 2 is a large project! Hopefully someone else can set me right if I've got it wrong.
Regarding the fixed-precision date strings, they're not formatted because the automatic date parsing function which BEAUti is using to convert them to node ages is for some reason unable to identify the format. The new version of the tip date panel includes the ability to explicitly specify a date format either from a drop-down menu or by entering the format string manually. In your case the one that worked was yyyy-M-d (single digits allowed for both month and day).
That's a great suggestion regarding the documentation. We'll also need to explicitly document (within BEAUti) the date format string components.
related to #208