if err != nil {
return 1
}
- fmt.Fprintln(stdout, output+"/export.csv")
+ fmt.Fprintln(stdout, output)
return 0
}
defer bedw.Close()
}
defer outw.Close()
- outwb := bufio.NewWriter(outw)
+ outwb := bufio.NewWriterSize(outw, 8*1024*1024)
defer outwb.Flush()
cmd.exportSeq(outwb, bedw, tilelib.taglib.keylen, seqname, refseq[seqname], tilelib, cgs)
}()
}
merges.Wait()
+ throttle.Wait()
return nil
}
exited := (&importer{}).RunCommand("import", []string{"-local=true", "-tag-library", "testdata/tags", "-output-tiles", "-save-incomplete-tiles", "testdata/pipeline1", "testdata/ref.fasta"}, &bytes.Buffer{}, &buffer, os.Stderr)
c.Assert(exited, check.Equals, 0)
ioutil.WriteFile(tmpdir+"/library.gob", buffer.Bytes(), 0644)
+
exited = (&exporter{}).RunCommand("export", []string{
"-local=true",
"-input-dir=" + tmpdir,
c.Check(string(labels), check.Equals, `0,"input1","out.csv"
1,"input2","out.csv"
`)
+
+ exited = (&exporter{}).RunCommand("export", []string{
+ "-local=true",
+ "-input-dir=" + tmpdir,
+ "-output-dir=" + tmpdir,
+ "-output-format=vcf",
+ "-ref=testdata/ref.fasta",
+ }, &buffer, os.Stderr, os.Stderr)
+ c.Check(exited, check.Equals, 0)
+ output, err = ioutil.ReadFile(tmpdir + "/out.chr1.vcf")
+ c.Check(err, check.IsNil)
+ c.Log(string(output))
+ c.Check(sortLines(string(output)), check.Equals, sortLines(`chr1 1 NNN GGC 1/1 0/0
+chr1 41 TT AA 1/0 0/0
+chr1 161 A T 0/1 0/0
+chr1 178 A T 0/1 0/0
+chr1 221 TCCA T 1/1 0/0
+chr1 302 TTTT AAAA 0/1 0/0
+`))
+ output, err = ioutil.ReadFile(tmpdir + "/out.chr2.vcf")
+ c.Check(err, check.IsNil)
+ c.Log(string(output))
+ c.Check(sortLines(string(output)), check.Equals, sortLines(`chr2 1 TTT AAA 0/0 0/1
+chr2 125 CTT AAA 0/0 1/1
+chr2 240 ATTTTTCTTGCTCTC A 1/0 0/0
+chr2 258 CCTTGTATTTTT AA 1/0 0/0
+chr2 315 C A 1/0 0/0
+chr2 469 GTGG G 1/0 0/0
+chr2 471 GG AA 0/1 0/0
+`))
}