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.gwt.utgb.client.bio;
26
27
28
29
30
31
32
33 public class Read extends Interval {
34
35 public static enum ReadType {
36 INTERVAL, BED, SAM, BAM, BSS, WIG, URI
37 }
38
39
40
41
42 private static final long serialVersionUID = 1L;
43
44 private String name;
45 private String color;
46 private byte strand = '+';
47
48 public Read() {
49 super();
50 }
51
52 public Read(int start, int end) {
53 super(start, end);
54 }
55
56 public Read(String name, int start, int end) {
57 super(start, end);
58 this.name = name;
59 }
60
61 protected Read(Read other) {
62 super(other.start, other.end);
63 this.name = other.name;
64 this.color = other.color;
65 this.strand = other.strand;
66 }
67
68 @Override
69 public String getName() {
70 return name;
71 }
72
73 public void setName(String name) {
74 this.name = name;
75 }
76
77 @Override
78 public String getColor() {
79 return color;
80 }
81
82 public void setColor(String color) {
83 this.color = color;
84 }
85
86 public char getStrand() {
87 return (char) strand;
88 }
89
90 @Override
91 public boolean isSense() {
92 return '+' == strand;
93 }
94
95 @Override
96 public boolean isAntiSense() {
97 return '-' == strand;
98 }
99
100 public void setStrand(String strand) {
101 if (strand != null && strand.length() > 0)
102 this.strand = (byte) strand.charAt(0);
103 }
104
105 @Override
106 public void accept(OnGenomeDataVisitor visitor) {
107 visitor.visitRead(this);
108 }
109
110 }