11 type exportSuite struct{}
13 var _ = check.Suite(&exportSuite{})
15 func (s *exportSuite) TestFastaToHGVS(c *check.C) {
18 err := ioutil.WriteFile(tmpdir+"/chr1-12-100.bed", []byte("chr1\t12\t100\ttest.1\n"), 0644)
19 c.Check(err, check.IsNil)
21 var buffer bytes.Buffer
22 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)
23 c.Assert(exited, check.Equals, 0)
24 ioutil.WriteFile(tmpdir+"/library.gob", buffer.Bytes(), 0644)
25 var output bytes.Buffer
26 exited = (&exporter{}).RunCommand("export", []string{
28 "-i=" + tmpdir + "/library.gob",
29 "-output-format=hgvs-onehot",
30 "-output-labels=" + tmpdir + "/labels.csv",
31 "-ref=testdata/ref.fasta",
32 }, &buffer, &output, os.Stderr)
33 c.Check(exited, check.Equals, 0)
34 c.Check(sortLines(output.String()), check.Equals, sortLines(`chr1.1_3delinsGGC 1 0
35 chr1.41_42delinsAA 1 0
39 chr1.302_305delinsAAAA 1 0
41 chr2.125_127delinsAAA 0 1
43 chr2.258_269delinsAA 1 0
46 chr2.471_472delinsAA 1 0
48 labels, err := ioutil.ReadFile(tmpdir + "/labels.csv")
49 c.Check(err, check.IsNil)
50 c.Check(string(labels), check.Equals, `0,"input1","-"