* an object holding counts of symbols in the profile
*/
private ResidueCount counts;
+
+ private SecondaryStructureCount ssCounts;
/*
* the number of sequences (gapped or not) in the profile
* the highest count for any residue in the profile
*/
private int maxCount;
+ private int maxSSCount;
+
/*
* the residue (e.g. K) or residues (e.g. KQW) with the
* highest count in the profile
*/
private String modalResidue;
+
+ private String modalSS;
/**
* Constructor which allows derived data to be stored without having to store
this.maxCount = max;
this.modalResidue = modalRes;
}
+
+ public Profile(String modalSS, int ssCount, int gaps, int maxSSCount)
+ {
+ this.height = ssCount;
+ this.gapped = gaps;
+ this.maxSSCount = maxSSCount;
+ this.modalSS = modalSS;
+ }
/* (non-Javadoc)
* @see jalview.datamodel.ProfileI#setCounts(jalview.datamodel.ResidueCount)
{
this.counts = residueCounts;
}
+
+ @Override
+ public void setSSCounts(SecondaryStructureCount secondaryStructureCount)
+ {
+ this.ssCounts = secondaryStructureCount;
+ }
/* (non-Javadoc)
* @see jalview.datamodel.ProfileI#getPercentageIdentity(boolean)
}
return pid;
}
+
+ @Override
+ public float getSSPercentageIdentity(boolean ignoreGaps)
+ {
+ if (height == 0)
+ {
+ return 0f;
+ }
+ float ssPid = 0f;
+ if (ignoreGaps && gapped < height)
+ {
+ ssPid = (maxSSCount * 100f) / (height - gapped);
+ }
+ else
+ {
+ ssPid = (maxSSCount * 100f) / height;
+ }
+ return ssPid;
+ }
/* (non-Javadoc)
* @see jalview.datamodel.ProfileI#getCounts()
{
return counts;
}
+
+ @Override
+ public SecondaryStructureCount getSSCounts()
+ {
+ return ssCounts;
+ }
/* (non-Javadoc)
* @see jalview.datamodel.ProfileI#getHeight()
{
return maxCount;
}
+
+ @Override
+ public int getMaxSSCount()
+ {
+ return maxSSCount;
+ }
/* (non-Javadoc)
* @see jalview.datamodel.ProfileI#getModalResidue()
{
return modalResidue;
}
+
+ @Override
+ public String getModalSS()
+ {
+ return modalSS;
+ }
/* (non-Javadoc)
* @see jalview.datamodel.ProfileI#getNonGapped()