malariagen_data.af1.Af1.plot_snps#

Af1.plot_snps(region: str | Region | Mapping | List[str | Region | Mapping] | Tuple[str | Region | Mapping, ...], sample_sets: Sequence[str] | str | None = None, sample_query: str | None = None, sample_query_options: dict | None = None, site_mask: str = 'default', cohort_size: int | None = None, sizing_mode: Literal['fixed', 'stretch_width', 'stretch_height', 'stretch_both', 'scale_width', 'scale_height', 'scale_both'] = 'stretch_width', width: int | None = None, track_height: int = 80, genes_height: int = 90, max_snps: int = 200000, show: bool = True, gene_labels: Mapping[str, str] | None = None, gene_labelset: LabelSet | None = None) Model | None#

Plot SNPs in a given genome region. SNPs are shown as rectangles, with segregating and non-segregating SNPs positioned on different levels, and coloured by site filter.

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.

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.

sample_query_optionsdict or None, optional

A dictionary of arguments that will be passed through to pandas query() or eval(), e.g. parser, engine, local_dict, global_dict, resolvers.

site_maskstr, optional, default: ‘default’

Which site filters mask to apply. See the site_mask_ids property for available values.

cohort_sizeint or None, optional

Randomly down-sample to this value if the number of samples in the cohort is greater. Raise an error if the number of samples is less than this value.

sizing_mode{‘fixed’, ‘stretch_width’, ‘stretch_height’, ‘stretch_both’, ‘scale_width’, ‘scale_height’, ‘scale_both’}, optional, default: ‘stretch_width’

Bokeh plot sizing mode, see also https://docs.bokeh.org/en/latest/docs /user_guide/basic/layouts.html#sizing-modes.

widthint or None, optional

Plot width in pixels (px).

track_heightint, optional, default: 80

Plot height in pixels (px).

genes_heightint, optional, default: 90

Genes track height in pixels (px).

max_snpsint, optional, default: 200000

Maximum number of SNPs to show.

showbool, optional, default: True

If true, show the plot. If False, do not show the plot, but return the figure.

gene_labelsMapping[str, str] or None, optional

A mapping of gene identifiers to custom labels, which will appear in the plot.

gene_labelsetLabelSet or None, optional

A LabelSet to use in the plot.

Returns#

Model or None

A bokeh figure (only returned if show=False).