Esempio n. 1
0
// Reverse the sequence.
func (self *Seq) Reverse() {
	self.S.Letters = sequtils.Reverse(self.S.Letters).([]alphabet.Pack)
	for i := range self.S.Letters {
		v := &self.S.Letters[i]
		*v = ((*v >> 2) & 0x33) | ((*v & 0x33) << 2)
		*v = ((*v >> 4) & 0x0f) | ((*v & 0x0f) << 4)
	}
	self.S.LeftPad, self.S.RightPad = self.S.RightPad, self.S.LeftPad
}
Esempio n. 2
0
// Reverse complement the sequence.
func (self *Seq) RevComp() {
	// depends on complements being reversed bit order - ensure this at construction
	self.S.Letters = sequtils.Reverse(self.S.Letters).([]alphabet.Pack)
	for i := range self.S.Letters {
		v := &self.S.Letters[i]
		*v = ((*v >> 2) & 0x33) | ((*v & 0x33) << 2)
		*v = ((*v >> 4) & 0x0f) | ((*v & 0x0f) << 4)
		*v ^= 0xff
	}
	self.S.LeftPad, self.S.RightPad = self.S.RightPad, self.S.LeftPad
	self.Strand = -self.Strand
}
Esempio n. 3
0
File: phred.go Progetto: frogs/biogo
func (self *Phred) Compose(f feat.FeatureSet) (err error) {
	tt, err := sequtils.Compose(self.S, self.offset, f)
	if err == nil {
		s := []alphabet.Qphred{}
		for i, ts := range tt {
			if f[i].Strand == -1 {
				s = append(s, sequtils.Reverse(ts).([]alphabet.Qphred)...)
			} else {
				s = append(s, ts.([]alphabet.Qphred)...)
			}
		}

		self.S = s
		self.circular = false
		self.offset = 0
	}

	return
}
Esempio n. 4
0
File: qseq.go Progetto: frogs/biogo
// Reverse the sequence.
func (self *QSeq) Reverse() { self.S = sequtils.Reverse(self.S).([]alphabet.QLetter) }
Esempio n. 5
0
// Reverse the sequence.
func (self *QSeq) Reverse() { self.S = sequtils.Reverse(self.S).([]alphabet.QPack) }
Esempio n. 6
0
File: phred.go Progetto: frogs/biogo
func (self *Phred) Reverse() { self.S = sequtils.Reverse(self.S).([]alphabet.Qphred) }
Esempio n. 7
0
func (self *Solexa) Reverse() { self.S = sequtils.Reverse(self.S).([]alphabet.Qsolexa) }