Modules
Arcos4py top level module.
This package is a python package for the detection and tracking of collective events intime-series data and raster images.
ARCOS(data, position_columns=['x'], frame_column='time', obj_id_column='id', measurement_column='meas', clid_column='clTrackID', n_jobs=1, **kwargs)
¶
Detects and tracks collective events in a tracked time-series dataset.
Requires binarized measurement column, that can be generated with the bin_measurements method. Tracking makes use of the dbscan algorithm, which is applied to every frame and subsequently connects collective events between frames located within eps distance of each other.
Attributes:
Name | Type | Description |
---|---|---|
data |
DataFrame
|
Data of tracked time-series in "long format". Can be used to acess modified dataframe at any point. |
position_columns |
list
|
List containing position column names strings inside data e.g. At least one dimension is required. |
frame_column |
str
|
Indicating the frame column in input_data. |
obj_id_column |
str
|
Indicating the track id/id column in input_data. |
measurement_column |
str
|
Indicating the measurement column in input_data. |
clid_column |
str
|
Indicating the column name containing the collective event ids. |
binarized_measurement_column |
str | None
|
Name of the binary column. This is generated based on the name of the measurement_column after binarization. Optionally can be set in order to provide a already binarized column to skip ARCOS binarization. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
DataFrame
|
Input Data of tracked time-series in "long format" containing position columns, a measurement and an object ID column. |
required |
position_columns |
list
|
List ontaining position column names strings inside data e.g. At least one dimension is required. |
['x']
|
frame_column |
str
|
Indicating the frame column in input_data. |
'time'
|
obj_id_column |
str
|
Indicating the track id/object id column in input_data. If None, the data is assumed to not have a tracking column. Binarization can only be performed without detrending. |
'id'
|
measurement_column |
str
|
Indicating the measurement column in input_data. |
'meas'
|
clid_column |
str
|
Indicating the column name containing the collective event ids. |
'clTrackID'
|
n_jobs |
str
|
Number of workers to spawn, -1 uses all available cpus. |
1
|
kwargs |
Any
|
Additional keyword arguments. Includes old parameter names for backwards compatibility. - posCols: List containing position column names strings inside data e.g. |
{}
|
Source code in arcos4py/_arcos4py.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|
bin_col: str | None
property
writable
¶
Return the name of the binarized measurement column.
id_column: str | None
property
writable
¶
Return the name of the id column.
posCols: list
property
writable
¶
Return the position columns.
bin_measurements(smooth_k=3, bias_k=51, peak_threshold=0.2, binarization_threshold=0.1, polynomial_degree=1, bias_method='runmed', **kwargs)
¶
Smooth, de-trend, and binarise the input data.
First a short-term median filter with size smoothK is applied to remove fast noise from the time series. If the de-trending method is set to "none", smoothing is applied on globally rescaled time series. The subsequent de-trending can be performed with a long-term median filter with the size biasK {biasMet = "runmed"} or by fitting a polynomial of degree polyDeg {biasMet = "lm"}.
After de-trending, if the global difference between min/max is greater than the threshold the signal is rescaled to the (0,1) range. The final signal is binarised using the binThr threshold
Parameters:
Name | Type | Description | Default |
---|---|---|---|
smooth_k |
int
|
Size of the short-term median smoothing filter. |
3
|
bias_k |
int
|
Size of the long-term de-trending median filter |
51
|
peak_threshold |
float
|
Threshold for rescaling of the de-trended signal. |
0.2
|
binarization_threshold |
float
|
Threshold for binary classification. |
0.1
|
polynomial_degree |
int
|
Sets the degree of the polynomial for lm fitting. |
1
|
bias_method |
str
|
De-trending method, one of ['runmed', 'lm', 'none']. If no id_column is provided, only 'none' is allowed. |
'runmed'
|
**kwargs |
Any
|
Additional keyword arguments. Includes old parameter names for backwards compatibility. - smoothK: Size of the short-term median smoothing filter. - biasK: Size of the long-term de-trending median filter - peakThr: Threshold for rescaling of the de-trended signal. - binThr: Threshold for binary classification. - polyDeg: Sets the degree of the polynomial for lm fitting. - biasMet: De-trending method, one of ['runmed', 'lm', 'none']. |
{}
|
Returns:
Type | Description |
---|---|
DataFrame
|
DataFrame with detrended/smoothed and binarized measurement column. |
Source code in arcos4py/_arcos4py.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
|
clip_meas(clip_low=0.001, clip_high=0.999)
¶
Clip measurement column to upper and lower quantiles defined in clip_low and clip_high.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
clip_low |
float
|
Lower clipping boundary (quantile). |
0.001
|
clip_high |
float
|
Upper clipping boundary (quantile). |
0.999
|
Returns:
Type | Description |
---|---|
DataFrame
|
Dataframe with in place clipped measurement column. |
Source code in arcos4py/_arcos4py.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|
clip_measurements(clip_low=0.001, clip_high=0.999)
¶
Clip measurement column to upper and lower quantiles defined in clip_low and clip_high.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
clip_low |
float
|
Lower clipping boundary (quantile). |
0.001
|
clip_high |
float
|
Upper clipping boundary (quantile). |
0.999
|
Returns:
Type | Description |
---|---|
DataFrame
|
Dataframe with in place clipped measurement column. |
Source code in arcos4py/_arcos4py.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
|
interpolate_measurements()
¶
Interpolates NaN's in place in measurement column.
Returns:
Type | Description |
---|---|
DataFrame
|
Dataframe with interpolated measurement column. |
Source code in arcos4py/_arcos4py.py
131 132 133 134 135 136 137 138 139 |
|
trackCollev(eps=1, eps_prev=None, min_clustersize=1, n_prev=1, clustering_method='dbscan', linking_method='nearest', min_samples=None, **kwargs)
¶
Detects and tracks collective events in a tracked time-series dataset.
Makes use of the dbscan algorithm, applies this to every timeframe and subsequently connects collective events between frames located within eps distance of each other.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
eps |
float
|
The maximum distance between two samples for one to be considered as in the neighbourhood of the other. This is not a maximum bound on the distances of points within a cluster. |
1
|
eps_prev |
float | None
|
Frame to frame distance, value is used to connect collective events across multiple frames.If "None", same value as eps is used. |
None
|
min_clustersize |
int
|
The minimum size for a cluster to be identified as a collective event |
1
|
n_prev |
int
|
Number of previous frames the tracking algorithm looks back to connect collective events |
1
|
clustering_method |
str
|
Clustering method, one of ['dbscan', 'hdbscan']. |
'dbscan'
|
min_samples |
int | None
|
The number of samples (or total weight) in a neighbourhood for a point to be considered as a core point. This includes the point itself. Only used if clustering_method is 'hdbscan'. If None, min_samples = min_clustersize. |
None
|
linking_method |
str
|
Linking method, one of ['nearest', 'transportation']. |
'nearest'
|
**kwargs |
Any
|
Additional keyword arguments. Includes old parameter names for backwards compatibility. - epsPrev: Frame to frame distance, value is used to connect collective events across multiple frames. - minClsz: The minimum size for a cluster to be identified as a collective event - nPrev: Number of previous frames the tracking algorithm looks back to connect collective events - clusteringMethod: Clustering method, one of ['dbscan', 'hdbscan']. - minSamples: The number of samples (or total weight) in a neighbourhood for a point to be considered as a core point. This includes the point itself. Only used if clustering_method is 'hdbscan'. If None, min_samples = min_clustersize. - linkingMethod: Linking method, one of ['nearest', 'transportation']. |
{}
|
Returns:
Type | Description |
---|---|
DataFrame
|
DataFrame with detected collective events across time. |
Source code in arcos4py/_arcos4py.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 |
|
track_collective_events(eps=1, eps_prev=None, min_clustersize=1, n_prev=1, clustering_method='dbscan', linking_method='nearest', min_samples=None, **kwargs)
¶
Detects and tracks collective events in a tracked time-series dataset.
Makes use of the dbscan algorithm, applies this to every timeframe and subsequently connects collective events between frames located within eps distance of each other.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
eps |
float
|
The maximum distance between two samples for one to be considered as in the neighbourhood of the other. This is not a maximum bound on the distances of points within a cluster. |
1
|
eps_prev |
float | None
|
Frame to frame distance, value is used to connect collective events across multiple frames.If "None", same value as eps is used. |
None
|
min_clustersize |
int
|
The minimum size for a cluster to be identified as a collective event |
1
|
n_prev |
int
|
Number of previous frames the tracking algorithm looks back to connect collective events |
1
|
clustering_method |
str
|
Clustering method, one of ['dbscan', 'hdbscan']. |
'dbscan'
|
min_samples |
int | None
|
The number of samples (or total weight) in a neighbourhood for a point to be considered as a core point. This includes the point itself. Only used if clustering_method is 'hdbscan'. If None, min_samples = min_clustersize. |
None
|
linking_method |
str
|
Linking method, one of ['nearest', 'transportation']. |
'nearest'
|
**kwargs |
Any
|
Additional keyword arguments. Includes old parameter names for backwards compatibility. - epsPrev: Frame to frame distance, value is used to connect collective events across multiple frames. - minClsz: The minimum size for a cluster to be identified as a collective event - nPrev: Number of previous frames the tracking algorithm looks back to connect collective events - clusteringMethod: Clustering method, one of ['dbscan', 'hdbscan']. - minSamples: The number of samples (or total weight) in a neighbourhood for a point to be considered as a core point. This includes the point itself. Only used if clustering_method is 'hdbscan'. If None, min_samples = min_clustersize. - linkingMethod: Linking method, one of ['nearest', 'transportation']. |
{}
|
Returns:
Type | Description |
---|---|
DataFrame
|
DataFrame with detected collective events across time. |
Source code in arcos4py/_arcos4py.py
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
|
track_events_dataframe(X, position_columns, frame_column, id_column=None, binarized_measurement_column=None, clid_column='collid', eps=1.0, eps_prev=None, min_clustersize=3, min_samples=None, clustering_method='dbscan', linking_method='nearest', allow_merges=False, allow_splits=False, stability_threshold=10, remove_small_clusters=False, min_size_for_split=1, reg=1, reg_m=10, cost_threshold=0, n_prev=1, predictor=False, n_jobs=1, show_progress=True, **kwargs)
¶
Function to track collective events in a dataframe.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
DataFrame
|
The input dataframe containing the data to track. |
required |
position_columns |
List[str]
|
The names of the columns representing coordinates. |
required |
frame_column |
str
|
The name of the column containing frame ids. |
required |
id_column |
str | None
|
The name of the column representing IDs. None if no such column. |
None
|
binarized_measurement_column |
str | None
|
The name of the column representing binarized measurements, if None all measurements are used. |
None
|
clid_column |
str
|
The name of the output column representing collective events, will be generated. |
'collid'
|
eps |
float
|
Maximum distance for clustering, default is 1. |
1.0
|
eps_prev |
float | None
|
Maximum distance for linking previous clusters, if None, eps is used. Default is None. |
None
|
min_clustersize |
int
|
Minimum cluster size. Default is 3. |
3
|
min_samples |
int
|
The number of samples (or total weight) in a neighbourhood for a point to be considered as a core point. This includes the point itself. Only used if clusteringMethod is 'hdbscan'. If None, minSamples = minClsz. |
None
|
clustering_method |
str
|
The method used for clustering, one of [dbscan, hdbscan]. Default is "dbscan". |
'dbscan'
|
linking_method |
str
|
The method used for linking, one of ['nearest', 'transportsolver']. Default is 'nearest'. |
'nearest'
|
allow_merges |
bool
|
Whether or not to allow merges. Default is False. |
False
|
allow_splits |
bool
|
Whether or not to allow splits. Default is False. |
False
|
stability_threshold |
int
|
Number of frames to consider for stability. Default is 10. |
10
|
remove_small_clusters |
bool
|
Whether or not to remove small clusters. Default is False. |
False
|
min_size_for_split |
int
|
Minimum size for a split. Default is 1. |
1
|
reg |
float
|
Regularization parameter for transportation solver. Default is 1. |
1
|
reg_m |
float
|
Regularization parameter for transportation solver. Default is 10. |
10
|
cost_threshold |
float
|
Cost threshold for transportation solver. Default is 0. |
0
|
n_prev |
int
|
Number of previous frames to consider. Default is 1. |
1
|
predictor |
bool | Callable
|
Whether or not to use a predictor. Default is False. True uses the default predictor. A callable can be passed to use a custom predictor. See default predictor method for details. |
False
|
n_jobs |
int
|
Number of jobs to run in parallel. Default is 1. |
1
|
show_progress |
bool
|
Whether or not to show progress bar. Default is True. |
True
|
**kwargs |
Any
|
Additional keyword arguments. Includes deprecated parameters for backwards compatibility. - epsPrev: Deprecated parameter for eps_prev. Use eps_prev instead. - minClSz: Deprecated parameter for min_clustersize. Use min_clustersize instead. - minSamples: Deprecated parameter for min_samples. Use min_samples instead. - clusteringMethod: Deprecated parameter for clustering_method. Use clustering_method instead. - linkingMethod: Deprecated parameter for linking_method. Use linking_method instead. - nPrev: Deprecated parameter for n_prev. Use n_prev instead. - nJobs: Deprecated parameter for n_jobs. Use n_jobs instead. - showProgress: Deprecated parameter for show_progress. Use show_progress instead. |
{}
|
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: Dataframe with tracked events. |
Source code in arcos4py/tools/_detect_events.py
1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 |
|
track_events_image(X, eps=1, eps_prev=None, min_clustersize=1, min_samples=None, clustering_method='dbscan', n_prev=1, predictor=False, linking_method='nearest', allow_merges=False, allow_splits=False, stability_threshold=10, remove_small_clusters=False, min_size_for_split=1, reg=1, reg_m=10, cost_threshold=0, dims='TXY', downsample=1, n_jobs=1, show_progress=True, **kwargs)
¶
Function to track events in an image using specified linking and clustering methods.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
ndarray
|
The input array containing the images to track. |
required |
eps |
float
|
Distance for clustering. Default is 1. |
1
|
eps_prev |
float | None
|
Maximum distance for linking previous clusters, if None, eps is used. Default is None. |
None
|
min_clustersize |
int
|
Minimum cluster size. Default is 1. |
1
|
min_samples |
int | None
|
The number of samples (or total weight) in a neighbourhood for a point to be considered as a core point. This includes the point itself. Only used if clusteringMethod is 'hdbscan'. If None, minSamples = minClsz. |
None
|
clustering_method |
str
|
The method used for clustering, one of [dbscan, hdbscan]. Default is "dbscan". |
'dbscan'
|
n_prev |
int
|
Number of previous frames to consider. Default is 1. |
1
|
predictor |
bool | Callable
|
Whether or not to use a predictor. Default is False. True uses the default predictor. A callable can be passed to use a custom predictor. See default predictor method for details. |
False
|
linking_method |
str
|
The method used for linking. Default is 'nearest'. |
'nearest'
|
allow_merges |
bool
|
Whether or not to allow merges. Default is False. |
False
|
allow_splits |
bool
|
Whether or not to allow splits. Default is False. |
False
|
stability_threshold |
int
|
The number of frames required for a stable merge or split. Default is 10. |
10
|
remove_small_clusters |
bool
|
Whether or not to remove small clusters. Default is False. |
False
|
min_size_for_split |
int
|
Minimum size for a split. Default is 1. |
1
|
reg |
float
|
Entropy regularization parameter for unbalanced OT algorithm (only for transportation linking). |
1
|
reg_m |
float
|
Marginal relaxation parameter for unbalanced OT (only for transportation linking). |
10
|
cost_threshold |
float
|
Threshold for filtering low-probability matches (only for transportation linking). |
0
|
dims |
str
|
String of dimensions in order, such as. Default is "TXY". Possible values are "T", "X", "Y", "Z". |
'TXY'
|
downsample |
int
|
Factor by which to downsample the image. Default is 1. |
1
|
n_jobs |
int
|
Number of jobs to run in parallel. Default is 1. |
1
|
show_progress |
bool
|
Whether or not to show progress bar. Default is True. |
True
|
**kwargs |
Any
|
Additional keyword arguments. Includes deprecated parameters for backwards compatibility. - epsPrev: Deprecated parameter for eps_prev. Use eps_prev instead. - minClSz: Deprecated parameter for min_clustersize. Use min_clustersize instead. - minSamples: Deprecated parameter for min_samples. Use min_samples instead. - clusteringMethod: Deprecated parameter for clustering_method. Use clustering_method instead. - linkingMethod: Deprecated parameter for linking_method. Use linking_method instead. - nPrev: Deprecated parameter for n_prev. Use n_prev instead. - nJobs: Deprecated parameter for n_jobs. Use n_jobs instead. - showProgress: Deprecated parameter for show_progress. Use show_progress instead. |
{}
|
Returns:
Type | Description |
---|---|
ndarray | tuple[ndarray, LineageTracker]
|
np.ndarray: Array of images with tracked events. |
Source code in arcos4py/tools/_detect_events.py
1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 |
|
plotting
¶
Tools for plotting collective events.
LineagePlot(figsize=(18, 18), node_size=50, edge_width=2, edge_alpha=0.8, color_seed=42, title='Cluster Lineage Tree', xlabel='Frame', ylabel='Lineage', font_size=16, curve_factor=0.9, orphan_color=(0.7, 0.7, 0.7, 1.0), color_by='lineage_id', show_node_labels=False, main_lineage_id=None)
¶
Class to draw a lineage tree of clusters over time.
Attributes:
Name | Type | Description |
---|---|---|
figsize |
tuple
|
Size of the figure. |
node_size |
int
|
Size of the nodes. |
edge_width |
int
|
Width of the edges. |
edge_alpha |
float
|
Alpha value of the edges. |
color_seed |
int
|
Seed for the color generation. |
title |
str
|
Title of the plot. |
xlabel |
str
|
Label of the x-axis. |
ylabel |
str
|
Label of the y-axis. |
font_size |
int
|
Font size of the labels. |
curve_factor |
float
|
Factor to curve the edges. |
orphan_color |
tuple
|
Color of the orphan nodes. |
color_by |
str
|
Attribute to color the plot by ('lineage_id' or 'cluster_id'). |
show_node_labels |
bool
|
If True, display node labels on the plot. |
main_lineage_id |
int
|
The lineage ID of the main lineage to be plotted on the same row. |
Source code in arcos4py/plotting/_plotting.py
670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 |
|
draw_tree(tracker)
¶
Draw the lineage tree based on the processed data.
Source code in arcos4py/plotting/_plotting.py
1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 |
|
show()
¶
Display the plot.
Source code in arcos4py/plotting/_plotting.py
1059 1060 1061 |
|
NoodlePlot(df, clid_column='collid', obj_id_column='obj_id', frame_column='frame', posx='x', posy='y', posz=None, **kwargs)
¶
Create Noodle Plot of cell tracks, colored by collective event id.
Attributes:
Name | Type | Description |
---|---|---|
df |
DataFrame
|
DataFrame containing collective events from arcos. |
colev |
str
|
Name of the collective event column in df. |
trackid |
str
|
Name of the track column in df. |
frame |
str
|
Name of the frame column in df. |
posx |
str
|
Name of the X coordinate column in df. |
posy |
str
|
Name of the Y coordinate column in df. |
posz |
str
|
Name of the Z coordinate column in df, or None if no z column. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df |
DataFrame
|
DataFrame containing collective events from arcos. |
required |
clid_column |
str
|
Name of the collective event column in df. |
'collid'
|
obj_id_column |
str
|
Name of the track column in df. |
'obj_id'
|
frame_column |
str
|
Name of the frame column in df. |
'frame'
|
posx |
str
|
Name of the X coordinate column in df. |
'x'
|
posy |
str
|
Name of the Y coordinate column in df. |
'y'
|
posz |
str | None
|
Name of the Z coordinate column in df, or None if no z column. |
None
|
**kwargs |
Any
|
Additional keyword arguments for plot. Includes deprecated parameters. - colev (str): Deprecated. Use clid_column instead. - trackid (str): Deprecated. Use obj_id_column instead. - frame (str): Deprecated. Use frame_column instead. |
{}
|
Source code in arcos4py/plotting/_plotting.py
459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 |
|
plot(projection_axis, color_cylce=TAB20)
¶
Create Noodle Plot of cell tracks, colored by collective event id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
projection_axis |
str
|
Specify with witch coordinate the noodle plot should be drawn. Has to be one of the posx, posy or posz arguments passed in during the class instantiation process. |
required |
color_cylce |
list[str]
|
List of hex color values or string names (i.e. ['red', 'yellow']) used to color collecitve events. Cycles through list. |
TAB20
|
Returns:
Name | Type | Description |
---|---|---|
fig |
Figure
|
Matplotlib figure object for the noodle plot. |
axes |
Axes
|
Matplotlib axes for the nooble plot. |
Source code in arcos4py/plotting/_plotting.py
610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 |
|
dataPlots(data, frame_column='frame', measurement_column='m', obj_id_column='obj_id', **kwargs)
¶
Plot different metrics of input data.
Attributes:
Name | Type | Description |
---|---|---|
data |
Dataframe
|
containing ARCOS data. |
frame_column |
str
|
name of frame column in data. |
measurement_column |
str
|
name of measurement column in data. |
obj_id_column |
str
|
name of track id column. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Dataframe
|
containing ARCOS data. |
required |
frame_column |
str
|
name of frame column in data. |
'frame'
|
measurement_column |
str
|
name of measurement column in data. |
'm'
|
obj_id_column |
str
|
name of track id column. |
'obj_id'
|
**kwargs |
Any
|
Additional keyword arguments. Includes deprecated parameters. - id (str): Deprecated. Use obj_id_column instead. - frame (str): Deprecated. Use frame_column instead. - measurement (str): Deprecated. Use measurement_column instead. |
{}
|
Source code in arcos4py/plotting/_plotting.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
|
density_plot(*args, **kwargs)
¶
Density plot of measurement.
Uses Seaborn distplot to plot measurement density.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*args |
Any
|
arguments passed on to seaborn histplot function. |
()
|
**kwargs |
Any
|
keyword arguments passed on to seaborn histplot function. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
FacetGrid |
FacetGrid
|
Seaborn FacetGrid of density density plot. |
Source code in arcos4py/plotting/_plotting.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
|
histogram(bins='auto', *args, **kwargs)
¶
Histogram of tracklenght.
Uses seaborn histplot function to plot tracklenght histogram.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bins |
str
|
number or width of bins in histogram |
'auto'
|
*args |
Any
|
arguments passed on to seaborn histplot function. |
()
|
**kwargs |
Any
|
keyword arguments passed on to seaborn histplot function. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
AxesSubplot |
Axes
|
Matplotlib AxesSubplot of histogram. |
Source code in arcos4py/plotting/_plotting.py
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
|
position_t_plot(position_columns={'x'}, n=20, **kwargs)
¶
Plots X and Y over T to visualize tracklength.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
position_columns |
set
|
containing names of position columns in data. |
{'x'}
|
n |
int
|
number of samples to plot. |
20
|
**kwargs |
Any
|
Additional keyword arguments. Includes deprecated parameters. - posCol (set): Deprecated. Use position_columns instead. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
fig |
Figure
|
Matplotlib figure object of density plot. |
axes |
Axes
|
Matplotlib axes of density plot. |
Source code in arcos4py/plotting/_plotting.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
|
plotOriginalDetrended(data, frame_column='frame', measurement_column='m', detrended_column='m_detrended', obj_id_column='obj_id', seed=42, **kwargs)
¶
Plot original and detrended data.
Attributes:
Name | Type | Description |
---|---|---|
data |
DataFrame
|
containing ARCOS data. |
frame_column |
str
|
name of frame column in data. |
measurement_column |
str
|
name of measurement column in data. |
detrended_column |
str
|
name of detrended column in data. |
obj_id_column |
str
|
name of track id column. |
seed |
int
|
seed for random number generator. |
Methods:
Name | Description |
---|---|
plot_detrended |
plot detrended data. |
plot_original |
plot original data. |
plot_original_and_detrended |
plot original and detrended data. |
Source code in arcos4py/plotting/_plotting.py
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
|
plot_detrended(n_samples=25, subplots=(5, 5), plotsize=(20, 10), add_binary_segments=False)
¶
Plots detrended data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_samples |
int
|
number of samples to plot. |
25
|
subplots |
tuple
|
number of subplots in x and y direction. |
(5, 5)
|
plotsize |
tuple
|
size of the plot. |
(20, 10)
|
add_binary_segments |
bool
|
if True, binary segments are added to the plot. |
False
|
Returns:
Name | Type | Description |
---|---|---|
fig |
Figure
|
Matplotlib figure object of plot. |
axes |
Axes
|
Matplotlib axes of plot. |
Source code in arcos4py/plotting/_plotting.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 |
|
plot_original(n_samples=25, subplots=(5, 5), plotsize=(20, 10), add_binary_segments=False)
¶
Plots original data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_samples |
int
|
number of samples to plot. |
25
|
subplots |
tuple
|
number of subplots in x and y direction. |
(5, 5)
|
plotsize |
tuple
|
size of the plot. |
(20, 10)
|
add_binary_segments |
bool
|
if True, binary segments are added to the plot. |
False
|
Returns:
Name | Type | Description |
---|---|---|
fig |
Figure
|
Matplotlib figure object of plot. |
axes |
Axes
|
Matplotlib axes of plot. |
Source code in arcos4py/plotting/_plotting.py
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 |
|
plot_original_and_detrended(n_samples=25, subplots=(5, 5), plotsize=(20, 10), add_binary_segments=False)
¶
Plots original and detrended data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_samples |
int
|
number of samples to plot. |
25
|
subplots |
tuple
|
number of subplots in x and y direction. |
(5, 5)
|
plotsize |
tuple
|
size of the plot. |
(20, 10)
|
add_binary_segments |
bool
|
if True, binary segments are added to the plot. |
False
|
Returns:
Name | Type | Description |
---|---|---|
fig |
Figure
|
Matplotlib figure object of plot. |
axes |
Axes
|
Matplotlib axes of plot. |
Source code in arcos4py/plotting/_plotting.py
382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 |
|
statsPlots(data)
¶
Plot data generated by the stats module.
Attributes:
Name | Type | Description |
---|---|---|
data |
DataFrame
|
containing ARCOS stats data. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
DataFrame
|
containing ARCOS stats data. |
required |
Source code in arcos4py/plotting/_plotting.py
420 421 422 423 424 425 426 |
|
plot_events_duration(total_size, duration, point_size=40, *args, **kwargs)
¶
Scatterplot of collective event duration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
total_size |
str
|
name of total size column. |
required |
duration |
str
|
, name of column with collective event duration. |
required |
point_size |
int
|
scatterplot point size. |
40
|
*args |
Any
|
Arguments passed on to seaborn scatterplot function. |
()
|
**kwargs |
Any
|
Keyword arguments passed on to seaborn scatterplot function. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
Axes |
Axes
|
Matplotlib Axes object of scatterplot |
Source code in arcos4py/plotting/_plotting.py
428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 |
|
save_animation_frames(arcos_data, all_cells_data, output_dir, frame_col, collid_col, pos_cols, measurement_col=None, bin_col=None, plot_all_cells=True, color_all_cells_by_measurement=True, plot_bin_cells=True, plot_events=True, plot_convex_hulls=True, point_size=10.0, event_cmap=DEFAULT_EVENT_CMAP, event_alpha=0.9, hull_alpha=0.8, hull_linewidth_size_factor=1.0, bin_cell_color=DEFAULT_BIN_COLOR, bin_cell_alpha=0.7, bin_cell_marker_factor=0.8, all_cells_cmap=DEFAULT_ALL_CELLS_CMAP, all_cells_fixed_color=DEFAULT_ALL_CELLS_FIXED_COLOR, all_cells_alpha=0.5, all_cells_marker_size_factor=0.2, measurement_min_max=None, add_measurement_colorbar=True, filename_prefix='frame', dpi=150)
¶
Generates and saves individual frames of a cell activity visualization as PNG images.
This function acts as a caller for the yield_animation_frames
generator.
It handles the iteration over frames, saving each frame to a file with
appropriate naming and padding, and ensures figures are closed to free memory.
Parameters¶
arcos_data : pd.DataFrame
DataFrame containing cell activity data, potentially including collective
event IDs (collid_col
) and binarization status (bin_col
).
all_cells_data : pd.DataFrame
DataFrame containing all cells (or a representative background set)
for background plotting. Must include frame_col
, pos_cols
, and
measurement_col
if color_all_cells_by_measurement
is True.
output_dir : str
Directory where the output frames will be saved.
frame_col : str
Name of the column indicating the time frame.
collid_col : str
Name of the column indicating the collective event ID.
Values > 0 are treated as events.
pos_cols : List[str]
List of column names for spatial coordinates (e.g., ['x', 'y'] or ['x', 'y', 'z']).
measurement_col : Optional[str], optional
Name of the column containing the measurement value. REQUIRED if
color_all_cells_by_measurement
is True. Used for coloring background cells.
Default None.
bin_col : Optional[str], optional
Name of the column indicating binarized activity (e.g., values > 0 mean
binarized). Used for plot_bin_cells
. Default None.
plot_all_cells : bool, optional
Whether to plot the background cells from all_cells_data
. Default True.
color_all_cells_by_measurement : bool, optional
If True and plot_all_cells
is True, color background cells using
measurement_col
and all_cells_cmap
. Requires measurement_col
to
be valid in all_cells_data
. If False or requirements not met, uses
all_cells_fixed_color
. Default True.
plot_bin_cells : bool, optional
Whether to plot cells marked active by bin_col
but not part of a
collective event (collid_col
<= 0). Requires bin_col
to be set.
Default True.
plot_events : bool, optional
Whether to plot cells identified as part of collective events
(collid_col
> 0). Default True.
plot_convex_hulls : bool, optional
Whether to draw convex hulls around collective events (2D only).
Default True.
point_size : float, optional
Base size for plotted points (event cells). Default 10.0.
event_cmap : str, optional
Name of the Matplotlib colormap used to assign unique colors to
different collective event IDs. Default 'tab20'.
event_alpha : float, optional
Alpha transparency for event cells. Default 0.9.
hull_alpha : float, optional
Alpha transparency for convex hull lines. Default 0.8.
hull_linewidth_size_factor : float, optional
Size factor for convex hull line width. Default 1.0.
bin_cell_color : str, optional
Color for binarized (non-event) cells. Default 'black'.
bin_cell_alpha : float, optional
Alpha transparency for binarized (non-event) cells. Default 0.7.
bin_cell_marker_factor : float, optional
Size multiplier for binarized (non-event) cells relative to point_size
.
Default 0.8.
all_cells_cmap : str, optional
Name of the Matplotlib colormap used for background cells when
color_all_cells_by_measurement
is True. Default 'viridis'.
all_cells_fixed_color : str, optional
Color for background cells if color_all_cells_by_measurement
is False
or requirements are not met. Default 'gray'.
all_cells_alpha : float, optional
Alpha transparency for background cells. Default 0.5.
all_cells_marker_size_factor : float, optional
Size multiplier for background cells relative to point_size
. Default 0.2.
measurement_min_max : Optional[Tuple[float, float]], optional
Manual min/max values for the measurement colormap normalization. If None,
the range is determined from all_cells_data[measurement_col]
. Default None.
add_measurement_colorbar : bool, optional
If True and coloring all cells by measurement, add a static colorbar
to the figure. Default True.
filename_prefix : str, optional
Prefix for the output filenames. Default 'frame'.
dpi : int, optional
DPI for the saved images. Default 150.
Source code in arcos4py/plotting/_plotting.py
1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 |
|
tools
¶
Tools for detecting collective events.
DataFrameTracker(linker, position_columns=['x'], frame_column='frame', obj_id_column=None, binarized_measurement_column=None, clid_column='clTrackID', **kwargs)
¶
Bases: BaseTracker
Tracker class for data frames that works in conjunction with the Linker class.
Methods:
Name | Description |
---|---|
track_iteration |
pd.DataFrame): Tracks events in a single frame. |
track |
pd.DataFrame) -> Generator: Main method for tracking events through the dataframe. Yields the tracked data frame for each iteration. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
linker |
Linker
|
The Linker object used for linking events. |
required |
position_columns |
list[str]
|
List of strings representing the coordinate columns. |
['x']
|
frame_column |
str
|
String representing the frame/timepoint column in the dataframe. |
'frame'
|
obj_id_column |
str | None
|
String representing the ID column, or None if not present. Defaults to None. |
None
|
binarized_measurement_column |
str | None
|
String representing the binary measurement column, or None if not present. Defaults to None. |
None
|
clid_column |
str
|
String representing the collision track ID column. Defaults to 'clTrackID'. |
'clTrackID'
|
kwargs |
Any
|
Additional keyword arguments. Includes deprecated parameters for backwards compatibility. - coordinates_column: Deprecated parameter for position_columns. Use position_columns instead. - collid_column: Deprecated parameter, use clid_column instead. - id_column: Deprecated parameter, use obj_id_column instead. - bin_meas_column: Deprecated parameter, use binarized_measurement_column instead. |
{}
|
Source code in arcos4py/tools/_detect_events.py
1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 |
|
track(x)
¶
Main method for tracking events through the dataframe. Yields the tracked dataframe for each iteration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
DataFrame
|
Dataframe to track. |
required |
Yields:
Name | Type | Description |
---|---|---|
Generator |
Generator
|
Tracked dataframe. |
Source code in arcos4py/tools/_detect_events.py
1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 |
|
track_iteration(x)
¶
Tracks events in a single frame. Returns dataframe with event ids.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
DataFrame
|
Dataframe to track. |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: Dataframe with event ids. |
Source code in arcos4py/tools/_detect_events.py
1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 |
|
ImageTracker(linker, downsample=1)
¶
Bases: BaseTracker
Tracker class for image data that works in conjunction with the Linker class.
Methods:
Name | Description |
---|---|
track_iteration |
np.ndarray): Tracks events in a single frame. Returns the tracked labels. |
track |
np.ndarray, dims: str = "TXY") -> Generator: Main method for tracking events through the image series. Yields the tracked image for each iteration. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
linker |
Linker
|
The Linker object used for linking events. |
required |
downsample |
int
|
Downsampling factor for the images. Defaults to 1, meaning no downsampling. |
1
|
Source code in arcos4py/tools/_detect_events.py
1611 1612 1613 1614 1615 1616 1617 1618 1619 |
|
track(x, dims='TXY')
¶
Method for tracking events through the image series. Yields the tracked image for each iteration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
ndarray
|
Image to track. |
required |
dims |
str
|
String of dimensions in order. Default is "TXY". Possible values are "T", "X", "Y", and "Z". |
'TXY'
|
Returns:
Name | Type | Description |
---|---|---|
Generator |
Generator
|
Generator that yields the tracked image for each iteration. |
Source code in arcos4py/tools/_detect_events.py
1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 |
|
track_iteration(x)
¶
Tracks events in a single frame. Returns the tracked labels.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
ndarray
|
Image to track. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Tracked labels. |
Source code in arcos4py/tools/_detect_events.py
1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 |
|
Linker(eps=1, eps_prev=None, min_clustersize=1, min_samples=None, clustering_method='dbscan', linking_method='nearest', predictor=True, n_prev=1, cost_threshold=0, reg=1, reg_m=10, n_jobs=1, allow_merges=False, allow_splits=False, stability_threshold=10, remove_small_clusters=False, min_size_for_split=1, **kwargs)
¶
Linker class to link clusters across frames and detect collective events.
Attributes:
Name | Type | Description |
---|---|---|
event_ids |
ndarray
|
The event IDs. |
frame_counter |
int
|
The current frame counter. |
LineageTracker |
LineageTracker
|
The LineageTracker object. |
Methods:
Name | Description |
---|---|
link |
Links clusters across frames and detects collective events. |
get_event_ids |
Returns the event IDs. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
eps |
float
|
The maximum distance between two samples for one to be considered as in the neighbourhood of the other. |
1
|
eps_prev |
float | None
|
Frame to frame distance, value is used to connect collective events across multiple frames. If "None", same value as eps is used. |
None
|
min_clustersize |
int
|
The minimum size for a cluster to be identified as a collective event. |
1
|
min_samples |
int | None
|
The number of samples (or total weight) in a neighbourhood for a point to be considered as a core point. This includes the point itself. Only used if clusteringMethod is 'hdbscan'. If None, minSamples = minClsz. |
None
|
clustering_method |
str | Callable
|
The clustering method to be used. One of ['dbscan', 'hdbscan']
or a callable that takes a 2d array of coordinates and returns a list of cluster labels.
Arguments |
'dbscan'
|
linking_method |
str
|
The linking method to be used. |
'nearest'
|
predictor |
bool | Callable
|
The predictor method to be used. |
True
|
n_prev |
int
|
Number of previous frames the tracking algorithm looks back to connect collective events. |
1
|
n_jobs |
int
|
Number of jobs to run in parallel (only for clustering algorithm). |
1
|
cost_threshold |
int
|
Threshold for filtering low-probability matches (only for transportation linking). |
0
|
reg |
float
|
Entropy regularization parameter for unbalanced OT algorithm (only for transportation linking). |
1
|
reg_m |
float
|
Marginal relaxation parameter for unbalanced OT (only for transportation linking). |
10
|
stability_threshold |
int
|
Number of consecutive frames a merge/split must persist to be considered stable. |
10
|
allow_merges |
bool
|
Whether to allow merges. |
False
|
allow_splits |
bool
|
Whether to allow splits. |
False
|
remove_small_clusters |
bool
|
Whether to remove clusters smaller than min_clustersize. |
False
|
min_size_for_split |
int
|
The minimum size for a cluster to be considered for splitting. Multiple of min_clustersize. |
1
|
kwargs |
Any
|
Additional keyword arguments. Includes deprecated parameters for backwards compatibility. - epsPrev: Deprecated parameter for eps_prev. Use eps_prev instead. - minClSz: Deprecated parameter for min_clustersize. Use min_clustersize instead. - minSamples: Deprecated parameter for min_samples. Use min_samples instead. - clusteringMethod: Deprecated parameter for clustering_method. Use clustering_method instead. - nPrev: Deprecated parameter for n_prev. Use n_prev instead. - nJobs: Deprecated parameter for n_jobs. Use n_jobs instead. |
{}
|
Source code in arcos4py/tools/_detect_events.py
980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 |
|
link(input_coordinates)
¶
Links clusters across frames and detects collective events.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_coordinates |
ndarray
|
The input coordinates. |
required |
Source code in arcos4py/tools/_detect_events.py
1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 |
|
binData(smooth_k=3, bias_k=51, peak_threshold=0.2, binarization_threshold=0.1, polynomial_degree=1, bias_method='runmed', n_jobs=1, **kwargs)
¶
Bases: detrender
Smooth, de-trend, and binarise the input data.
First a short-term median filter with size smoothK is applied to remove fast noise from the time series. If the de-trending method is set to "none", smoothing is applied on globally rescaled time series. The subsequent de-trending can be performed with a long-term median filter with the size biasK {biasMet = "runmed"} or by fitting a polynomial of degree polyDeg {biasMet = "lm"}.
After de-trending, if the global difference between min/max is greater than the threshold the signal is rescaled to the (0,1) range. The final signal is binarised using the binThr threshold.
Attributes:
Name | Type | Description |
---|---|---|
smoothK |
int
|
Size of the short-term median smoothing filter. |
biasK |
int
|
Size of the long-term de-trending median filter. |
peakThr |
float
|
Threshold for rescaling of the de-trended signal. |
binThr |
float
|
Threshold for binarizing the de-trended signal. |
polyDeg |
int
|
Sets the degree of the polynomial for lm fitting. |
biasMet |
str
|
De-trending method, one of ['runmed', 'lm', 'none']. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
smooth_k |
int
|
Size of the short-term median smoothing filter. |
3
|
bias_k |
int
|
Size of the long-term de-trending median filter. |
51
|
peak_threshold |
float
|
Threshold for rescaling of the de-trended signal. |
0.2
|
binarization_threshold |
float
|
Threshold for binarizing the de-trended signal. |
0.1
|
polynomial_degree |
int
|
Sets the degree of the polynomial for lm fitting. |
1
|
bias_method |
str
|
De-trending method, one of ['runmed', 'lm', 'none']. |
'runmed'
|
n_jobs |
int
|
Number of jobs to run in parallel. |
1
|
Source code in arcos4py/tools/_binarize_detrend.py
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
|
run(x, group_column, measurement_column, frame_column, **kwargs)
¶
Runs binarization and detrending.
If the bias_method is 'none', first it rescales the data to between [0,1], then local smoothing is applied to the measurement by groups, followed by binarization.
If bias_method is one of ['lm', 'runmed'], first the data is detrended locally with a median filter and then detrended globally, for 'lm' with a linear model and for 'runmed' with a median filter. Followed by binarization of the data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
DataFrame
|
The time-series data for smoothing, detrending and binarization. |
required |
group_column |
str | None
|
Object id column in x. Detrending and rescaling is performed on a per-object basis. If None, no detrending is performed, only rescaling and bias method is ignored. |
required |
measurement_column |
str
|
Measurement column in x on which detrending and rescaling is performed. |
required |
frame_column |
str
|
Frame column in Time-series data. Used for sorting. |
required |
**kwargs |
Any
|
Additional keyword arguments. Includes old parameters for backwards compatibility. - GroupCol (str): Object id column in x. Detrending and rescaling is performed on a per-object basis. - colMeas (str): Measurement column in x on which detrending and rescaling is performed. - colFrame (str): Frame column in Time-series data. Used for sorting. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
DataFrame |
DataFrame
|
Dataframe containing binarized data, rescaled data and the original columns. |
Source code in arcos4py/tools/_binarize_detrend.py
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
|
calcCollevStats()
¶
Class to calculate statistics of collective events.
Source code in arcos4py/tools/_stats.py
358 359 360 361 362 363 364 |
|
calculate(data, frame_column, collid_column, obj_id_column, posCol=None)
¶
Calculate summary statistics for collective events based on the entire duration of each event.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
DataFrame
|
Input data containing information on the collective events. |
required |
frame_column |
str
|
The column name representing the frame numbers. |
required |
collid_column |
str
|
The column name representing the collective event IDs. |
required |
obj_id_column |
str
|
The column name representing the object IDs. Defaults to None. |
required |
posCol |
list
|
List of column names representing the position coordinates. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: A DataFrame containing the summary statistics of the collective events. |
Deprecated
Source code in arcos4py/tools/_stats.py
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 |
|
clipMeas(data)
¶
Clip input array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
ndarray
|
To be clipped. |
required |
Source code in arcos4py/tools/_cleandata.py
54 55 56 57 58 59 60 |
|
clip(clip_low=0.001, clip_high=0.999)
¶
Clip input array to upper and lower quantiles defined in clip_low and clip_high.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
clip_low |
float
|
Lower clipping boundary (quantile). |
0.001
|
clip_high |
float
|
Upper clipping boundry (quantille). |
0.999
|
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray (np.ndarray): A clipped array of the input data. |
Source code in arcos4py/tools/_cleandata.py
80 81 82 83 84 85 86 87 88 89 90 91 92 |
|
detectCollev(input_data, eps=1, epsPrev=None, minClSz=1, nPrev=1, posCols=['x'], frame_column='time', id_column=None, bin_meas_column='meas', clid_column='clTrackID', dims='TXY', method='dbscan', min_samples=None, linkingMethod='nearest', n_jobs=1, predictor=False, show_progress=True)
¶
Class to detect collective events.
Attributes:
Name | Type | Description |
---|---|---|
input_data |
Union[DataFrame, ndarray]
|
The input data to track. |
eps |
float
|
Maximum distance for clustering, default is 1. |
epsPrev |
Union[float, None]
|
Maximum distance for linking previous clusters, if None, eps is used. Default is None. |
minClSz |
int
|
Minimum cluster size. Default is 3. |
nPrev |
int
|
Number of previous frames to consider. Default is 1. |
posCols |
list
|
List of column names for the position columns. Default is ["x"]. |
frame_column |
str
|
Name of the column containing the frame number. Default is 'time'. |
id_column |
Union[str, None]
|
Name of the column containing the id. Default is None. |
bin_meas_column |
Union[str, None]
|
Name of the column containing the binary measurement. Default is 'meas'. |
clid_column |
str
|
Name of the column containing the cluster id. Default is 'clTrackID'. |
dims |
str
|
String of dimensions in order, such as. Default is "TXY". Possible values are "T", "X", "Y", "Z". |
method |
str
|
The method used for clustering, one of [dbscan, hdbscan]. Default is "dbscan". |
min_samples |
int | None
|
The number of samples (or total weight) in a neighbourhood for a point to be considered as a core point. This includes the point itself. Only used if clusteringMethod is 'hdbscan'. If None, minSamples = minClsz. |
linkingMethod |
str
|
The method used for linking. Default is 'nearest'. |
n_jobs |
int
|
Number of jobs to run in parallel. Default is 1. |
predictor |
bool | Callable
|
Whether or not to use a predictor. Default is False. True uses the default predictor. A callable can be passed to use a custom predictor. See default predictor method for details. |
show_progress |
bool
|
Whether or not to show progress bar. Default is True. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_data |
DataFrame
|
Input data to be processed. Must contain a binarized measurement column. |
required |
eps |
float
|
The maximum distance between two samples for one to be considered as in the neighbourhood of the other. This is not a maximum bound on the distances of points within a cluster. |
1
|
epsPrev |
float | None
|
Frame to frame distance, value is used to connect collective events across multiple frames.If "None", same value as eps is used. |
None
|
minClSz |
int
|
Minimum size for a cluster to be identified as a collective event. |
1
|
nPrev |
int
|
Number of previous frames the tracking algorithm looks back to connect collective events. |
1
|
posCols |
list
|
List of position columns contained in the data. Must at least contain one. |
['x']
|
frame_column |
str
|
Indicating the frame column in input_data. |
'time'
|
id_column |
str | None
|
Indicating the track id/id column in input_data, optional. |
None
|
bin_meas_column |
str
|
Indicating the bin_meas_column in input_data or None. |
'meas'
|
clid_column |
str
|
Indicating the column name containing the ids of collective events. |
'clTrackID'
|
dims |
str
|
String of dimensions in order, used if input_data is a numpy array. Default is "TXY". Possible values are "T", "X", "Y", "Z". |
'TXY'
|
method |
str
|
The method used for clustering, one of [dbscan, hdbscan]. Default is "dbscan". |
'dbscan'
|
min_samples |
int | None
|
The number of samples (or total weight) in a neighbourhood for a point to be considered as a core point. This includes the point itself. Only used if clusteringMethod is 'hdbscan'. If None, minSamples = minClsz. |
None
|
linkingMethod |
str
|
The method used for linking. Default is 'nearest'. |
'nearest'
|
n_jobs |
int
|
Number of paralell workers to spawn, -1 uses all available cpus. |
1
|
predictor |
bool | Callable
|
Whether or not to use a predictor. Default is False. True uses the default predictor. A callable can be passed to use a custom predictor. See default predictor method for details. |
False
|
show_progress |
bool
|
Whether or not to show progress bar. Default is True. |
True
|
Source code in arcos4py/tools/_detect_events.py
2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 |
|
run(copy=True)
¶
Runs the collective event detection algorithm.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
copy |
bool
|
Whether or not to copy the input data. Default is True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
DataFrame |
DataFrame
|
Input data with added collective event ids. |
Source code in arcos4py/tools/_detect_events.py
2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 |
|
filterCollev(data, frame_column='time', clid_column='collid', obj_id_column='trackID', **kwargs)
¶
Select Collective events that last longer than coll_duration and have a larger total size than coll_total_size.
Attributes:
Name | Type | Description |
---|---|---|
data |
Dataframe
|
With detected collective events. |
frame_column |
str
|
Indicating the frame column in data. |
collid_column |
str
|
Indicating the collective event id column in data. |
obj_id_column |
str
|
Inidicating the object identifier column such as cell track id. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Dataframe
|
With detected collective events. |
required |
frame_column |
str
|
Indicating the frame column in data. |
'time'
|
clid_column |
str
|
Indicating the collective event id column in data. |
'collid'
|
obj_id_column |
str
|
Inidicating the object identifier column such as cell track id. |
'trackID'
|
**kwargs |
Any
|
Additional keyword arguments. Includes deprecated parameters. - collid_column (str): Deprecated. Use clid_column instead. |
{}
|
Source code in arcos4py/tools/_filter_events.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|
filter(min_duration=9, min_total_size=10, **kwargs)
¶
Filter collective events.
Method to filter collective events according to the parameters specified in the object instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min_duration |
int
|
Minimal duration of collective events to be selected. |
9
|
min_total_size |
int
|
Minimal total size of collective events to be selected. |
10
|
**kwargs |
Any
|
Additional keyword arguments. Includes deprecated parameters. - coll_duration (int): Deprecated. Use min_duration instead. - coll_total_size (int): Deprecated. Use min_total_size instead. |
{}
|
Returns:
Type | Description |
---|---|
DataFrame
|
Returns pandas dataframe containing filtered collective events |
Source code in arcos4py/tools/_filter_events.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|
interpolation(data)
¶
Interpolate nan values in a numpy array.
Attributes:
Name | Type | Description |
---|---|---|
data |
DataFrame
|
Where NaN should be replaced with interpolated values. |
Uses pandas.interpolate with liner interpolation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
DataFrame
|
Where NaN should be replaced with interpolated values. |
required |
Source code in arcos4py/tools/_cleandata.py
30 31 32 33 34 35 36 37 38 |
|
interpolate()
¶
Interpolate nan and missing values.
Returns:
Name | Type | Description |
---|---|---|
DataFrame |
DataFrame
|
Interpolated input data. |
Source code in arcos4py/tools/_cleandata.py
40 41 42 43 44 45 46 47 48 |
|
calculate_statistics(data, frame_column='frame', clid_column='collid', obj_id_column=None, position_columns=None, **kwargs)
¶
Calculate summary statistics for collective events based on the entire duration of each event.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
DataFrame
|
Input data containing information on the collective events. |
required |
frame_column |
str
|
The column name representing the frame numbers. |
'frame'
|
clid_column |
str
|
The column name representing the collective event IDs. |
'collid'
|
obj_id_column |
str
|
The column name representing the object IDs. Defaults to None. |
None
|
position_columns |
List[str]
|
List of column names representing the position coordinates. Defaults to None. |
None
|
**kwargs |
Any
|
Additional keyword arguments. Includes deprecated parameters. - collid_column (str): Deprecated. Use clid_column instead. - pos_columns (List[str], optional): Deprecated. Use position_columns instead. |
{}
|
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: A DataFrame containing the summary statistics of the collective events. |
Statistics Calculated
- collid: The unique ID representing each collective event.
- duration: The duration of each event, calculated as the difference between the maximum and minimum frame values plus one.
- first_timepoint, last_timepoint: The first and last frames in which each event occurs.
- total_size: The total number of unique objects involved in each event (calculated if obj_id_column is provided).
- min_size, max_size: The minimum and maximum size of each event, defined as the number of objects in the event's smallest and largest frames, respectively.
- first_frame_centroid_x, first_frame_centroid_y, last_frame_centroid_x, last_frame_centroid_y: The x and y coordinates of the centroid of all objects in the first and last frames of each event (calculated if posCol is provided).
- centroid_speed: The speed of the centroid, calculated as the distance between the first and last frame centroids divided by the duration (calculated if posCol is provided).
- direction: The direction of motion of the centroid, calculated as the arctangent of the change in y divided the change in x (calculated if posCol is provided).
- first_frame_spatial_extent, last_frame_spatial_extent: The maximum distance between any pair of objects in the first and last frames (calculated if posCol is provided).
- first_frame_convex_hull_area, last_frame_convex_hull_area: The areas of the convex hulls enclosing all objects in the first and last frames (calculated if posCol is provided).
- size_variability: The standard deviation of the event size over all frames, providing a measure of the variability in the size of the event over time (calculated if obj_id_column is provided).
Source code in arcos4py/tools/_stats.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 |
|
calculate_statistics_per_frame(data, frame_column='frame', clid_column='collid', position_columns=None, **kwargs)
¶
Calculate summary statistics for collective events based on the entire duration of each event.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
DataFrame
|
Input data containing information on the collective events. |
required |
frame_column |
str
|
The column name representing the frame numbers. |
'frame'
|
clid_column |
str
|
The column name representing the collective event IDs. |
'collid'
|
position_columns |
List[str]
|
List of column names representing the position coordinates. Defaults to None. |
None
|
**kwargs |
Any
|
Additional keyword arguments. Includes deprecated parameters. - collid_column (str): Deprecated. Use clid_column instead. - pos_columns (List[str], optional): Deprecated. Use position_columns instead. |
{}
|
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: A DataFrame containing the summary statistics of the collective events. |
Statistics Calculated
- collid: The unique ID representing each collective event.
- frame: The frame number.
- size: The number of objects in the collective event
- centroid_x, centroid_y: The x and y coordinates of the centroid of all objects in the collective event (calculated if pos_columns is provided).
- spatial_extent: The maximum distance between any pair of objects in the collective event (calculated if pos_columns is provided).
- convex_hull_area: The area of the convex hull enclosing all objects in the collective event (calculated if pos_columns is provided).
- direction: The direction of motion of the centroid, calculated as the arctangent of the change in y divided the change in x (calculated if pos_columns is provided).
- centroid_speed: The speed of the centroid, calculated as the norm of the change in x and y divided by the duration (calculated if pos_columns is provided).
Source code in arcos4py/tools/_stats.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
|
estimate_eps(data=None, image=None, method='kneepoint', position_columns=None, frame_column='t', n_neighbors=5, plot=True, plt_size=(5, 5), max_samples=50000, binarize_threshold=0, **kwargs)
¶
Estimates eps parameter for DBSCAN using the k-distance graph method.
Works with either point data in a DataFrame or pixel data from an image/image series.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Optional[DataFrame]
|
DataFrame containing coordinates and frame info. Required if 'image' is None. |
None
|
image |
Optional[ndarray]
|
Image array (2D) or time series (3D). Required if 'data' is None. |
None
|
method |
str
|
Method for choosing eps from k-distances: 'kneepoint', 'mean', 'median'. |
'kneepoint'
|
position_columns |
Optional[list[str]]
|
Column names for spatial coordinates in 'data'. Defaults to ['y', 'x'] for 2D images or ['y', 'x', 'z'] for 3D. Required if 'data' is provided. |
None
|
frame_column |
str
|
Column name for frame/time in 'data'. Defaults to 't'. |
't'
|
n_neighbors |
int
|
The 'k' for k-distance calculation (distance to k-th neighbor). Typically set to MinPts-1 for DBSCAN. Defaults to 5. |
5
|
plot |
bool
|
If True, plots the sorted k-distance graph with the estimated eps. |
True
|
plt_size |
tuple[int, int]
|
Figure size for the plot. |
(5, 5)
|
max_samples |
int
|
Max number of k-distances to use for estimation (subsampling). |
50000
|
binarize_threshold |
float
|
Threshold for converting 'image' pixels to points. |
0
|
**kwargs |
Any
|
Additional keyword arguments passed to the estimation method. For 'kneepoint': S, online, curve, interp_method, direction, polynomial_degree. For 'mean'/'median': mean_multiplier, median_multiplier (defaults to 1.5). |
{}
|
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
Estimated eps value. |
Raises:
Type | Description |
---|---|
ValueError
|
If input requirements are not met (e.g., both/neither data/image given, missing columns, no valid distances found). |
Source code in arcos4py/tools/_detect_events.py
2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 |
|
remove_image_background(image, filter_type='gaussian', size=(10, 1, 1), dims='TXY', crop_time_axis=False)
¶
Removes background from images. Assumes axis order (t, y, x) for 2d images and (t, z, y, x) for 3d images.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image |
ndarray
|
Image to remove background from. |
required |
filter_type |
Union[str, function]
|
Filter to use to remove background. Can be one of ['median', 'gaussian']. |
'gaussian'
|
size |
(int, Tuple)
|
Size of filter to use. For median filter, this is the size of the window. For gaussian filter, this is the standard deviation. If a single int is passed in, it is assumed to be the same for all dimensions. If a tuple is passed in, it is assumed to correspond to the size of the filter in each dimension. Default is (10, 1, 1). |
(10, 1, 1)
|
dims |
str
|
Dimensions to apply filter over. Can be one of ['TXY', 'TZXY']. Default is 'TXY'. |
'TXY'
|
crop_time_axis |
bool
|
Whether to crop the time axis. Default is True. |
False
|
Returns (np.ndarray): Image with background removed. Along the first axis (t) half of the filter size is removed from the beginning and end respectively.
Source code in arcos4py/tools/_cleandata.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
track_events_dataframe(X, position_columns, frame_column, id_column=None, binarized_measurement_column=None, clid_column='collid', eps=1.0, eps_prev=None, min_clustersize=3, min_samples=None, clustering_method='dbscan', linking_method='nearest', allow_merges=False, allow_splits=False, stability_threshold=10, remove_small_clusters=False, min_size_for_split=1, reg=1, reg_m=10, cost_threshold=0, n_prev=1, predictor=False, n_jobs=1, show_progress=True, **kwargs)
¶
Function to track collective events in a dataframe.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
DataFrame
|
The input dataframe containing the data to track. |
required |
position_columns |
List[str]
|
The names of the columns representing coordinates. |
required |
frame_column |
str
|
The name of the column containing frame ids. |
required |
id_column |
str | None
|
The name of the column representing IDs. None if no such column. |
None
|
binarized_measurement_column |
str | None
|
The name of the column representing binarized measurements, if None all measurements are used. |
None
|
clid_column |
str
|
The name of the output column representing collective events, will be generated. |
'collid'
|
eps |
float
|
Maximum distance for clustering, default is 1. |
1.0
|
eps_prev |
float | None
|
Maximum distance for linking previous clusters, if None, eps is used. Default is None. |
None
|
min_clustersize |
int
|
Minimum cluster size. Default is 3. |
3
|
min_samples |
int
|
The number of samples (or total weight) in a neighbourhood for a point to be considered as a core point. This includes the point itself. Only used if clusteringMethod is 'hdbscan'. If None, minSamples = minClsz. |
None
|
clustering_method |
str
|
The method used for clustering, one of [dbscan, hdbscan]. Default is "dbscan". |
'dbscan'
|
linking_method |
str
|
The method used for linking, one of ['nearest', 'transportsolver']. Default is 'nearest'. |
'nearest'
|
allow_merges |
bool
|
Whether or not to allow merges. Default is False. |
False
|
allow_splits |
bool
|
Whether or not to allow splits. Default is False. |
False
|
stability_threshold |
int
|
Number of frames to consider for stability. Default is 10. |
10
|
remove_small_clusters |
bool
|
Whether or not to remove small clusters. Default is False. |
False
|
min_size_for_split |
int
|
Minimum size for a split. Default is 1. |
1
|
reg |
float
|
Regularization parameter for transportation solver. Default is 1. |
1
|
reg_m |
float
|
Regularization parameter for transportation solver. Default is 10. |
10
|
cost_threshold |
float
|
Cost threshold for transportation solver. Default is 0. |
0
|
n_prev |
int
|
Number of previous frames to consider. Default is 1. |
1
|
predictor |
bool | Callable
|
Whether or not to use a predictor. Default is False. True uses the default predictor. A callable can be passed to use a custom predictor. See default predictor method for details. |
False
|
n_jobs |
int
|
Number of jobs to run in parallel. Default is 1. |
1
|
show_progress |
bool
|
Whether or not to show progress bar. Default is True. |
True
|
**kwargs |
Any
|
Additional keyword arguments. Includes deprecated parameters for backwards compatibility. - epsPrev: Deprecated parameter for eps_prev. Use eps_prev instead. - minClSz: Deprecated parameter for min_clustersize. Use min_clustersize instead. - minSamples: Deprecated parameter for min_samples. Use min_samples instead. - clusteringMethod: Deprecated parameter for clustering_method. Use clustering_method instead. - linkingMethod: Deprecated parameter for linking_method. Use linking_method instead. - nPrev: Deprecated parameter for n_prev. Use n_prev instead. - nJobs: Deprecated parameter for n_jobs. Use n_jobs instead. - showProgress: Deprecated parameter for show_progress. Use show_progress instead. |
{}
|
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: Dataframe with tracked events. |
Source code in arcos4py/tools/_detect_events.py
1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 |
|
track_events_image(X, eps=1, eps_prev=None, min_clustersize=1, min_samples=None, clustering_method='dbscan', n_prev=1, predictor=False, linking_method='nearest', allow_merges=False, allow_splits=False, stability_threshold=10, remove_small_clusters=False, min_size_for_split=1, reg=1, reg_m=10, cost_threshold=0, dims='TXY', downsample=1, n_jobs=1, show_progress=True, **kwargs)
¶
Function to track events in an image using specified linking and clustering methods.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
ndarray
|
The input array containing the images to track. |
required |
eps |
float
|
Distance for clustering. Default is 1. |
1
|
eps_prev |
float | None
|
Maximum distance for linking previous clusters, if None, eps is used. Default is None. |
None
|
min_clustersize |
int
|
Minimum cluster size. Default is 1. |
1
|
min_samples |
int | None
|
The number of samples (or total weight) in a neighbourhood for a point to be considered as a core point. This includes the point itself. Only used if clusteringMethod is 'hdbscan'. If None, minSamples = minClsz. |
None
|
clustering_method |
str
|
The method used for clustering, one of [dbscan, hdbscan]. Default is "dbscan". |
'dbscan'
|
n_prev |
int
|
Number of previous frames to consider. Default is 1. |
1
|
predictor |
bool | Callable
|
Whether or not to use a predictor. Default is False. True uses the default predictor. A callable can be passed to use a custom predictor. See default predictor method for details. |
False
|
linking_method |
str
|
The method used for linking. Default is 'nearest'. |
'nearest'
|
allow_merges |
bool
|
Whether or not to allow merges. Default is False. |
False
|
allow_splits |
bool
|
Whether or not to allow splits. Default is False. |
False
|
stability_threshold |
int
|
The number of frames required for a stable merge or split. Default is 10. |
10
|
remove_small_clusters |
bool
|
Whether or not to remove small clusters. Default is False. |
False
|
min_size_for_split |
int
|
Minimum size for a split. Default is 1. |
1
|
reg |
float
|
Entropy regularization parameter for unbalanced OT algorithm (only for transportation linking). |
1
|
reg_m |
float
|
Marginal relaxation parameter for unbalanced OT (only for transportation linking). |
10
|
cost_threshold |
float
|
Threshold for filtering low-probability matches (only for transportation linking). |
0
|
dims |
str
|
String of dimensions in order, such as. Default is "TXY". Possible values are "T", "X", "Y", "Z". |
'TXY'
|
downsample |
int
|
Factor by which to downsample the image. Default is 1. |
1
|
n_jobs |
int
|
Number of jobs to run in parallel. Default is 1. |
1
|
show_progress |
bool
|
Whether or not to show progress bar. Default is True. |
True
|
**kwargs |
Any
|
Additional keyword arguments. Includes deprecated parameters for backwards compatibility. - epsPrev: Deprecated parameter for eps_prev. Use eps_prev instead. - minClSz: Deprecated parameter for min_clustersize. Use min_clustersize instead. - minSamples: Deprecated parameter for min_samples. Use min_samples instead. - clusteringMethod: Deprecated parameter for clustering_method. Use clustering_method instead. - linkingMethod: Deprecated parameter for linking_method. Use linking_method instead. - nPrev: Deprecated parameter for n_prev. Use n_prev instead. - nJobs: Deprecated parameter for n_jobs. Use n_jobs instead. - showProgress: Deprecated parameter for show_progress. Use show_progress instead. |
{}
|
Returns:
Type | Description |
---|---|
ndarray | tuple[ndarray, LineageTracker]
|
np.ndarray: Array of images with tracked events. |
Source code in arcos4py/tools/_detect_events.py
1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 |
|
validation
¶
Tools for validating detected collective events.
bootstrap_arcos(df, position_columns=['x'], frame_column='frame', obj_id_column='obj_id', measurement_column='m', method='shuffle_tracks', smooth_k=3, bias_k=51, peak_threshold=0.2, binarization_threshold=0.1, polynomial_degree=1, bias_method='runmed', eps=2, eps_prev=None, min_clustersize=1, n_prev=1, min_duration=1, min_total_size=1, stats_metric=['total_size', 'duration'], pval_alternative='greater', finite_correction=True, n=100, seed=42, allow_duplicates=False, max_tries=100, show_progress=True, verbose=False, parallel_processing=True, plot=True, **kwargs)
¶
Bootstrap data using the ARCOS algorithm.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df |
DataFrame
|
DataFrame containing the data to be bootstrapped. |
required |
position_columns |
list
|
List of column names containing the x and y coordinates. |
['x']
|
frame_column |
str
|
Name of the column containing the frame number. |
'frame'
|
obj_id_column |
str
|
Name of the column containing the track id. |
'obj_id'
|
measurement_column |
str
|
Name of the column containing the measurement. |
'm'
|
method |
str | list[str]
|
Method used for bootstrapping. Can be "shuffle_tracks", 'shuffle_timepoints', 'shift_timepoints', 'shuffle_binary_blocks', 'shuffle_coordinates_timepoint or a list of methods, which will be applied in order of index. |
'shuffle_tracks'
|
smooth_k |
int
|
Smoothing kernel size. |
3
|
bias_k |
int
|
Bias kernel size. |
51
|
peak_threshold |
float
|
Threshold for peak detection. |
0.2
|
binarization_threshold |
float
|
Threshold for binarization. |
0.1
|
polynomial_degree |
int
|
Degree of the polynomial used for bias correction. |
1
|
bias_method |
str
|
Bias correction method. Can be 'none', 'runmed', 'lm' |
'runmed'
|
eps |
float
|
Epsilon parameter for DBSCAN. |
2
|
eps_prev |
int | None
|
Parameter for linking tracks. If None, eps is used. |
None
|
min_clustersize |
int
|
Minimum cluster size. |
1
|
n_prev |
int
|
Number of previous frames to consider for linking. |
1
|
min_duration |
int
|
Minimum duration of a track. |
1
|
min_total_size |
int
|
Minimum size of a track. |
1
|
stats_metric |
str | list[str]
|
Metric to calculate. Can be "duration", "total_size", "min_size", "max_size" or a list of metrics. Default is ["duration", "total_size"]. |
['total_size', 'duration']
|
pval_alternative |
str
|
Alternative hypothesis for the p-value calculation. Can be "less" or "greater". |
'greater'
|
finite_correction |
bool
|
Correct p-values for finite sampling. Default is True. |
True
|
n |
int
|
Number of bootstraps. |
100
|
seed |
int
|
Seed for the random number generator. |
42
|
allow_duplicates |
bool
|
If False, resampling will check if the resampled data contains duplicates. If True, duplicates will be allowed. |
False
|
max_tries |
int
|
Maximum number of tries to resample data without duplicates. |
100
|
show_progress |
bool
|
Show a progress bar. |
True
|
verbose |
bool
|
Print additional information. |
False
|
parallel_processing |
bool
|
Use parallel processing. |
True
|
plot |
bool
|
Plot the distribution of the bootstrapped data. |
True
|
**kwargs |
Any
|
Additional keyword arguments. Includes deprecated parameters. - id_column: Deprecated. Use obj_id_column instead. - meas_column: Deprecated. Use measurement_column instead. - smoothK: Deprecated. Use smooth_k instead. - biasK: Deprecated. Use bias_k instead. - peakThr: Deprecated. Use peak_threshold instead. - binThr: Deprecated. Use binarization_threshold instead. - polyDeg: Deprecated. Use polynomial_degree instead. - biasMet: Deprecated. Use bias_method instead. - epsPrev: Deprecated. Use eps_prev instead. - minClsz: Deprecated. Use min_clustersize instead. - min_size: Deprecated. Use min_total_size instead. - paralell_processing: Deprecated. Use parallel_processing instead. |
{}
|
Returns:
Type | Description |
---|---|
DataFrame
|
DataFrame containing the bootstrapped data. |
Source code in arcos4py/validation/_bootstrapping.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
|
calculate_arcos_stats(df_resampled, iterations, position_columns=['x'], frame_column='frame', obj_id_column='obj_id', measurement_column='m', smooth_k=3, bias_k=51, peak_threshold=0.2, binarization_threshold=0.1, polynomial_degree=1, bias_method='runmed', eps=2, eps_prev=None, min_clustersize=1, n_prev=1, min_duration=1, min_total_size=1, stats_metric=['duration', 'total_size'], show_progress=True, parallel_processing=True, clid_column='clid', **kwargs)
¶
Calculate the bootstrapped statistics.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df_resampled |
DataFrame
|
Dataframe with resampled data. |
required |
iterations |
list[int]
|
List of iteration names, or range. |
required |
position_columns |
list
|
List of position columns.. |
['x']
|
frame_column |
str
|
Name of the frame column. |
'frame'
|
obj_id_column |
str
|
Name of the id column. |
'obj_id'
|
measurement_column |
str
|
Name of the measurement column. |
'm'
|
smooth_k |
int
|
Smoothing kernel size for local detrending. Defaults to 3. |
3
|
bias_k |
int
|
Bias kernel size for large scale detrending (used with biasMet='runmed'). Defaults to 51. |
51
|
peak_threshold |
float
|
Peak threshold used for rescaling (used with biasMet='runmed'). Defaults to 0.2. |
0.2
|
binarization_threshold |
float
|
Threshold for binarizing measurements after detrending. Defaults to 0.1. |
0.1
|
polynomial_degree |
int
|
Polynomial degree used for detrending (used with biasMet='lm'). Defaults to 1. |
1
|
bias_method |
str
|
Bias method, can be 'none', 'runmed', 'lm'. Defaults to "runmed". |
'runmed'
|
eps |
float
|
Epsilon used for culstering active entities. Defaults to 2. |
2
|
eps_prev |
int
|
Epsilon used for linking together culsters across time. Defaults to None. |
None
|
min_clustersize |
int
|
Minimum cluster size. Defaults to 1. |
1
|
n_prev |
int
|
Number of previous frames to consider when tracking clusters. Defaults to 1. |
1
|
min_duration |
int
|
Minimum duration of detected event. Defaults to 1. |
1
|
min_total_size |
int
|
Minimum size, minimum size of detected event. Defaults to 1. |
1
|
stats_metric |
list[str]
|
List of metrics to calculate. Defaults to ['duration', 'total_size']. |
['duration', 'total_size']
|
show_progress |
bool
|
Show progress bar. Defaults to True. |
True
|
parallel_processing |
bool
|
Use paralell processing, uses the joblib package. Defaults to True. |
True
|
clid_column |
str
|
Name of the cluster id column. Defaults to 'clid'. |
'clid'
|
**kwargs |
Any
|
Additional keyword arguments. Includes deprecated parameters. - posCols: Deprecated. Use position_columns instead. - id_column: Deprecated. Use obj_id_column instead. - meas_column: Deprecated. Use measurement_column instead. - smoothK: Deprecated. Use smooth_k instead. - biasK: Deprecated. Use bias_k instead. - peakThr: Deprecated. Use peak_threshold instead. - binThr: Deprecated. Use binarization_threshold instead. - polyDeg: Deprecated. Use polynomial_degree instead. - biasMet: Deprecated. Use bias_method instead. - epsPrev: Deprecated. Use eps_prev instead. - minClsz: Deprecated. Use min_clustersize instead. - min_size: Deprecated. Use min_total_size instead. - nPrev: Deprecated. Use n_prev instead. - paralell_processing: Deprecated. Use parallel_processing instead. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
DataFrame |
DataFrame
|
Dataframe with the bootstrapped statistics. |
DataFrame |
DataFrame
|
Dataframe with mean statistics. |
Source code in arcos4py/validation/_bootstrapping.py
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 |
|
calculate_pvalue(stats_df_mean, stats_metric, pval_alternative, finite_correction, plot, **plot_kwargs)
¶
Calculates the p-value with the given alternative hypothesis.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stats_df_mean |
DataFrame
|
DataFrame containing the bootstrapped data. |
required |
stats_metric |
str | list[str]
|
Metric to calculate. Can be "duration", "total_size", "min_size", "max_size" or a list of metrics. Default is ["duration", "total_size"]. |
required |
pval_alternative |
str
|
Alternative hypothesis for the p-value calculation. Can be "less", "greater" or both which will return p values for both alternatives. |
required |
finite_correction |
bool
|
Correct p-values for finite sampling. Default is True. |
required |
plot |
bool
|
Plot the distribution of the bootstrapped data. |
required |
Returns:
Name | Type | Description |
---|---|---|
DataFrame |
DataFrame
|
containing the p-values. |
Source code in arcos4py/validation/_bootstrapping.py
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
|
resample_data(data, position_columns=['x'], frame_column='frame', obj_id_column='obj_id', measurement_column=None, method='shuffle_tracks', n=100, seed=42, allow_duplicates=False, max_tries=100, show_progress=True, verbose=False, parallel_processing=True, **kwargs)
¶
Resamples data in order to perform bootstrapping analysis.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Dataframe
|
The data to resample. |
required |
position_columns |
list
|
The columns to use for the position. |
['x']
|
frame_column |
str
|
The column to use for the frame. |
'frame'
|
obj_id_column |
str
|
The column to use for the object ID. |
'obj_id'
|
measurement_column |
str
|
The column to use for the measurement. Only needed for 'activity_blocks_shuffle'. Defaults to None. |
None
|
method |
str
|
The method to use for resampling. Defaults to 'shuffle_tracks'. Available methods are: "shuffle_tracks", 'shuffle_timepoints', 'shift_timepoints', 'shuffle_binary_blocks', 'shuffle_coordinates_timepoint' |
'shuffle_tracks'
|
n |
int
|
The number of resample iterations. Defaults to 100. |
100
|
seed |
int
|
The random seed. Defaults to 42. |
42
|
allow_duplicates |
bool
|
Whether to allow resampling to randomly generate the same data twice. Defaults to False. |
False
|
max_tries |
int
|
The maximum number of tries to try ot generate unique data when allow_duplicates is set to True. Defaults to 100. |
100
|
verbose |
bool
|
Whether to print progress. Defaults to False. |
False
|
parallel_processing |
bool
|
Whether to use parallel processing. Defaults to True. |
True
|
**kwargs |
Any
|
Additional keyword arguments. Includes deprecated parameters. - posCols (list): Deprecated. Use position_columns instead. - id_column (str): Deprecated. Use obj_id_column instead. - meas_column (str): Deprecated. Use measurement_column instead. - paralell_processing (bool): Deprecated. Use parallel_processing instead. |
{}
|
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: The resampled data. |
Source code in arcos4py/validation/_resampling.py
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
|