-
Notifications
You must be signed in to change notification settings - Fork 57
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
ERROR: No variation in sampling dates! Please specify your clock rate explicitly #227
Comments
Hi Ben, happy to help! It sounds like somewhere between you and treetime there's a misunderstanding about what the sampling dates are. Could be as simple as a different column name for your dates. But rather than speculating, the best way forward is if you share your inputs (the tree exact files), the exact command you use (copy paste) and the output of |
Thank you for the quick reply! |
It should be possible to debug with a lot of columns removed to reduce scope of sharing. You could try reducing sample numbers to 5 or so, maybe you have some public samples in there anyways, just keep these? Otherwise, just the header of the csv could be useful - that shouldn't contain anything sensitive. |
I have sent through the files. Did you receive them? |
This is the full log I get with default verbosity: treetime --covariation --confidence --clock-filter 5 --tree N1_subset.aln.clean.fasta.treefile.nwk --aln N1_subset.aln.clean.fasta --dates Matched_Metadata.csv
Attempting to parse dates...
Using column 'strain' as name. This needs match the taxon names in the tree!!
Using column 'date' as date.
0.00 -TreeAnc: set-up
0.16 WARNING: Previous versions of TreeTime (<0.7.0) RECONSTRUCTED sequences of
tips at positions with AMBIGUOUS bases. This resulted in unexpected
behavior is some cases and is no longer done by default. If you want to
replace those ambiguous sites with their most likely state, rerun with
`reconstruct_tip_states=True` or `--reconstruct-tip-states`.
0.66 TreeTime.reroot: with method or node: least-squares
0.66 TreeTime.reroot: rerooting will ignore covariance and shared ancestry.
0.90 TreeTime.clock_filter: More than a third of leaves have been excluded by
the clock filter. Please check your input data.
0.91 TreeTime.reroot: with method or node: least-squares
0.91 TreeTime.reroot: rerooting will account for covariance and shared ancestry.
Traceback (most recent call last):
File "/opt/homebrew/Caskroom/miniforge/base/envs/py11/lib/python3.11/site-packages/treetime/treetime.py", line 57, in run
return self._run(**kwargs)
^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/py11/lib/python3.11/site-packages/treetime/treetime.py", line 221, in _run
self.clock_filter(reroot=reroot_mechanism, n_iqd=n_iqd, plot=plot_rtt, fixed_clock_rate=fixed_clock_rate)
File "/opt/homebrew/Caskroom/miniforge/base/envs/py11/lib/python3.11/site-packages/treetime/treetime.py", line 439, in clock_filter
self.reroot(root=reroot, clock_rate=fixed_clock_rate)
File "/opt/homebrew/Caskroom/miniforge/base/envs/py11/lib/python3.11/site-packages/treetime/treetime.py", line 521, in reroot
new_root = self._find_best_root(covariation=use_cov,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/py11/lib/python3.11/site-packages/treetime/treetime.py", line 949, in _find_best_root
return Treg.optimal_reroot(force_positive=force_positive, slope=slope, keep_node_order=self.keep_node_order)['node']
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/py11/lib/python3.11/site-packages/treetime/treeregression.py", line 433, in optimal_reroot
best_root = self.find_best_root(force_positive=force_positive, slope=slope)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/py11/lib/python3.11/site-packages/treetime/treeregression.py", line 340, in find_best_root
x, chisq = self._optimal_root_along_branch(n, tv, bv, var, slope=slope)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/py11/lib/python3.11/site-packages/treetime/treeregression.py", line 396, in _optimal_root_along_branch
chisq_grid = np.array([chisq(x) for x in grid])
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/py11/lib/python3.11/site-packages/treetime/treeregression.py", line 396, in <listcomp>
chisq_grid = np.array([chisq(x) for x in grid])
^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/py11/lib/python3.11/site-packages/treetime/treeregression.py", line 386, in chisq
return base_regression(tmpQ, slope=slope)['chisq']
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/py11/lib/python3.11/site-packages/treetime/treeregression.py", line 32, in base_regression
raise ValueError("No variation in sampling dates! Please specify your clock rate explicitly.")
ValueError: No variation in sampling dates! Please specify your clock rate explicitly.
ERROR: No variation in sampling dates! Please specify your clock rate explicitly.
ERROR in TreeTime.run: An error occurred which was not properly handled in TreeTime. If this error persists, please let us know by filing a new issue including the original command and the error above at: https://github.com/neherlab/treetime/issues Some things to address within treetime to make such issues easier to debug for users: The log message When that "no variant in sampling dates" error happens, it would be good to help the user by reporting the following:
|
I'm glad it was a relatively simple issue! You have given me a bit to think about with this dataset and treetime troubleshooting Thanks so much for your assistance. |
Unpin biopython as bug has been fixed neherlab/treetime#227
Merge PR #39871, commits were: * Update meta.yaml Unpin biopython as bug has been fixed neherlab/treetime#227 * Update bcbio-gff to 0.7.0
Merge PR bioconda#39871, commits were: * Update meta.yaml Unpin biopython as bug has been fixed neherlab/treetime#227 * Update bcbio-gff to 0.7.0
Hi,
I am running treetime with
treetime --covariation --confidence --clock-filter 5 --tree <input.nwk> --aln <input.aln.fasta> --dates <input.csv>'
on a selection of N1 subtype influenza viruses and it is returning the following:ValueError: No variation in sampling dates! Please specify your clock rate explicitly.
ERROR: No variation in sampling dates! Please specify your clock rate explicitly.
ERROR in TreeTime.run: An error occurred which was not properly handled in TreeTime. If this error persists, please let us know by filing a new issue including the original command and the error above at: https://github.com/neherlab/treetime/issues
The dataset contains sequences with dates from 2014-2021 and I have previously used the same command for N2 subtype and all other gene segments without error. I am sure all headers and dates are correct/matching
Do you have any idea/advice on how to get around this issue?
Thanks,
Ben
The text was updated successfully, but these errors were encountered: