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;
97 * Returns the full symbol counts for this profile
101 public ResidueCount getCounts()
107 * Returns the number of sequences in the profile
111 public int getHeight()
117 * Returns the number of sequences in the profile which had a gap character
118 * (or were too short to be included in this column's profile)
122 public int getGapped()
128 * Returns the highest count for any symbol(s) in the profile
132 public int getMaxCount()
138 * Returns the symbol (or concatenated symbols) which have the highest count
139 * in the profile, or an empty string if there were no symbols counted
143 public String getModalResidue()
149 * Answers the number of non-gapped sequences in the profile
153 public int getNonGapped()
155 return height - gapped;