malariagen_data.ag3.Ag3.plot_haplotype_network#
- Ag3.plot_haplotype_network(region: str | Region | Mapping | List[str | Region | Mapping] | Tuple[str | Region | Mapping, ...], analysis: str = 'default', sample_sets: Sequence[str] | str | None = None, sample_query: str | None = None, max_dist: int = 2, color: str | None = None, color_discrete_sequence: List | None = None, color_discrete_map: Mapping | None = None, category_orders: List | None = None, node_size_factor: int = 50, layout: str = 'cose', layout_params: Mapping | None = None, server_port: int | None = None, server_mode: Literal['inline', 'external', 'jupyterlab'] | None = 'inline', height: int = 650, width: int | str | None = '100%')#
Construct a median-joining haplotype network and display it using Cytoscape.
A haplotype network provides a visualisation of the genetic distance between haplotype_ Each node in the network represents a unique haplotype. The size (area) of the node is scaled by the number of times that unique haplotype was observed within the selected samples. A connection between two nodes represents a single SNP difference between the corresponding haplotypes.
Parameters#
- regionstr or Region or Mapping or list of str or Region or Mapping or tuple of str or Region or Mapping
Region of the reference genome. Can be a contig name, region string (formatted like “{contig}:{start}-{end}”), or identifier of a genome feature such as a gene or transcript. Can also be a sequence (e.g., list) of regions.
- analysisstr, optional, default: ‘default’
Which haplotype phasing analysis to use. See the phasing_analysis_ids property for available values.
- sample_setssequence of str or str or None, optional
List of sample sets and/or releases. Can also be a single sample set or release.
- sample_querystr or None, optional
A pandas query string to be evaluated against the sample metadata, to select samples to be included in the returned data.
- max_distint, optional, default: 2
Join network components up to a maximum distance of 2 SNP differences.
- colorstr or None, optional
Identifies a column in the sample metadata which determines the colour of pie chart segments within nodes.
- color_discrete_sequenceList or None, optional
Provide a list of colours to use.
- color_discrete_mapMapping or None, optional
Provide an explicit mapping from values to colours.
- category_ordersList or None, optional
Control the order in which values appear in the legend.
- node_size_factorint, optional, default: 50
Control the sizing of nodes.
- layoutstr, optional, default: ‘cose’
Name of the network layout to use to position nodes.
- layout_paramsMapping or None, optional
Additional parameters to the layout algorithm.
- server_portint or None, optional
Manually override the port on which the Dash app will run.
- server_mode{‘inline’, ‘external’, ‘jupyterlab’} or None, optional, default: ‘inline’
Controls how the Jupyter Dash app will be launched. See https://medium.com/plotly/introducing-jupyterdash-811f1f57c02e for more information.
- heightint, optional, default: 650
Height of the Dash app in pixels (px).
- widthint or str or None, optional, default: ‘100%’
Width of the Dash app.