split

Contents

split#

Variant.split(anchor)[source]#

Splits the variant into two at the anchor point.

If the anchor point falls within the variant’s reference sequence, the variant is split into two new variants: one upstream of the anchor and one downstream. If the anchor is outside the variant’s reference sequence, the original variant is returned on the appropriate side, and None on the other.

Example

position= 3 ref: …[ A C ]… alt: …..T G T C anchor=3 | returns: (chr1:3:A>T, chr1:4:C>GTC)

Parameters:

anchor (int) – The 0-based anchor point to split the variant.

Return type:

tuple[Optional[Self], Optional[Self]]

Returns:

A tuple of the upstream and downstream variants. If the variant is only on one side of the anchorpoint, then None is returned.