taiyaki icon indicating copy to clipboard operation
taiyaki copied to clipboard

question about 'flipflop_remap'

Open Flower9618 opened this issue 3 years ago • 2 comments

Hello, thank you very much for providing this useful tool. I just have a question when I read the code in https://github.com/nanoporetech/taiyaki/blob/9672c66d654ad8101c4faf481646493082e090c8/taiyaki/flipflop_remap.py#L123 Why K=2nbase(nbase+1)? and waht does T mean?

Flower9618 avatar Oct 18 '21 04:10 Flower9618

Hello. We only store the nonzero entries for the full (nbase + nbase)^2 transition matrix.
Every base has a "flip" and a "flop" state, so (nbase + nbase) states in all, but transitions to a flop state can only come from a same base (either flip or flop) so part of the full transition matrix is extremely sparse.

Full transition matrix, where F is the set of "flip" bases, f is the set of "flop" bases, A & B are full rank matrices, and D & E are diagonal matrices.

  | F f 
--+-----
F | A B
f | D E

As stored in Taiyaki, where '-' represents transition to the appropriate "flop" base, and d & e are the diagonal elements of the matrices D & E above.

  | F f 
--+-----
F | A B    nbase x (nbase + nbase) elements
- | d e    (nbase + nbase) elements

tmassingham-ont avatar Oct 18 '21 07:10 tmassingham-ont

Hello. We only store the nonzero entries for the full (nbase + nbase)^2 transition matrix. Every base has a "flip" and a "flop" state, so (nbase + nbase) states in all, but transitions to a flop state can only come from a same base (either flip or flop) so part of the full transition matrix is extremely sparse.

Full transition matrix, where F is the set of "flip" bases, f is the set of "flop" bases, A & B are full rank matrices, and D & E are diagonal matrices.

  | F f 
--+-----
F | A B
f | D E

As stored in Taiyaki, where '-' represents transition to the appropriate "flop" base, and d & e are the diagonal elements of the matrices D & E above.

  | F f 
--+-----
F | A B    nbase x (nbase + nbase) elements
- | d e    (nbase + nbase) elements

It is very helpful to me. Thank you very much for your prompt reply.

Flower9618 avatar Oct 18 '21 08:10 Flower9618