Beispiel #1
0
func (s *S) TestReadFastq(c *check.C) {
	r := fastq.NewReader(strings.NewReader(fq), linear.NewQSeq("", nil, alphabet.DNA, alphabet.Sanger))
	m, _ := multi.NewMulti("", nil, seq.DefaultQConsensus)
	a, err := NewReader(r, m).Read()
	c.Check(err, check.Equals, nil)
	c.Check(a.Rows(), check.Equals, 25)
}
Beispiel #2
0
func (s *S) TestReadFastq(c *check.C) {
	var (
		obtainNfq []string
		obtainQL  [][]alphabet.QLetter
	)

	sc := seqio.NewScanner(
		fastq.NewReader(
			bytes.NewBufferString(fq0),
			linear.NewQSeq("", nil, alphabet.DNA, alphabet.Sanger),
		),
	)
	for sc.Next() {
		t := sc.Seq().(*linear.QSeq)
		header := t.Name()
		if desc := t.Description(); len(desc) > 0 {
			header += " " + desc
		}
		obtainNfq = append(obtainNfq, header)
		obtainQL = append(obtainQL, (t.Slice().(alphabet.QLetters)))
	}
	c.Check(sc.Error(), check.Equals, nil)
	c.Check(obtainNfq, check.DeepEquals, expectNfq)
	c.Check(obtainQL, check.DeepEquals, expectQL)
}