1 package jalview.analysis;
5 * A data bean to hold the result of computing a profile for a column of an
14 * counts of keys (chars)
16 private ResidueCount counts;
19 * the number of sequences in the profile
24 * the number of non-gapped sequences in the profile
29 * the highest count for any residue in the profile
34 * the residue (e.g. K) or residues (e.g. KQW) with the
35 * highest count in the profile
37 private String modalResidue;
40 * Constructor which allows derived data to be stored without having to store
44 * the number of sequences in the profile
46 * the number of gapped sequences
48 * the highest count for any residue
50 * the residue (or concatenated residues) with the highest count
52 public Profile(int seqCount, int gaps, int max, String modalRes)
54 this.height = seqCount;
57 this.modalResidue = modalRes;
61 * Set the full profile of counts
63 * @param residueCounts
65 public void setCounts(ResidueCount residueCounts)
67 this.counts = residueCounts;
71 * Returns the percentage identity of the profile, i.e. the highest proportion
72 * of conserved (equal) symbols. The percentage is as a fraction of all
73 * sequences, or only ungapped sequences if flag ignoreGaps is set true.
78 public float getPercentageIdentity(boolean ignoreGaps)
85 if (ignoreGaps && gapped < height)
87 pid = (maxCount * 100f) / (height - gapped);
91 pid = (maxCount * 100f) / height;
96 public ResidueCount getCounts()
101 public int getHeight()
106 public int getGapped()
111 public int getMaxCount()
116 public String getModalResidue()
122 * Answers the number of non-gapped sequences in the profile
126 public int getNonGapped()
128 return height - gapped;