adam_core.coordinates.variants module

class adam_core.coordinates.variants.VariantCoordinatesTable(*args, **kwargs)[source]

Bases: Generic[T], Protocol

A protocol for a generic table of variant coordinates.

property index: Int64Array
property sample: T
property weight: DoubleArray
property weight_cov: DoubleArray
adam_core.coordinates.variants.create_coordinate_variants(coordinates: CoordinateType, method: Literal['auto', 'sigma-point', 'monte-carlo'] = 'auto', num_samples: int = 10000, alpha: float = 1, beta: float = 0, kappa: float = 0, seed: int | None = None) VariantCoordinatesTable[CoordinateType][source]

Sample and create variants for the given coordinates by sampling the covariance matrices. There are three supported methods:

  1. sigma-point: Sample the covariance matrix using sigma points. This is the fastest method, but can be inaccurate if the covariance matrix is not well behaved.

  2. monte-carlo: Sample the covariance matrix using a monte carlo method. This is the slowest method, but is the most accurate.

  3. auto: Automatically select the best method based on the covariance matrix. If the covariance matrix is well behaved then sigma-point sampling will be used. If the covariance matrix is not well behaved then monte-carlo sampling will be used.

When sampling with monte-carlo, 10k samples are drawn. Sigma-point sampling draws 13 samples for 6-dimensional coordinates.

Warning

This function does not yet handle sampling of covariances and coordinates with missing values.

Parameters:
  • coordinates – The coordinates to sample.

  • method – The method to use for sampling the covariance matrix. If ‘auto’ is selected then the method will be automatically selected based on the covariance matrix. The default is ‘auto’.

  • num_samples (int, optional) – The number of samples to draw when sampling with monte-carlo.

  • alpha – Spread of the sigma points between 1e^-2 and 1.

  • beta – Prior knowledge of the distribution when generating sigma points usually set to 2 for a Gaussian.

  • kappa – Secondary scaling parameter when generating sigma points usually set to 0.

Return type:

The variant coordinates.

Raises:

ValueError: – If the covariance matrices are all undefined. If the input coordinates are not supported.