lineagetree
¶
Modules:
| Name | Description |
|---|---|
lineage_tree |
|
lineage_tree_manager |
|
measure |
|
plot |
|
tree_approximation |
|
Classes:
| Name | Description |
|---|---|
LineageTree |
A lineage tree data structure with comprehensive analysis capabilities. |
LineageTreeManager |
|
Functions:
| Name | Description |
|---|---|
read_from_ASTEC |
Read an |
read_from_binary |
Reads a binary LineageTree file name. |
read_from_bmf |
Read a lineage tree from a bmf file. |
read_from_csv |
Read a lineage tree from a csv file with the following format: |
read_from_mamut_xml |
Read a lineage tree from a MaMuT xml. |
read_from_mastodon |
Read a maston lineage tree. |
read_from_mastodon_csv |
Read a lineage tree from a mastodon csv. |
read_from_tgmm_xml |
Reads a lineage tree from TGMM xml output. |
read_from_txt_for_celegans |
Read a C. elegans lineage tree |
read_from_txt_for_celegans_BAO |
Read a C. elegans Bao file from http://digital-development.org |
read_from_txt_for_celegans_CAO |
Read a C. elegans lineage tree from Cao et al. |
LineageTree
¶
LineageTree(
*,
successor: dict[int, Sequence] | None = None,
predecessor: dict[int, int | Sequence] | None = None,
time: dict[int, int] | None = None,
starting_time: int | None = None,
pos: dict[int, Iterable] | None = None,
name: str | None = None,
root_leaf_value: Sequence | None = None,
spatial_resolution: Sequence | None = None,
**kwargs
)
Bases: PropertiesMixin, ModifierMixin, NavigationMixin, PlotMixin, SpatialMixin, AnalysisMixin, IOMixin
A lineage tree data structure with comprehensive analysis capabilities.
Create a LineageTree object from minimal information, without reading from a file.
Either successor or predecessor should be specified.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict mapping int to Iterable
|
Dictionary assigning nodes to their successors. |
None
|
|
dict mapping int to int or Iterable
|
Dictionary assigning nodes to their predecessors. |
None
|
|
dict mapping int to int
|
Dictionary assigning nodes to the time point they were recorded to.
Defaults to None, in which case all times are set to |
None
|
|
int
|
Starting time of the lineage tree. Defaults to 0. |
None
|
|
dict mapping int to Iterable
|
Dictionary assigning nodes to their positions. Defaults to None. |
None
|
|
str
|
Name of the lineage tree. Defaults to None. |
None
|
|
Iterable
|
Iterable of values of roots' predecessors and leaves' successors in the successor and predecessor dictionaries.
Defaults are |
None
|
|
Supported keyword arguments are dictionaries assigning nodes to any custom property. The property must be specified for every node, and named differently from LineageTree's own attributes. |
{}
|
Methods:
| Name | Description |
|---|---|
get_subtree |
Create a new lineage tree that has the same edges and properties |
load |
Loading a lineage tree from a '.lT' file. |
Source code in src/lineagetree/lineage_tree.py
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 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 | |
get_subtree
¶
Create a new lineage tree that has the same edges and properties
as the given lineage tree. Only the nodes in node_list are considered.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Iterator of int
|
Iterator over the nodes to keep |
required |
Returns:
| Type | Description |
|---|---|
LineageTree
|
The subtree lineage tree |
Source code in src/lineagetree/lineage_tree.py
load
classmethod
¶
Loading a lineage tree from a '.lT' file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
path to and name of the file to read |
required |
Returns:
| Type | Description |
|---|---|
LineageTree
|
loaded file |
Source code in src/lineagetree/lineage_tree.py
LineageTreeManager
¶
Creates a LineageTreeManager :TODO: write the docstring
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Iterable[LineageTree]
|
List of lineage trees to be in the LineageTreeManager |
()
|
Methods:
| Name | Description |
|---|---|
__len__ |
Returns how many lineagetrees are in the manager. |
add |
Function that adds a new lineagetree object to the class. |
cross_lineage_edit_distance |
Compute the unordered tree edit backtrace from Zhang 1996 between the trees spawned |
labelled_mappings |
Returns the labels or IDs of all the nodes in the subtrees compared. |
load |
Loading a lineage tree Manager from a ".ltm" file. |
plot_tree_distance_graphs |
Plots the subtrees compared and colors them according to the quality of the matching of their subtree. |
remove_embryo |
Removes the embryo from the manager. |
write |
Saves the manager |
Attributes:
| Name | Type | Description |
|---|---|---|
gcd |
int
|
Calculates the greatesτ common divisor between all lineagetree resolutions in the manager. |
Source code in src/lineagetree/lineage_tree_manager.py
gcd
property
¶
Calculates the greatesτ common divisor between all lineagetree resolutions in the manager.
Returns:
| Type | Description |
|---|---|
int
|
The overall greatest common divisor. |
__calculate_distance_of_sub_tree
¶
__calculate_distance_of_sub_tree(
node1: int,
lT1: LineageTree,
node2: int,
lT2: LineageTree,
alignment: Alignment,
corres1: dict,
corres2: dict,
delta_tmp: Callable,
norm: Callable,
norm1: int | float,
norm2: int | float,
) -> float
Calculates the distance of the subtree of a node matched in a comparison. DOES NOT CALCULATE THE DISTANCE FROM SCRATCH BUT USING THE ALIGNMENT.
TODO ITS BOUND TO CHANGE
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
The root of the first subtree |
required |
|
LineageTree
|
The dataset the first lineage exists |
required |
|
int
|
The root of the first subtree |
required |
|
LineageTree
|
The dataset the second lineage exists |
required |
|
Alignment
|
The alignment of the subtree |
required |
|
dict
|
The correspndance dictionary of the first lineage |
required |
|
dict
|
The correspondance dictionary of the second lineage |
required |
|
Callable
|
The delta function for the comparisons |
required |
|
Callable
|
How should the lineages be normalized |
required |
|
int or float
|
The result of the normalization of the first tree |
required |
|
int or float
|
The result of the normalization of the second tree |
required |
Returns:
| Type | Description |
|---|---|
float
|
The result of the comparison of the subtree |
Source code in src/lineagetree/lineage_tree_manager.py
__cross_lineage_edit_backtrace
¶
__cross_lineage_edit_backtrace(
n1: int,
embryo_1: str,
n2: int,
embryo_2: str,
end_time1: int | None = None,
end_time2: int | None = None,
style: (
Literal[
"simple",
"normalized_simple",
"full",
"downsampled",
]
| type[TreeApproximationTemplate]
) = "simple",
norm: Literal["max", "sum", None] = "max",
downsample: int = 2,
) -> dict[
str,
Alignment
| tuple[
TreeApproximationTemplate, TreeApproximationTemplate
],
]
Compute the unordered tree edit distance from Zhang 1996 between the trees spawned
by two nodes n1 from lineagetree1 and n2 lineagetree2. The topology of the trees
are compared and the matching cost is given by the function delta (see edist doc for
more information).The distance is normed by the function norm that takes the two list
of nodes spawned by the trees n1 and n2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
Node of the first Lineagetree |
required |
|
str
|
The key/name of the first Lineagetree |
required |
|
int
|
The key/name of the first Lineagetree |
required |
|
str
|
Node of the second Lineagetree |
required |
|
int
|
The final time point the comparison algorithm will take into account for the first dataset. If None or not provided all nodes will be taken into account. |
None
|
|
int
|
The final time point the comparison algorithm will take into account for the second dataset. If None or not provided all nodes will be taken into account. |
None
|
|
('simple', 'normalized_simple', 'full', 'downsampled')
|
The approximation used to calculate the tree. |
"simple"
|
|
('max', 'sum', 'None')
|
The normalization method used (Not important for this function) |
"max","sum"
|
|
int
|
The downsample factor for the downsampled tree approximation.
Used only when |
=2
|
Returns:
| Type | Description |
|---|---|
dict mapping str to Alignment or tuple of [TreeApproximationTemplate, TreeApproximationTemplate]
|
|
Source code in src/lineagetree/lineage_tree_manager.py
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 | |
__len__
¶
Returns how many lineagetrees are in the manager.
Returns:
| Type | Description |
|---|---|
int
|
The number of trees inside the manager |
add
¶
Function that adds a new lineagetree object to the class. Can be added either by .add or by using the + operator. If a name is specified it will also add it as this specific name, otherwise it will use the already existing name of the lineagetree.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LineageTree
|
Thelineagetree to be added. |
required |
|
str
|
Then name of the lineagetree to be added, defaults to ''. (Usually lineageTrees have the name of the path they are read from, so this is going to be the name most of the times.) |
""
|
Source code in src/lineagetree/lineage_tree_manager.py
cross_lineage_edit_distance
¶
cross_lineage_edit_distance(
n1: int,
embryo_1: str,
n2: int,
embryo_2: str,
end_time1: int | None = None,
end_time2: int | None = None,
norm: Literal["max", "sum", None] = "max",
style: (
Literal[
"simple",
"normalized_simple",
"full",
"downsampled",
]
| type[TreeApproximationTemplate]
) = "simple",
downsample: int = 2,
return_norms: bool = False,
) -> float | tuple[float, tuple[float, float]]
Compute the unordered tree edit backtrace from Zhang 1996 between the trees spawned
by two nodes n1 and n2. The topology of the trees are compared and the matching
cost is given by the function delta (see edist doc for more information). There are
5 styles available (tree approximations) and the user may add their own.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
id of the first node to compare |
required |
|
str
|
the name of the first embryo to be used. (from lTm.lineagetrees.keys()) |
required |
|
int
|
id of the second node to compare |
required |
|
str
|
the name of the second embryo to be used. (from lTm.lineagetrees.keys()) |
required |
|
int
|
the final time point the comparison algorithm will take into account for the first dataset. If None or not provided all nodes will be taken into account. |
required |
|
int
|
the final time point the comparison algorithm will take into account for the second dataset. If None or not provided all nodes will be taken into account. |
required |
|
('max', 'sum')
|
The normalization method to use, defaults to 'max'. |
"max"
|
|
('simple', 'normalized_simple', 'full', 'downsampled')
|
Which tree approximation is going to be used for the comparisons, defaults to 'simple'. |
"simple"
|
|
int
|
The downsample factor for the downsampled tree approximation.
Used only when |
2
|
|
bool
|
Decide if the norms will be returned explicitly (mainly used for the napari plugin) |
False
|
Returns:
| Type | Description |
|---|---|
Alignment
|
The alignment between the nodes by the subtrees spawned by the nodes n1,n2 and the normalization function.` |
(tuple(tree, tree), optional)
|
The two trees that have been mapped to each other.
Returned if |
Source code in src/lineagetree/lineage_tree_manager.py
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 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 | |
labelled_mappings
¶
labelled_mappings(
n1: int,
embryo_1: str,
n2: int,
embryo_2: str,
end_time1: int | None = None,
end_time2: int | None = None,
norm: Literal["max", "sum", None] = "max",
style: (
Literal[
"simple",
"normalized_simple",
"full",
"downsampled",
]
| type[TreeApproximationTemplate]
) = "simple",
downsample: int = 2,
) -> dict[str, list[str]]
Returns the labels or IDs of all the nodes in the subtrees compared.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
id of the first node to compare |
required |
|
str
|
the name of the first lineage |
required |
|
int
|
id of the second node to compare |
required |
|
str
|
the name of the second lineage |
required |
|
int
|
the final time point the comparison algorithm will take into account for the first dataset. If None or not provided all nodes will be taken into account. |
None
|
|
int
|
the final time point the comparison algorithm will take into account for the first dataset. If None or not provided all nodes will be taken into account. |
None
|
|
('max', 'sum')
|
The normalization method to use. |
"max"
|
|
('simple', 'normalized_simple', 'full', 'downsampled')
|
Which tree approximation is going to be used for the comparisons. |
"simple"
|
|
int
|
The downsample factor for the downsampled tree approximation.
Used only when |
2
|
Returns:
| Type | Description |
|---|---|
dict mapping str to lists of str
|
|
Source code in src/lineagetree/lineage_tree_manager.py
738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 | |
load
classmethod
¶
Loading a lineage tree Manager from a ".ltm" file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
path to and name of the file to read |
required |
Returns:
| Type | Description |
|---|---|
LineageTreeManager
|
loaded file |
Source code in src/lineagetree/lineage_tree_manager.py
plot_tree_distance_graphs
¶
plot_tree_distance_graphs(
n1: int,
embryo_1: str,
n2: int,
embryo_2: str,
end_time1: int | None = None,
end_time2: int | None = None,
norm: Literal["max", "sum"] | None = "max",
style: (
Literal[
"simple",
"normalized_simple",
"full",
"downsampled",
]
| type[TreeApproximationTemplate]
) = "simple",
downsample: int = 2,
colormap: str = "cool",
default_color: str = "black",
size: float = 10,
lw: float = 0.3,
ax: ndarray | None = None,
vmin=None,
vmax=None,
) -> tuple[plt.figure, plt.Axes]
Plots the subtrees compared and colors them according to the quality of the matching of their subtree.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
id of the first node to compare |
required |
|
str
|
the name of the first embryo |
required |
|
int
|
id of the second node to compare |
required |
|
str
|
the name of the second embryo |
required |
|
int
|
the final time point the comparison algorithm will take into account for the first dataset. If None or not provided all nodes will be taken into account. |
None
|
|
int
|
the final time point the comparison algorithm will take into account for the second dataset. If None or not provided all nodes will be taken into account. |
None
|
|
('max', 'sum')
|
The normalization method to use. |
"max"
|
|
('simple', 'normalized_simple', 'full', 'downsampled')
|
Which tree approximation is going to be used for the comparisons. |
"simple"
|
|
int
|
The downsample factor for the downsampled tree approximation.
Used only when |
2
|
|
str
|
The colormap used for matched nodes, defaults to "cool" |
"cool"
|
|
str
|
The color of the unmatched nodes, defaults to "black" |
'black'
|
|
float
|
The size of the nodes, defaults to 10 |
10
|
|
float
|
The width of the edges, defaults to 0.3 |
0.3
|
|
ndarray
|
The axes used, if not provided another set of axes is produced, defaults to None |
None
|
|
Values within the range |
None
|
|
|
Values within the range |
None
|
Returns:
| Type | Description |
|---|---|
Figure
|
The matplotlib figure |
Axes
|
The matplotlib axes |
Source code in src/lineagetree/lineage_tree_manager.py
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 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 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 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 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 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 | |
remove_embryo
¶
Removes the embryo from the manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The name of the lineagetree to be removed |
required |
Raises:
| Type | Description |
|---|---|
IndexError
|
If there is no such lineagetree |
Source code in src/lineagetree/lineage_tree_manager.py
write
¶
Saves the manager
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The path and name of the file that is to be saved. |
required |
Source code in src/lineagetree/lineage_tree_manager.py
read_from_ASTEC
¶
Read an xml or pkl file produced by the ASTEC algorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
path to an output generated by ASTEC |
required |
|
bool
|
whether or not to read the eigen values, default False |
False
|
|
None or str
|
The name attribute of the LineageTree file. If given a non-empty string, the value of the attribute will be the name attribute, otherwise the name will be the stem of the file path. |
None
|
Returns:
| Type | Description |
|---|---|
LineageTree
|
lineage tree |
Source code in src/lineagetree/_io/_loaders.py
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 | |
read_from_binary
¶
Reads a binary LineageTree file name. Format description: see LineageTree.to_binary
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
string
|
path to the binary file |
required |
|
None or str
|
The name attribute of the LineageTree file. If given a non-empty string, the value of the attribute will be the name attribute, otherwise the name will be the stem of the file path. |
None
|
Returns:
| Type | Description |
|---|---|
LineageTree
|
lineage tree |
Source code in src/lineagetree/_io/_loaders.py
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 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 | |
read_from_bmf
¶
read_from_bmf(
file_path: str,
store_meshes: bool = True,
pos_multipliers: tuple[float, float, float] = (
1.0,
1.0,
1.0,
),
translation: tuple[float, float, float] = (
0.0,
0.0,
0.0,
),
name: None | str = None,
) -> LineageTree
Read a lineage tree from a bmf file.
Returns:
| Type | Description |
|---|---|
LineageTree
|
lineage tree |
Source code in src/lineagetree/_io/_loaders.py
read_from_csv
¶
read_from_csv(
file_path: str,
z_mult: float = 1,
link: int = 1,
delim: str = ",",
name: None | str = None,
) -> LineageTree
Read a lineage tree from a csv file with the following format: id, time, z, y, x, id, pred_id, lin_id
Returns:
| Type | Description |
|---|---|
LineageTree
|
lineage tree |
Source code in src/lineagetree/_io/_loaders.py
read_from_mamut_xml
¶
read_from_mamut_xml(
path: str,
xml_attributes: list[str] | None = None,
name: None | str = None,
) -> LineageTree
Read a lineage tree from a MaMuT xml.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
path to the MaMut xml |
required |
|
None or str
|
The name attribute of the LineageTree file. If given a non-empty string, the value of the attribute will be the name attribute, otherwise the name will be the stem of the file path. |
None
|
Returns:
| Type | Description |
|---|---|
LineageTree
|
lineage tree |
Source code in src/lineagetree/_io/_loaders.py
966 967 968 969 970 971 972 973 974 975 976 977 978 979 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 | |
read_from_mastodon
¶
read_from_mastodon(
path: str,
tag_set: str | None = None,
name: str | None = None,
) -> LineageTree
Read a maston lineage tree.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
path to the mastodon file |
required |
|
str
|
If specified, |
None
|
|
str
|
The name attribute of the LineageTree file. If given a non-empty string, the value of the attribute will be the name attribute, otherwise the name will be the stem of the file path. |
None
|
Returns:
| Type | Description |
|---|---|
LineageTree
|
lineage tree |
Source code in src/lineagetree/_io/_loaders.py
read_from_mastodon_csv
¶
Read a lineage tree from a mastodon csv.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list of strings
|
list of paths to the csv files |
required |
|
None or str
|
The name attribute of the LineageTree file. If given a non-empty string, the value of the attribute will be the name attribute, otherwise the name will be the stem of the file path. |
None
|
Returns:
| Type | Description |
|---|---|
LineageTree
|
lineage tree |
Source code in src/lineagetree/_io/_loaders.py
read_from_tgmm_xml
¶
read_from_tgmm_xml(
file_format: str,
tb: int,
te: int,
z_mult: float = 1.0,
name: None | str = None,
) -> LineageTree
Reads a lineage tree from TGMM xml output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
path to the xmls location. it should be written as follow: path/to/xml/standard_name_t{t:06d}.xml where (as an example) {t:06d} means a series of 6 digits representing the time and if the time values is smaller that 6 digits, the missing digits are filed with 0s |
required |
|
int
|
first time point to read |
required |
|
int
|
last time point to read |
required |
|
float
|
aspect ratio |
1.0
|
|
str
|
The name attribute of the LineageTree file. If given a non-empty string, the value of the attribute will be the name attribute, otherwise the name will be the stem of the file path. |
None
|
Returns:
| Type | Description |
|---|---|
LineageTree
|
lineage tree |
Source code in src/lineagetree/_io/_loaders.py
744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 | |
read_from_txt_for_celegans
¶
Read a C. elegans lineage tree
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
Path to the file to read |
required |
|
None or str
|
The name attribute of the LineageTree file. If given a non-empty string, the value of the attribute will be the name attribute, otherwise the name will be the stem of the file path. |
None
|
Returns:
| Type | Description |
|---|---|
LineageTree
|
lineage tree |
Source code in src/lineagetree/_io/_loaders.py
read_from_txt_for_celegans_BAO
¶
Read a C. elegans Bao file from http://digital-development.org
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
Path to the file to read |
required |
|
str
|
The name attribute of the LineageTree file. If given a non-empty string, the value of the attribute will be the name attribute, otherwise the name will be the stem of the file path. |
None
|
Returns:
| Type | Description |
|---|---|
LineageTree
|
lineage tree |
Source code in src/lineagetree/_io/_loaders.py
read_from_txt_for_celegans_CAO
¶
read_from_txt_for_celegans_CAO(
file: str,
reorder: bool = False,
raw_size: ndarray | None = None,
shape: float | None = None,
name: str | None = None,
) -> LineageTree
Read a C. elegans lineage tree from Cao et al.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
Path to the file to read |
required |
|
None or str
|
The name attribute of the LineageTree file. If given a non-empty string, the value of the attribute will be the name attribute, otherwise the name will be the stem of the file path. |
None
|
Returns:
| Type | Description |
|---|---|
LineageTree
|
lineage tree |
Source code in src/lineagetree/_io/_loaders.py
598 599 600 601 602 603 604 605 606 607 608 609 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 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 | |