Handle fasta with no line breaks.
[lightning.git] / ref2genome.go
index 31a4ee157da3a3b37d271c95044a00db7aaff56d..eeeb067694a579a140093d86d6211e8eff1dcf8d 100644 (file)
@@ -1,4 +1,8 @@
-package main
+// Copyright (C) The Lightning Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+package lightning
 
 import (
        "bufio"
@@ -79,7 +83,7 @@ func (cmd *ref2genome) RunCommand(prog string, args []string, stdin io.Reader, s
                if err != nil {
                        return 1
                }
-               fmt.Fprintln(stdout, output)
+               fmt.Fprintln(stdout, output+"/ref.genome")
                return 0
        }
 
@@ -115,6 +119,7 @@ func (cmd *ref2genome) RunCommand(prog string, args []string, stdin io.Reader, s
                                fmt.Fprintf(out, "%s\t%d\n", label, seqlen)
                        }
                        label = strings.TrimSpace(string(buf[1:]))
+                       label = strings.SplitN(label, " ", 2)[0]
                        seqlen = 0
                } else {
                        seqlen += len(bytes.TrimSpace(buf))