News and Announcements » |
Description:
This script mainly allows performing analysis of volatility on time series data, but they can be applied to any data that contains a gradient. The methods available are RMS (either using ‘avg’ or ‘trajectory’); or the first difference (using ‘diff’), or ‘wdiff’ for a modified first difference algorithm. The trajectories are computed as follows. For ‘avg’ it calculates the average point within a group and then computes the norm of the distance of each sample from the averaged value. For ‘trajectory’ each component of the result trajectory is computed as taking the sorted list of samples in the group and taking the norm of the coordinates of the 2nd samples minus the 1st sample, 3rd sample minus 2nd sample and so on. For ‘diff’ it calculates the norm for all the time-points and then calculates the first difference for each resulting point. For ‘wdiff’, it calculates the norm for all the time-points and substracts the mean of the next number of elements, specified using the ‘–window_size’ parameters, and the current element.
Usage: compare_trajectories.py [options]
Input Arguments:
Note
[REQUIRED]
[OPTIONAL]
Output:
This script generates two files in the output directory, ‘trajectories.txt’ and ‘trajectories_raw_values.txt’. The ‘trajectories.txt’ file includes the resulting statistics and a list of categories that did not passed the tests to run the analysis. The ‘trajectories_raw_values.txt’ file includes the resulting trajectory for each used category.
Average method:
Execute the analysis of volatility using the average method, grouping the samples using the ‘Treatment’ category
compare_trajectories.py -i pcoa_res.txt -m map.txt -c 'Treatment' -o avg_output
Trajectory method:
Execute the analysis of volatility using the trajectory method, grouping the samples using the ‘Treatment’ category and sorting them using the ‘time’ category
compare_trajectories.py -i pcoa_res.txt -m map.txt -c 'Treatment' --algorithm trajectory -o trajectory_output -s time
First difference method:
Execute the analysis of volatility using the first difference method, grouping the samples using the ‘Treatment’ category, sorting them using the ‘time’ category and calculating the trajectory using the first four axes
compare_trajectories.py -i pcoa_res.txt -m map.txt -c 'Treatment' --algorithm diff -o diff_output -s time --axes 4
Window difference method:
Execute the analysis of volatility using the window difference method, grouping the samples using the ‘Treatment’ category, sorting them using the ‘time’ category, weighting the output by the space between samples in the ‘time’ category and using a window size of three.
compare_trajectories.py -i pcoa_res.txt -m map.txt -c 'Treatment' --algorithm wdiff -o wdiff_output -s time --window_size 3 -w