dsilvestro/PyRate

(plotRJ) Time bins for rate shift calculations inconsistent with time bins for speciation and extinction rates

mishawhittingham opened this issue · 3 comments

Hi!

Thanks for all the hard work you've put into this program! I've been having a lot of success using PyRate so far, but have hit a snag when trying to determine the timing of significant extinction and speciation rate shifts within the interval I am studying. The interval is very short, spanning only 1.4 Ma, and the resolution of the time bins I sampled being roughly 0.1 Ma.

When I run the -plotRJ function with a root_plot (308.2 Ma) and min_age_plot (306.8 Ma) set to bound my data, with a grid_plot of 0.01, I get useful results for speciation rates and extinction rates that fall within the ages I specified. However, the rate shift frequencies are checking much wider time bins with intervals of roughly 2.4 Ma, still starting at 0 Ma (assuming that's what "mids" array in the RTT rscript output represents), one of which encompasses my entire dataset. I've tried reducing the grid_plot value to 0.001, which does reduce the length of the rate shift bin intervals, but makes the arrays used in the RTT rscript too long for R to read properly (R for some reason starts treating the arrays as open-ended and adds a + at the end of the c() function in console instead of making the vector object).

Is there something I'm doing wrong, or another way I could determine the timing of significant rate shifts within the interval I'm studying? Is my interval simply too short for rate shifts to be calculable in PyRate?

Thanks in advance,
Misha

Hi, this should be fixed in the updated version I just pushed - can you try again?

For a dataset spanning such a short time frame you could also change the time unit from 1 myr to e.g. 100kyr. You can do that in the PyRate analysis using the flag rescale, for instance:

python PyRate.py your_dataset -rescale 10

will rescale all ages (and the resulting rates) to a unit of 0.1 myr. This way you don't need to set the grid_plot parameter to a too small value.

Thanks for your help! Unfortunately, the -plotRJ function is now returning this error:

Traceback (most recent call last):
File "C:\PyRate.py", line 4899, in
rtt_plot_bds = rtt_plot_bds.plot_marginal_rates(path_dir_log_files,name_tag=file_stem,bin_size=grid_plot,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\PyRate\pyrate_lib\rtt_plot_bds.py", line 447, in plot_marginal_rates
stem_file=files[0]
~~~~~^^^
IndexError: index 0 is out of bounds for axis 0 with size 0

I'm not sure if I made an error installing the new version? Let me know. I can provide an example of the mcmc file I am trying to plot if needed.

yes please. Actually can you send the input file and the commands you used to run the analysis and the plotting? You can send them here?