Plot the most severe phenotypes per severity class: Profound, Severe, Moderate, Mild. The exception to this is the "Mild" class, where the least severe phenotypes will be taken instead of the most severe phenotypes.
plot_top_phenos(
res_class = gpt_annot_class(),
keep_ont_levels = seq(3, 17),
keep_descendants = "Phenotypic abnormality",
n_per_class = 10,
annotation_order = NULL,
split_by_congenital = TRUE,
axis.text.x = c(FALSE, TRUE),
legend.position = "right",
...
)
Output of the gpt_annot_class function.
Only keep phenotypes at certain absolute ontology levels to keep. See add_ont_lvl for details.
Terms whose descendants should be kept
(including themselves).
Set to NULL
(default) to skip this filtering step.
Number of phenotypes per severity class to include.
The order of the annotations to include.
Split the phenotypes by congenital onset (congenital = always/often, noncongenital = never/rarely).
Whether to include x-axis text in top and bottom subplots.
the default position of legends ("none", "left", "right", "bottom", "top", "inside")
Arguments passed on to patchwork::plot_layout
ncol,nrow
The dimensions of the grid to create - if both are NULL
it
will use the same logic as facet_wrap() to set the
dimensions
byrow
Analogous to byrow
in matrix(). If FALSE
the
plots will be filled in in column-major order
widths,heights
The relative widths and heights of each column and row
in the grid. Will get repeated to match the dimensions of the grid. The
special value of NA
/-1null
will behave as 1null
unless a fixed aspect
plot is inserted in which case it will allow the dimension to expand or
contract to match the aspect ratio of the content
guides
A string specifying how guides should be treated in the layout.
'collect'
will collect guides below to the given nesting level, removing
duplicates. 'keep'
will stop collection at this level and let guides be
placed alongside their plot. auto
will allow guides to be collected if a
upper level tries, but place them alongside the plot if not. If you modify
default guide "position" with theme(legend.position=...)
while also collecting guides you must apply that change to the overall
patchwork (see example).
tag_level
A string ('keep'
or 'new'
) to indicate how
auto-tagging should behave. See plot_annotation()
.
design
Specification of the location of areas in the layout. Can either
be specified as a text string or by concatenating calls to area()
together.
See the examples for further information on use.
axes
A string specifying how axes should be treated. 'keep'
will
retain all axes in individual plots. 'collect'
will remove duplicated
axes when placed in the same run of rows or columns of the layout.
'collect_x'
and 'collect_y'
will remove duplicated x-axes in the columns
or duplicated y-axes in the rows respectively.
axis_titles
A string specifying how axis titltes should be treated.
'keep'
will retain all axis titles in individual plots. 'collect'
will
remove duplicated titles in one direction and merge titles in the opposite
direction. 'collect_x'
and 'collect_y'
control this for x-axis titles
and y-axis titles respectively.
res_class <- gpt_annot_class()
#> Translating ontology terms to ids.
#> Reading cached RDS file: phenotype_to_genes.txt
#> + Version: v2024-12-12
#> 383 phenotypes do not have matching HPO IDs.
#> Reading in GPT annotations for 16,753 phenotypes.
#> Assigning severity classes.
out <- plot_top_phenos(res_class = res_class)
#> Adding level-2 ancestor to each HPO ID.
#> Adding ancestor metadata.
#> Ancestor metadata already present. Use force_new=TRUE to overwrite.
#> Translating ontology terms to ids.
#> Keeping descendants of 1 term(s).
#> 18,379 terms remain after filtering.
#> 164,385 associations remain after filtering.
#> Getting absolute ontology level for 19,025 IDs.