-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMatrixEntry.java
More file actions
30 lines (25 loc) · 1.05 KB
/
Copy pathMatrixEntry.java
File metadata and controls
30 lines (25 loc) · 1.05 KB
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
package ca.virology.baseByBase.gui.CodeHop;
import java.util.ArrayList;
//=========================================================================
// Class: MatrixEntry
//
// The pssm matrix will contain MatrixEntry objects in its cells
//=========================================================================
public class MatrixEntry {
public char aminoAcidName;
public double aminoAcidFreq;
public ArrayList<CodonOccurrence> codonOccurrenceArray;
public MatrixEntry(char a, double b) {
this.aminoAcidName = a;
this.aminoAcidFreq = b;
codonOccurrenceArray = new ArrayList<CodonOccurrence>(6);
addToCodonOccurence(aminoAcidName, aminoAcidFreq);
}
private void addToCodonOccurence(char aa, double freq) {
ArrayList<CodonTableEntry> entry = CodeHopSelectPanel.codonTable.getCodons(aa);
for (int i = 0; i < entry.size(); i++) {
double codonOccFreq = freq * entry.get(i).prob;
codonOccurrenceArray.add(new CodonOccurrence(entry.get(i).codon, codonOccFreq));
}
}
}