Exemple #1
0
// NewFastaRecord is constructor of type *FastaRecord*
func NewFastaRecord(t *seq.Alphabet, id, str []byte) (*FastaRecord, error) {
	sequence, err := seq.NewSeq(t, str)
	if err != nil {
		return nil, fmt.Errorf("%s: %s", err, id)
	}
	return &FastaRecord{id, sequence}, nil
}
Exemple #2
0
// NewRecord is constructor of type Record for FASTA
func NewRecord(t *seq.Alphabet, id, name, s []byte) (*Record, error) {
	seq, err := seq.NewSeq(t, s)
	if err != nil {
		return nil, fmt.Errorf("error when parsing seq: %s (%s)", id, err)
	}
	return &Record{id, name, seq}, nil
}