BiocPy/GenomicRanges

Store strand as a NumPy array or Factor (probably)

LTLA opened this issue · 2 comments

LTLA commented

Continuing with the theme of not using lists for internal representations wherever possible, as this lacks guarantees.

LTLA commented

Actually, it's probably better to just use -1, 0, and 1 in a uint8 array, which is pretty clear enough and avoids fiddling with factor levels (e.g., when combining GRanges, can you be sure that all objects have the same set of levels?). We can just add some pretty-printing to the __str__ method to make it look nice.

its a numpy vector of -1 for "-" (reverse strand), 0 for "*" (any strand) ,1 for "+" (forward strand)