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 import java.io.Serializable;
28 import java.util.ArrayList;
29 import java.util.List;
30
31
32
33
34
35
36
37 public class Gene extends Read implements Serializable {
38
39 private static final long serialVersionUID = 1L;
40 ArrayList<Exon> exonList = new ArrayList<Exon>();
41 ArrayList<CDS> cdsList = new ArrayList<CDS>();
42
43 public Gene() {
44 }
45
46 public Gene(Gene other) {
47 super(other);
48 this.exonList = other.exonList;
49 this.cdsList = other.cdsList;
50 }
51
52 public Gene(int start, int end) {
53 this(null, start, end);
54 }
55
56 public Gene(String name, int start, int end) {
57 super(start, end);
58 setName(name);
59 }
60
61 public void addExon(Exon exon) {
62 this.exonList.add(exon);
63 }
64
65 public List<Exon> getExon() {
66 return exonList;
67 }
68
69 public Exon getExon(int index) {
70 return exonList.get(index);
71 }
72
73 public void addCDS(CDS cds) {
74 cdsList.add(cds);
75 }
76
77 public List<CDS> getCDS() {
78 return cdsList;
79 }
80
81 @Override
82 public void adjustToOneOrigin() {
83 super.adjustToOneOrigin();
84 for (Exon each : exonList)
85 each.adjustToOneOrigin();
86
87 for (CDS each : cdsList)
88 each.adjustToOneOrigin();
89 }
90
91 @Override
92 public void accept(OnGenomeDataVisitor visitor) {
93 visitor.visitGene(this);
94 }
95 }