agglovar.util.var

Variant utilites.

Functions

id_version_expr(→ polars.Expr)

De-duplicate IDs by appending an integer to ID strings.

Module Contents

agglovar.util.var.id_version_expr(id_col: str = 'id') polars.Expr

De-duplicate IDs by appending an integer to ID strings.

The first appearance of an ID is never modified. The second appearance of an ID gets “.1” appended, the third “.2”, and so on.

If any variant IDs are already versioned, then versions are stripped.

Parameters:

id_col – ID column name.

Returns:

An expression for versioning variant IDs.