simace.plotting¶
plot_style¶
simace.plotting.plot_style
¶
Central visual style for Nature Genetics-inspired plots.
apply_nature_style
¶
Set matplotlib rcParams for Nature Genetics-inspired figures.
Source code in simace/plotting/plot_style.py
enable_value_gridlines
¶
Add faint horizontal gridlines for plots where absolute values matter.
add_scenario_label
¶
Add small grey italic scenario label at the bottom-right of a figure.
Source code in simace/plotting/plot_style.py
plot_utils¶
simace.plotting.plot_utils
¶
Shared plotting utilities for simace.
param_as_float
¶
Convert a scalar or per-generation dict param to a single float.
For per-gen dicts, returns the value at the lowest key (founder generation).
Source code in simace/plotting/plot_utils.py
save_placeholder_plot
¶
Save a single-panel figure with centered message text.
Source code in simace/plotting/plot_utils.py
annotate_heatmap
¶
Add two-line annotations to a heatmap: large bold proportion, smaller count.
| PARAMETER | DESCRIPTION |
|---|---|
ax
|
Matplotlib axes containing the heatmap.
TYPE:
|
proportions
|
2-D array-like of proportion values.
TYPE:
|
counts
|
2-D array-like of count values (int or float).
TYPE:
|
fmt_prop
|
Format spec for proportion values.
TYPE:
|
prop_size
|
Font size for the proportion line.
TYPE:
|
count_size
|
Font size for the count line.
TYPE:
|
Source code in simace/plotting/plot_utils.py
finalize_plot
¶
tight_layout + savefig(bbox_inches='tight') + close current figure.
Source code in simace/plotting/plot_utils.py
draw_split_violin
¶
Draw a split violin at pos (left half / right half).
Replicates seaborn's violinplot(split=True, cut=0) using raw
matplotlib, which is significantly faster for large arrays.
Source code in simace/plotting/plot_utils.py
draw_colored_violins
¶
Draw violins at positions with per-category colors.
Replicates seaborn's violinplot(inner=None, cut=0) for
categorically-coloured violin groups. Only groups with >= 2 values
are drawn.
Source code in simace/plotting/plot_utils.py
setup_pair_type_panel
¶
setup_pair_type_panel(ax, pair_types, n_pairs_per_ptype, n_reps, observed_per_rep, liability_r=None, parametric_r=None, frailty_r=None, show_violins_threshold=4, pair_colors=None, rng_seed=42)
Render one per-pair-type comparison panel except the per-rep observed dots.
For each pair type at x = i:
* faint coloured violin (only when n_reps >= show_violins_threshold)
* mean-of-observed wide cross
* open diamond at mean liability r (if provided)
* filled red star at parametric E[r] (if provided)
* green filled plus at frailty r (if provided)
The per-rep observed dots are deferred so :func:finalize_pair_type_panels
can decide a shared y-axis range across panels and clip outliers to the
axis edges. Bold pair-type labels and parenthesised pair counts are drawn
here; titles and y-labels remain caller-specific.
Returns {"ax", "ref_values", "obs_records"}.
Source code in simace/plotting/plot_utils.py
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 | |
finalize_pair_type_panels
¶
Apply a shared y-limit across all panels and draw observed dots.
The y-limit is anchored on reference markers (mean observed, liability,
parametric, frailty) plus observed values inside sane_band. Observed
values outside the band are rendered as small carets at the axis edge so
one or two low-n outliers don't blow out the panel.
Source code in simace/plotting/plot_utils.py
pair_type_legend_handles
¶
pair_type_legend_handles(has_observed_mean=True, has_liability=True, has_frailty=False, has_parametric=False)
Return Line2D proxies for fig.legend.
Markers match those used by :func:setup_pair_type_panel. Only the
requested series are included.
Source code in simace/plotting/plot_utils.py
plot_correlations¶
simace.plotting.plot_correlations
¶
Correlation-related phenotype plots.
Contains: plot_tetrachoric_sibling, plot_tetrachoric_by_generation,
plot_cross_trait_tetrachoric, plot_parent_offspring_liability,
plot_tetrachoric_by_sex. Heritability pages live in plot_heritability.
plot_tetrachoric_sibling
¶
Plot tetrachoric correlations by relationship type using marker-based references.
For each pair type, draws shapes stacked at the same x position: gray dots per rep (observed r), a black wide cross (mean of observed), an open black diamond (mean liability r), a red star (parametric E[r]), and a green plus (frailty r on uncensored frailties, when available). Faint violins appear only when reps >= 4 so the spread is visible without dominating the panel.
Source code in simace/plotting/plot_correlations.py
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 | |
plot_tetrachoric_by_generation
¶
Plot tetrachoric correlations by relationship type, broken out by generation.
2 rows (traits) x N cols (last 3 non-founder generations). Each cell shares
the same marker conventions as :func:plot_tetrachoric_sibling. Y-axis is
shared across cells of the same trait row so generation-to-generation drift
is directly comparable.
Source code in simace/plotting/plot_correlations.py
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 | |
plot_cross_trait_tetrachoric
¶
Two-panel figure for cross-trait tetrachoric correlations.
Same-person cross-trait r by generation (dots per rep + mean line),
with frailty cross-trait reference lines if available.
Right: Cross-person cross-trait r by pair type (violin/dots), showing how relatedness induces cross-trait association.
Source code in simace/plotting/plot_correlations.py
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 | |
plot_parent_offspring_liability
¶
plot_parent_offspring_liability(df_samples, all_stats, output_path, scenario='', subsample_note='', params=None)
2 x 3 scatter grid: midparent vs offspring liability by generation.
Source code in simace/plotting/plot_correlations.py
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 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 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 | |
plot_tetrachoric_by_sex
¶
Tetrachoric correlations for same-sex pairs: 2 rows (traits) x 2 cols (F/M).
Same marker conventions as :func:plot_tetrachoric_sibling. Each trait row
shares its y-axis across the female and male panels so cross-sex magnitude
differences are directly comparable; the two trait rows are independent.
Source code in simace/plotting/plot_correlations.py
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 737 738 739 740 741 742 743 744 | |
plot_distributions¶
simace.plotting.plot_distributions
¶
Distribution-related phenotype plots.
Contains: plot_death_age_distribution, plot_trait_phenotype, plot_trait_regression, plot_cumulative_incidence, plot_cumulative_incidence_by_sex, plot_cumulative_incidence_by_sex_generation, plot_censoring_windows.
plot_death_age_distribution
¶
Plot mortality rate and cumulative mortality by decade, averaged across reps.
Source code in simace/plotting/plot_distributions.py
plot_trait_phenotype
¶
Plot phenotype distributions for both traits in a 2x2 grid.
Source code in simace/plotting/plot_distributions.py
plot_trait_regression
¶
Plot liability vs age at onset for both traits as jointplots side by side.
Source code in simace/plotting/plot_distributions.py
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 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 | |
plot_cumulative_incidence
¶
Plot cumulative incidence by age, mean +/- band across reps.
Source code in simace/plotting/plot_distributions.py
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 | |
plot_cumulative_incidence_by_sex
¶
Plot cumulative incidence curves split by sex, from pre-computed stats.
Source code in simace/plotting/plot_distributions.py
plot_cumulative_incidence_by_sex_generation
¶
Plot cumulative incidence by sex and generation, from pre-computed stats.
Source code in simace/plotting/plot_distributions.py
plot_censoring_windows
¶
Plot per-generation censoring windows, mean +/- band across reps.
Source code in simace/plotting/plot_distributions.py
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 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 | |
plot_family_structure
¶
Plot offspring and mate count distributions, averaged across replicates.
Source code in simace/plotting/plot_distributions.py
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 | |
plot_liability¶
simace.plotting.plot_liability
¶
Liability-related phenotype plots.
Contains: plot_liability_joint, plot_liability_joint_affected, plot_liability_violin, plot_liability_violin_by_generation, plot_joint_affection, plot_censoring_confusion, plot_censoring_cascade, plot_mate_correlation.
plot_liability_joint
¶
2x2 grid of jointplots: Liability, A, C, E (trait 1 vs trait 2).
Source code in simace/plotting/plot_liability.py
plot_liability_joint_affected
¶
2x2 grid of jointplots colored by affected status (trait 1).
Source code in simace/plotting/plot_liability.py
plot_liability_joint_affected_t2
¶
2x2 grid of jointplots colored by affected status (trait 2).
Source code in simace/plotting/plot_liability.py
plot_liability_violin
¶
Split violin plot of liability by trait, split on affected status.
Source code in simace/plotting/plot_liability.py
plot_liability_violin_by_generation
¶
plot_liability_violin_by_generation(df_samples, all_stats, output_path, scenario='', subsample_note='')
Split violin of liability by affected status, one column per generation.
Source code in simace/plotting/plot_liability.py
plot_liability_violin_by_sex_generation
¶
plot_liability_violin_by_sex_generation(df_samples, all_stats, output_path, scenario='', subsample_note='')
Split violin by affected status with side-by-side F|M panels per generation.
Layout: 2 rows (traits) x N cols (generations). Each cell has two side-by-side sub-violins at x=-0.3 (female) and x=+0.3 (male).
Source code in simace/plotting/plot_liability.py
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 | |
plot_liability_components_by_generation
¶
Mean variance component by affected status across generations.
2x3 grid: rows = traits, columns = A, C, E. Each panel shows mean component value for affected (red), unaffected (grey), and overall (black) individuals per generation. Prevalence annotated on x-tick labels.
Source code in simace/plotting/plot_liability.py
plot_censoring_confusion
¶
Per-trait 2x2 confusion matrix: true affected vs. observed affected.
Uses pre-computed censoring_confusion stats from full (non-subsampled) data.
Source code in simace/plotting/plot_liability.py
plot_censoring_cascade
¶
Per-trait stacked bar chart decomposing true cases by censoring fate per generation.
Uses pre-computed censoring_cascade stats from full (non-subsampled) data.
Source code in simace/plotting/plot_liability.py
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 | |
plot_joint_affection
¶
2x2 heatmap of joint affection status (trait1 x trait2).
Uses pre-computed joint_affection and cross_trait_tetrachoric stats.
Source code in simace/plotting/plot_liability.py
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 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 | |
plot_mate_correlation
¶
Plot 2x2 heatmap of empirical mate liability correlations with expected values.
Source code in simace/plotting/plot_liability.py
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 | |
plot_pedigree_counts¶
simace.plotting.plot_pedigree_counts
¶
Pedigree relationship pair counts diagram.
Draws a schematic multi-generational pedigree centred on a highlighted "Proband" individual. Each of the 10 relationship types is represented by colouring the border of the related individual's node and placing a labelled annotation box nearby. Mean pair counts (averaged across replicates) are shown inside each annotation box.
Family structure (4 generations):
Gen 0 Great-grandparents (GGF + GGM) Gen 1 Grandfather + Grandmother | Great-uncle (sib of Grandfather) Gen 2 Father + Mother | Uncle (sib of Father) | GU-child Gen 3 Proband MZ-twin Full-sib Pat-HS Mat-HS Cousin 2nd-Cousin
plot_pedigree_relationship_counts
¶
plot_pedigree_relationship_counts(all_stats, output_path, scenario='', stats_key='pair_counts', generations_label='', max_degree=2)
Draw a proband-centric pedigree diagram with relationship pair counts.
| PARAMETER | DESCRIPTION |
|---|---|
all_stats
|
Per-replicate stats dicts.
TYPE:
|
output_path
|
Where to save the figure.
TYPE:
|
scenario
|
Scenario name for the title.
TYPE:
|
stats_key
|
Key in stats dict to read pair counts from.
TYPE:
|
generations_label
|
Label appended to title (e.g. "G_ped = 6").
TYPE:
|
max_degree
|
Maximum kinship degree shown in the diagram.
TYPE:
|
Source code in simace/plotting/plot_pedigree_counts.py
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 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 | |
cli
¶
Command-line interface for pedigree relationship counts plot.
Source code in simace/plotting/plot_pedigree_counts.py
plot_phenotype¶
simace.plotting.plot_phenotype
¶
Plot phenotype distributions from pre-computed per-rep statistics.
Reads phenotype_stats.yaml and phenotype_samples.parquet files (one per rep) produced by compute_phenotype_stats.py. No full phenotype parquet loading needed.
main
¶
main(stats_paths, sample_paths, output_dir, censor_age, gen_censoring=None, plot_ext='png', validation_paths=None, max_degree=2)
Generate all phenotype plots from pre-computed stats.
Source code in simace/plotting/plot_phenotype.py
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 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 | |
cli
¶
Command-line interface for generating phenotype plots.
Source code in simace/plotting/plot_phenotype.py
plot_validation¶
simace.plotting.plot_validation
¶
Plot validation results summarized across replicates per scenario.
stripplot
¶
Stripplot of observed values with optional expected markers.
| PARAMETER | DESCRIPTION |
|---|---|
df
|
Gathered metrics DataFrame with
TYPE:
|
ax
|
Matplotlib axes to plot on.
TYPE:
|
y
|
Column name for the observed metric to plot.
TYPE:
|
expected
|
Column name for per-scenario expected values, or a fixed number.
TYPE:
|
expected_func
|
Callable(scenario_df) returning expected value.
TYPE:
|
Source code in simace/plotting/plot_validation.py
save
¶
plot_variance_components
¶
Plot observed vs expected A, C, E variance components per trait.
Source code in simace/plotting/plot_validation.py
plot_twin_rate
¶
Plot observed MZ twin rate vs expected across scenarios.
Source code in simace/plotting/plot_validation.py
plot_A_correlations
¶
Plot MZ twin and full-sib additive genetic correlations.
Source code in simace/plotting/plot_validation.py
plot_phenotype_correlations
¶
Plot MZ twin and full-sib liability correlations vs expected.
Source code in simace/plotting/plot_validation.py
plot_heritability_estimates
¶
Plot Falconer heritability estimates vs configured A values.
Source code in simace/plotting/plot_validation.py
plot_half_sib_proportions
¶
Plot observed vs expected half-sib proportions.
Source code in simace/plotting/plot_validation.py
plot_cross_trait_correlations
¶
Plot cross-trait genetic and environmental correlations vs expected.
Source code in simace/plotting/plot_validation.py
plot_family_size
¶
Plot mean family size distribution across scenarios.
Source code in simace/plotting/plot_validation.py
plot_summary_bias
¶
Plot bias heatmap for variance components and correlations.
Source code in simace/plotting/plot_validation.py
plot_runtime
¶
Plot simulation runtime per scenario.
Source code in simace/plotting/plot_validation.py
plot_memory
¶
Plot simulation peak memory usage per scenario.
Source code in simace/plotting/plot_validation.py
plot_consanguineous_matings
¶
Plot consanguineous mating counts and inbreeding coefficients.
Source code in simace/plotting/plot_validation.py
main
¶
Generate all validation plots from a gathered metrics TSV.
Source code in simace/plotting/plot_validation.py
cli
¶
Command-line interface for generating validation plots.
Source code in simace/plotting/plot_validation.py
plot_pipeline¶
simace.plotting.plot_pipeline
¶
Pipeline DAG diagram for the atlas title page.
Renders a single-page figure showing the Snakemake pipeline structure with each step's relevant parameters displayed inside its box.
render_pipeline_figure
¶
Build and return the pipeline DAG figure (without saving).
| PARAMETER | DESCRIPTION |
|---|---|
params
|
Merged scenario parameters dict.
TYPE:
|
scenario
|
Scenario name for the title.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Figure
|
The matplotlib Figure object. |
Source code in simace/plotting/plot_pipeline.py
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 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 | |
plot_pipeline
¶
Render the pipeline DAG diagram and save to file.
| PARAMETER | DESCRIPTION |
|---|---|
params
|
Merged scenario parameters dict.
TYPE:
|
output_path
|
Where to save the figure.
TYPE:
|
scenario
|
Scenario name for the title.
TYPE:
|
Source code in simace/plotting/plot_pipeline.py
cli
¶
Command-line interface for standalone pipeline diagram rendering.
Source code in simace/plotting/plot_pipeline.py
plot_atlas¶
simace.plotting.plot_atlas
¶
Assemble individual plots into a multi-page PDF atlas with figure captions.
get_model_equation
¶
Return mathtext equation lines for the scenario's phenotype model(s).
Source code in simace/plotting/plot_atlas.py
get_model_family
¶
Return (display_name, description) for the scenario's phenotype model(s).
When both traits use the same model family and sub-type, return that family. When they differ, return a combined description.
Source code in simace/plotting/plot_atlas.py
assemble_atlas
¶
assemble_atlas(items, plot_dir, output_path, *, plot_ext='png', scenario_params=None, stats_data=None)
Combine plots and section breaks into a multi-page PDF with captions.
Walks items linearly. PlotEntry items render as a plot+caption
page; the "Figure {N}: " prefix is derived from the running plot
index (1-based, counting only :class:PlotEntry items). SectionBreak
items render as a section divider page.
| PARAMETER | DESCRIPTION |
|---|---|
items
|
Ordered atlas manifest, mixing
:class:
TYPE:
|
plot_dir
|
Directory containing the plot image files; each
TYPE:
|
output_path
|
Path for the combined PDF.
TYPE:
|
plot_ext
|
Image extension (default
TYPE:
|
scenario_params
|
If provided, a dict with key
TYPE:
|
stats_data
|
If provided, a list of phenotype_stats dicts (one per rep). A Table 1 page is rendered after the title page.
TYPE:
|
Source code in simace/plotting/plot_atlas.py
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 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 | |
plot_table1¶
simace.plotting.plot_table1
¶
Render an epidemiological Table 1 summarising the simulated study population.
render_table1_figure
¶
Build and return the Table 1 figure (11 x 8.5 landscape).
| PARAMETER | DESCRIPTION |
|---|---|
all_stats
|
List of phenotype_stats dicts, one per replicate.
TYPE:
|
scenario_params
|
Merged scenario config parameters.
TYPE:
|
scenario
|
Scenario name for the title.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Figure
|
matplotlib Figure ready for |
Source code in simace/plotting/plot_table1.py
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 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 737 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 | |