Use only first field of fasta comment as sequence label.
authorTom Clegg <tom@tomclegg.ca>
Wed, 21 Oct 2020 21:16:37 +0000 (17:16 -0400)
committerTom Clegg <tom@tomclegg.ca>
Wed, 21 Oct 2020 21:16:37 +0000 (17:16 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@tomclegg.ca>

tilelib.go

index 403be31c7babfb0d9aeb9104312dbe836282a19e..7f19b0d4081c2f70c5fa23eed610e44bf0cfc441 100644 (file)
@@ -251,7 +251,7 @@ func (tilelib *tileLibrary) TileFasta(filelabel string, rdr io.Reader) (tileSeq,
                        buf := scanner.Bytes()
                        if len(buf) > 0 && buf[0] == '>' {
                                todo <- jobT{seqlabel, fasta}
-                               seqlabel, fasta = string(buf[1:]), nil
+                               seqlabel, fasta = strings.SplitN(string(buf[1:]), " ", 2)[0], nil
                                log.Debugf("%s %s reading fasta", filelabel, seqlabel)
                        } else {
                                fasta = append(fasta, bytes.ToLower(buf)...)