Codes for homology analyses of trails and its insights into perception ranges
收藏资源简介:
These are the Matlab (Persistence_Analysis.m) and Python (Persistence_Analysis.py) codes, along with the free software "Trajectory_Analysis_Version4" to compute the homology persistence of a trail (fossil or modern). These codes are supplemented to the PNAS paper "Trace Fossils Constrain the Perceptual Ranges of the Earliest Motile Animals" by Zekun Wang and Tianyun Shi. For all the codes, you need to upload the coordinates for both the trajectory (Trajectory.txt) and the boundary of the foraging patch (Patch_boundary.txt). If the coordinates are extracted via GetData Graph Digitizer, you need to remove the headers of its output files and only keep the coordinates. You can EITHER input the "sampling frequency", which is 2.678 for the benchmark, OR "trail width", which is 108.333 (pixels) for the benchmark. For detailed use of the software please read "Read_Me". ******************************************************************************************************************** The free software has been updated to Version 6, incorporating several new features and functionalities: https://zenodo.org/records/20399534, which is appended to the bandwidth paper published in Palaeo3 (https://doi.org/10.1016/j.palaeo.2026.113973). ********************************************************************************************************** Read_Me: 📌 About This Software---------------------This software performs statistical, spectral, smoothness and persistence analyses of fossil trajectories in normalized forms with input coordinate series. 📖 How to Use-------------1. Load trajectory coordinates (TXT, XLS, or XLSX files) - File should contain two columns: x and y coordinates. If the coordinates are extracted via GetData Graph Digitizer, please remove the headers, and only keep the coordinates. - Edit and Save: When necessary, double-click cells to edit coordinates, and save. 2. (Optional) For persistence analyse, load the coordinates of the boundary of the foraging patch. Each time a new trajectory coordinate is uploaded, the old boundary coordinates will be automatically removed, in case the user forgets to upload the corresponding new boundary. 3. Select the mode to compute sampling frequency: - Sampling frequency: manually set Fs value - Trail width: auto-calculate Fs from path width: Fs=W/mean(dl), where mean(dl) is the mean distance between two sampling points. - For smoothness analyses, Fs should be ≥2. But 2 is already optimal, with minimal measuring noises (Wang, 2026, Ichnos) 4. Choose signal type: - Turning angle series (dθ) for the study focusing on the tracemaker's anatomy and locomotion, which reflects the mechanical constraints. - Fluctuation component of the turning angle series (dθ-mean(dθ)) for the study forcusing on tracemaker's behaviour variation. - Some features, e.g., smoothness or persistence, are not affected by the choice. 5. Select plots: - [Deviation angle series] (Wang & Rahman, 2023, Palaeontolgy) Turning (deviation) angle between two sampling points. - [Frequency Spectrum] (Wang & Rahman, 2023, Palaeontolgy) Single-sided frequency spectrum of the trajectory. - [Autocorrelation] (Wang & Rahman, 2023, Palaeontolgy) Autocorrelation of the turning angle series. - [Persistence Barcode] (Wang & Shi, 2026, PNAS) Birth and death of each void when the normalized filter increases. - [Persistence Curve] (Wang & Shi, 2026, PNAS) Normalized persistence curve (number of voids per normalized area). 6. Select calculated metrics: - [Smoothness] (Wang et al., 2025, P. Roy. B) The minimal normalized radius of curvature, spectral powder for unsmooth locomotion and smoothness index. - [Spectrum] (Wang, 2026, Ichnos) Major (central) frequency and spectral centroid. - [Statistics] (Wang, 2026, Ichnos) Shannon Entropy of the turning angles per step, which measures the complexity of the trajectory, and excess kurosis of the turning angles per step. - [Persistence] (Wang & Shi, 2026, PNAS) This should only be used for random walks or concentrated foraging/grazing! It outputs the y-component of the centroid of the normalized persistence curve (P_bar*), which informs of the normalized sensory range: σ*=P_bar*/0.004815+1 7. Export results to Excel file 📧 Contact---------For questions or support, please contact the developer Zekun Wang:zekun.wang@nhm.ac.ukzekunwang@pku.edu.cn



