1
2
3
4
5
6
7 package org.utgenome.gwt.utgb.server.app;
8
9 import java.io.File;
10 import java.io.IOException;
11
12 import javax.servlet.ServletException;
13 import javax.servlet.http.HttpServletRequest;
14 import javax.servlet.http.HttpServletResponse;
15
16 import net.sf.samtools.SAMFileReader;
17 import net.sf.samtools.SAMRecord;
18 import net.sf.samtools.util.CloseableIterator;
19
20 import org.utgenome.gwt.utgb.server.WebTrackBase;
21 import org.xerial.util.log.Logger;
22
23
24
25
26
27 public class SAMViewer extends WebTrackBase {
28 private static final long serialVersionUID = 1L;
29 private static Logger _logger = Logger.getLogger(SAMViewer.class);
30
31
32
33
34
35
36
37
38
39
40 public String species;
41 public String revision;
42 public String name;
43 public int start;
44 public int end;
45 public int width;
46
47 public SAMViewer() {
48 }
49
50 public void handle(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
51
52
53 if (start < end) {
54 int tmp = start;
55 start = end;
56 end = tmp;
57 }
58
59 SAMFileReader reader = new SAMFileReader(new File(""));
60 CloseableIterator<SAMRecord> queryOverlapping = reader.queryOverlapping(name, start, end);
61
62 for (; queryOverlapping.hasNext();) {
63 SAMRecord read = queryOverlapping.next();
64
65 }
66
67 }
68
69 }