func (self *QSeq) Extract(i int) protein.Sequence { s := make([]alphabet.QLetter, 0, self.Len()) for _, c := range self.S { s = append(s, c[i]) } return protein.NewQSeq(self.SubIDs[i], s, self.alphabet, self.encoding) }
func ExampleMulti_Add() { fmt.Printf("%v %v\n", m.Count(), m) m.Add(protein.NewQSeq("example protein", []alphabet.QLetter{{'a', 40}, {'c', 39}, {'g', 40}, {'C', 38}, {'t', 35}, {'g', 20}}, alphabet.Protein, alphabet.Sanger)) fmt.Printf("%v %v\n", m.Count(), m) // Output: // 3 acgxtgacxtggcgcxcat // 4 acgctgacxtggcgcxcat }
func (self *Multi) Consensus(includeMissing bool) (c *protein.QSeq) { cs := make([]alphabet.QLetter, 0, self.Len()) for i := self.Start(); i < self.End(); i++ { cs = append(cs, self.Consensify(self, i, includeMissing)) } c = protein.NewQSeq("Consensus:"+self.ID, cs, self.alphabet, self.encoding) c.Offset(self.offset) return }
func (self *Seq) Consensus(_ bool) (qs *protein.QSeq) { cs := make([]alphabet.QLetter, 0, self.Len()) for i := range self.S { cs = append(cs, self.Consensify(self, i, false)) } qs = protein.NewQSeq("Consensus:"+self.ID, cs, self.alphabet, alphabet.Sanger) qs.Offset(self.offset) qs.Circular(self.circular) return }