Example #1
0
func addToMSA(sequences chan seq.Sequence, msa *seq.MSA) {
	wgSeqFragments.Add(1)
	go func() {
		for s := range sequences {
			// We don't use Add or AddFasta since both are
			// O(#sequences * #frag-length), which gets to be quite slow
			// in the presence of a lot of sequences.
			//
			// The key here is that we know that every sequence has the same
			// length and is in the same format, so we can add entries in a
			// straight forward manner.
			msa.Entries = append(msa.Entries, s)
		}
		wgSeqFragments.Done()
	}()
}