1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package org.utgenome.gwt.utgb.client.bio;
24
25
26
27
28
29
30
31 public class SAMReadPair extends Interval {
32
33 private static final long serialVersionUID = 1L;
34
35 private SAMReadLight first;
36 private SAMReadLight second;
37
38 public SAMReadPair() {
39 }
40
41 public SAMReadPair(SAMReadLight first, SAMReadLight second) {
42 super(Math.min(first.unclippedStart, second.unclippedStart), Math.max(first.unclippedEnd, second.unclippedEnd));
43 if (!(first.isFirstRead() && second.isSecondRead())) {
44 throw new IllegalArgumentException("invalid sam read pair:\n" + first + "\n" + second);
45 }
46
47 this.first = first;
48 this.second = second;
49 }
50
51 public SAMReadLight getFirst() {
52 return first;
53 }
54
55 public SAMReadLight getSecond() {
56 return second;
57 }
58
59 public Gap getGap() {
60 return new Gap(first.getEnd(), second.getStart());
61 }
62
63 @Override
64 public String getName() {
65 return first.getName();
66 }
67
68 @Override
69 public void accept(OnGenomeDataVisitor visitor) {
70 visitor.visitSAMReadPair(this);
71 }
72 }