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

Documentation on CLI function 'clock' is wrong. Date has to be date format not year decimal. #275

Open
m-d-grunnill opened this issue Jul 31, 2024 · 3 comments

Comments

@m-d-grunnill
Copy link

Documentation on CLI function 'clock' is wrong. Date has to be date format not year decimal see below:

image

I could not get the function to work unless I used date format.

@rneher
Copy link
Member

rneher commented Aug 11, 2024

One the example data, the function works as specified.

treetime clock --tree data/ebola/ebola.nwk --dates data/ebola/ebola.metadata.csv --sequence-length 20000

and the metadata there specifies dates as

name, date
EM_COY_2015_015982, 2015.30
G3676, 2014.40
EM_COY_2015_015980, 2015.30
G3670, 2014.40
CON-10590, 2015.61
NM042, 2014.42
EM_079497, 2014.26

But it is true that the TreeTime will also attempt to parse dates in ISO-format if they can't parsed as a float.

What exact command are you running?

@liamxg
Copy link

liamxg commented Oct 16, 2024

Dear @rneher,

My date.csv file has the first column that contains 'name', but still reports error:

ttempting to parse dates...
Traceback (most recent call last):
  File "/Users/liam/opt/miniconda3/bin/treetime", line 8, in <module>
  sys.exit(main())
File "/Users/liam/opt/miniconda3/lib/python3.9/site-packages/treetime/__main__.py", line 21, in main
return_code = params.func(params)
File "/Users/liam/opt/miniconda3/lib/python3.9/site-packages/treetime/argument_parser.py", line 238, in toplevel
timetree(params)
File "/Users/liam/opt/miniconda3/lib/python3.9/site-packages/treetime/wrappers.py", line 306, in timetree
dates = utils.parse_dates(params.dates, date_col=params.date_column, name_col=params.name_column)
File "/Users/liam/opt/miniconda3/lib/python3.9/site-packages/treetime/utils.py", line 336, in parse_dates
raise err
File "/Users/liam/opt/miniconda3/lib/python3.9/site-packages/treetime/utils.py", line 285, in parse_dates
raise MissingDataError("ERROR: Cannot read metadata: need at least one column that contains the taxon labels."
                       treetime.MissingDataError: ERROR: Cannot read metadata: need at least one column that contains the taxon labels. Looking for the first column that contains 'name', 'strain', or 'accession' in the header.

Best,
Liam

@rneher
Copy link
Member

rneher commented Nov 12, 2024

@liamxg , could you share a bit more info about the file you are using?

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

3 participants