SequenceAlignment.opIndex

Get a partial alignment with respect to reference.

  1. auto opDollar()
  2. auto opIndex(in size_t[2] slice)
    struct SequenceAlignment(S, alias scoreFun = "a == b ? 0 : 1")
    opIndex
    inout pure nothrow
    (
    in size_t[2] slice
    )

Examples

1 enum indelPenalty = 1;
2 auto alignment = findAlignment("GCATGCT", "GATTACA", indelPenalty);
3 
4 assert(alignment.score == 4);
5 assert(alignment.toString ==
6     "GCAT-GCT\n" ~
7     "| || *|*\n" ~
8     "G-ATTACA");
9 
10 auto partialAlignment = alignment[1 .. 5];
11 
12 assert(partialAlignment.score == 3);
13 assert(partialAlignment.toString ==
14     "CAT-G\n" ~
15     " || *\n" ~
16     "-ATTA");

Meta