1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 package org.utgenome.shell;
26
27 import java.io.File;
28
29 import org.junit.Test;
30 import org.utgenome.shell.ProjectGenerator.ProjectInfo;
31 import org.xerial.util.FileResource;
32 import org.xerial.util.FileUtil;
33
34 public class KeywordTest {
35
36 @Test
37 public void testExecuteStringArray() throws Exception {
38
39 ProjectInfo tmpProject = ProjectGenerator.createTemporatyProject();
40
41
42 File bed = File.createTempFile("bed", ".bed");
43 FileUtil.copy(FileResource.openByteStream(KeywordTest.class, "wormbase-keyword.bed"), bed);
44 UTGBShell.runCommand(new String[] { "-d", tmpProject.projectRoot, "keyword", "import", "-r", "ce6", bed.getAbsolutePath() });
45
46
47 File alias = File.createTempFile("alias", ".txt");
48 FileUtil.copy(FileResource.openByteStream(KeywordTest.class, "alias-sample.txt"), alias);
49 UTGBShell.runCommand(new String[] { "-d", tmpProject.projectRoot, "keyword", "alias", alias.getAbsolutePath() });
50
51
52 UTGBShell.runCommand(new String[] { "-d", tmpProject.projectRoot, "keyword", "search", "Y74C9" });
53
54 }
55
56 @Test
57 public void testSAMKeyword() throws Exception {
58
59 ProjectInfo tmpProject = ProjectGenerator.createTemporatyProject();
60
61
62 File sam = File.createTempFile("keyword", ".sam");
63 FileUtil.copy(FileResource.openByteStream(KeywordTest.class, "sample.sam"), sam);
64 UTGBShell.runCommand(new String[] { "-d", tmpProject.projectRoot, "keyword", "import", "-r", "HG18", sam.getAbsolutePath() });
65
66
67 UTGBShell.runCommand(new String[] { "-d", tmpProject.projectRoot, "keyword", "search", "read_5_2" });
68 }
69
70 @Test
71 public void testBAMKeyword() throws Exception {
72
73 ProjectInfo tmpProject = ProjectGenerator.createTemporatyProject();
74
75
76 File bam = File.createTempFile("keyword", ".sam");
77 FileUtil.copy(FileResource.openByteStream(KeywordTest.class, "sample.bam"), bam);
78 UTGBShell.runCommand(new String[] { "-d", tmpProject.projectRoot, "keyword", "import", "-r", "HG18", bam.getAbsolutePath() });
79
80
81 UTGBShell.runCommand(new String[] { "-d", tmpProject.projectRoot, "keyword", "search", "read_5_2" });
82 }
83
84 }