Ejemplo n.º 1
0
// Compose produces a composition of the receiver defined by the features in fs. The result is stored
// in the receiver and all contributing sequences are modified.
func (m *Multi) Compose(fs feat.Set) error {
	m.Flush(seq.Start|seq.End, m.Alpha.Gap())

	for _, r := range m.Seq {
		err := sequtils.Compose(r, r, fs)
		if err != nil {
			return err
		}
	}

	return nil
}
Ejemplo n.º 2
0
func ExampleSeq_Compose() {
	s := NewSeq("example DNA", []alphabet.Letter("aAGTATAAgtcagtgcagtgtctggcag<TS>gtagtgaagtagggttagttta"), alphabet.DNA)
	f := fs{
		fe{s: 0, e: 32},
		fe{s: 1, e: 8, st: -1},
		fe{s: 28, e: s.Len() - 1},
	}
	fmt.Printf("%-s\n", s)
	if err := sequtils.Compose(s, s, f); err == nil {
		fmt.Printf("%-s\n", s)
	}
	// Output:
	// aAGTATAAgtcagtgcagtgtctggcag<TS>gtagtgaagtagggttagttta
	// aAGTATAAgtcagtgcagtgtctggcag<TS>TTATACT<TS>gtagtgaagtagggttagttt
}