1 package jalview.datamodel;
5 * A profile for one column of an alignment
10 public class Profile implements ProfileI
13 * an object holding counts of symbols in the profile
15 private ResidueCount counts;
18 * the number of sequences (gapped or not) in the profile
23 * the number of non-gapped sequences in the profile
28 * the highest count for any residue in the profile
33 * the residue (e.g. K) or residues (e.g. KQW) with the
34 * highest count in the profile
36 private String modalResidue;
39 * Constructor which allows derived data to be stored without having to store
43 * the number of sequences in the profile
45 * the number of gapped sequences
47 * the highest count for any residue
49 * the residue (or concatenated residues) with the highest count
51 public Profile(int seqCount, int gaps, int max, String modalRes)
53 this.height = seqCount;
56 this.modalResidue = modalRes;
60 * @see jalview.datamodel.ProfileI#setCounts(jalview.datamodel.ResidueCount)
63 public void setCounts(ResidueCount residueCounts)
65 this.counts = residueCounts;
69 * @see jalview.datamodel.ProfileI#getPercentageIdentity(boolean)
72 public float getPercentageIdentity(boolean ignoreGaps)
79 if (ignoreGaps && gapped < height)
81 pid = (maxCount * 100f) / (height - gapped);
85 pid = (maxCount * 100f) / height;
91 * @see jalview.datamodel.ProfileI#getCounts()
94 public ResidueCount getCounts()
100 * @see jalview.datamodel.ProfileI#getHeight()
103 public int getHeight()
109 * @see jalview.datamodel.ProfileI#getGapped()
112 public int getGapped()
118 * @see jalview.datamodel.ProfileI#getMaxCount()
121 public int getMaxCount()
127 * @see jalview.datamodel.ProfileI#getModalResidue()
130 public String getModalResidue()
136 * @see jalview.datamodel.ProfileI#getNonGapped()
139 public int getNonGapped()
141 return height - gapped;