-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMutType.java
73 lines (63 loc) · 1.83 KB
/
MutType.java
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
public class MutType{
private int synVal; /* 1 if Syn, 0 if non-syn, -1, if NG due to bases other than atgc */
private char prevAmino;
private char afterAmino;
private String prevTriplet;
private String afterTriplet;
private boolean isConservative;
private Gene gene;
//int dist;
public MutType(int synVal, char pA, char aA, String pT, String aT){
this.synVal = synVal;
this.prevAmino = pA;
this.afterAmino = aA;
this.prevTriplet = pT;
this.afterTriplet = aT;
this.isConservative = true;
this.gene = null;
}
public MutType(int synVal, char pA, char aA, String pT, String aT, Gene g){
this(synVal,pA,aA,pT,aT);
this.gene = g;
}
public Gene getGene(){
return this.gene;
}
public String mutString(){
StringBuffer bf = new StringBuffer(this.prevTriplet + "\t" + this.afterTriplet + "\t" + this.prevAmino + "\t" + this.afterAmino + "\t");
if(this.gene == null)
bf.append("-\t-");
else
bf.append(this.gene.getGName() + "\t" + this.gene.directionStr());
return bf.toString();
}
public void setGene(Gene g){
this.gene = g;
}
public int getSynVal(){
return this.synVal;
}
public char getPrevAmino(){
return this.prevAmino;
}
public char getAfterAmino(){
return this.afterAmino;
}
public boolean isConservative(){
return this.isConservative;
}
/* with threshold = 0, greater TRUE --> 0 or greaters : conservative, otherwise nonconservative*/
public boolean isConservative(SubstitutionMatrix sm, int threshold, boolean greater){
//System.out.println("here");
int dist = sm.getDistance(this.prevAmino, this.afterAmino);
//this.dist = dist;
if(greater){
if(dist < threshold)
this.isConservative = false;
}else{
if(dist > threshold)
this.isConservative = false;
}
return this.isConservative;
}
}