1 alias J = Join!int; 2 alias S = Scaffold!int; 3 alias CN = ContigNode; 4 alias CP = ContigPart; 5 // contig 1 contig 2 6 // 7 // o o o o 8 // / e1 e2 \ / e4 9 // o -- o ------- o -- o 10 // e3 11 // 12 // o -- o o -- o o -- o 13 // \ e7 e8 / \ e9 14 // o o o o o o 15 // 16 // contig 5 contig 4 contig 3 17 // 18 auto scaffold = buildScaffold!(sumPayloads!int, int)(5, [ 19 J(CN(1, CP.end), CN(1, CP.post ), 1), // e1 20 J(CN(1, CP.end), CN(1, CP.post ), 1), // e1 21 J(CN(2, CP.pre), CN(2, CP.begin), 1), // e2 22 J(CN(1, CP.end), CN(2, CP.begin), 1), // e3 23 J(CN(2, CP.end), CN(2, CP.post ), 1), // e4 24 J(CN(4, CP.end), CN(4, CP.post ), 1), // e7 25 J(CN(3, CP.pre), CN(3, CP.begin), 1), // e8 26 J(CN(3, CP.end), CN(3, CP.post ), 1), // e9 27 ]).mergeExtensionsWithGaps!("a + b", int); 28 29 assert(J(CN(1, CP.end), CN(1, CP.post)) !in scaffold); // e1 30 assert(J(CN(2, CP.pre), CN(2, CP.begin)) !in scaffold); // e2 31 assert(J(CN(1, CP.end), CN(2, CP.begin)) in scaffold); // e3 32 assert(J(CN(2, CP.end), CN(2, CP.post)) in scaffold); // e4 33 assert(J(CN(4, CP.end), CN(4, CP.post)) in scaffold); // e7 34 assert(J(CN(3, CP.pre), CN(3, CP.begin)) in scaffold); // e8 35 assert(J(CN(3, CP.end), CN(3, CP.post)) in scaffold); // e9 36 37 assert(scaffold.get(J(CN(1, CP.end), CN(2, CP.begin))).payload == 4); // merged 2 * e1 + e2 + e3
Remove extension edges were they coincide with a gap edge combining their payload. This is intended to build pile ups with all reads that contribute to each gap.