+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
package jalview.datamodel;
/**
- * A data bean to hold the result of computing a profile for a column of an
- * alignment
+ * A profile for one column of an alignment
*
* @author gmcarstairs
*
*/
-public class Profile
+public class Profile implements ProfileI
{
/*
- * counts of keys (chars)
+ * an object holding counts of symbols in the profile
*/
private ResidueCount counts;
/*
- * the number of sequences in the profile
+ * the number of sequences (gapped or not) in the profile
*/
private int height;
this.modalResidue = modalRes;
}
- /**
- * Set the full profile of counts
- *
- * @param residueCounts
+ /* (non-Javadoc)
+ * @see jalview.datamodel.ProfileI#setCounts(jalview.datamodel.ResidueCount)
*/
+ @Override
public void setCounts(ResidueCount residueCounts)
{
this.counts = residueCounts;
}
- /**
- * Returns the percentage identity of the profile, i.e. the highest proportion
- * of conserved (equal) symbols. The percentage is as a fraction of all
- * sequences, or only ungapped sequences if flag ignoreGaps is set true.
- *
- * @param ignoreGaps
- * @return
+ /* (non-Javadoc)
+ * @see jalview.datamodel.ProfileI#getPercentageIdentity(boolean)
*/
+ @Override
public float getPercentageIdentity(boolean ignoreGaps)
{
if (height == 0)
return pid;
}
- /**
- * Returns the full symbol counts for this profile
- *
- * @return
+ /* (non-Javadoc)
+ * @see jalview.datamodel.ProfileI#getCounts()
*/
+ @Override
public ResidueCount getCounts()
{
return counts;
}
- /**
- * Returns the number of sequences in the profile
- *
- * @return
+ /* (non-Javadoc)
+ * @see jalview.datamodel.ProfileI#getHeight()
*/
+ @Override
public int getHeight()
{
return height;
}
- /**
- * Returns the number of sequences in the profile which had a gap character
- * (or were too short to be included in this column's profile)
- *
- * @return
+ /* (non-Javadoc)
+ * @see jalview.datamodel.ProfileI#getGapped()
*/
+ @Override
public int getGapped()
{
return gapped;
}
- /**
- * Returns the highest count for any symbol(s) in the profile
- *
- * @return
+ /* (non-Javadoc)
+ * @see jalview.datamodel.ProfileI#getMaxCount()
*/
+ @Override
public int getMaxCount()
{
return maxCount;
}
- /**
- * Returns the symbol (or concatenated symbols) which have the highest count
- * in the profile, or an empty string if there were no symbols counted
- *
- * @return
+ /* (non-Javadoc)
+ * @see jalview.datamodel.ProfileI#getModalResidue()
*/
+ @Override
public String getModalResidue()
{
return modalResidue;
}
- /**
- * Answers the number of non-gapped sequences in the profile
- *
- * @return
+ /* (non-Javadoc)
+ * @see jalview.datamodel.ProfileI#getNonGapped()
*/
+ @Override
public int getNonGapped()
{
return height - gapped;