int seqCount = sequences.length;
+ int seqWithSSCount = 0;
+
ProfileI[] result = new ProfileI[width];
for (int column = start; column < end; column++)
char c = sequences[row].getCharAt(column);
List<AlignmentAnnotation> annots = AlignmentUtils.getAlignmentAnnotationForSource(sequences[row], source);
if(annots!=null) {
- for(AlignmentAnnotation aa:annots) {
- if(aa!=null) {
- ssCount++;
- }
-
- if (sequences[row].getLength() > column && !Comparison.isGap(c) && aa !=null)
- {
-
- int seqPosition = sequences[row].findPosition(column);
+ seqWithSSCount++;
+ for(AlignmentAnnotation aa:annots) {
+ if(aa!=null) {
+ ssCount++;
+ }
- char ss = AlignmentUtils.findSSAnnotationForGivenSeqposition(
- aa, seqPosition);
- if(ss == '*') {
- continue;
- }
- ssCounts.add(ss);
- }
- else if(Comparison.isGap(c) && aa!=null) {
- ssCounts.addGap();
+ if (sequences[row].getLength() > column && !Comparison.isGap(c) && aa !=null)
+ {
+
+ int seqPosition = sequences[row].findPosition(column);
+
+ char ss = AlignmentUtils.findSSAnnotationForGivenSeqposition(
+ aa, seqPosition);
+ if(ss == '*') {
+ continue;
+ }
+ ssCounts.add(ss);
+ }
+ else if(Comparison.isGap(c) && aa!=null) {
+ ssCounts.addGap();
+ }
}
}
}
- }
int maxSSCount = ssCounts.getModalCount();
String maxSS = ssCounts.getSSForCount(maxSSCount);
int gapCount = ssCounts.getGapCount();
ProfileI profile = new Profile(maxSS, ssCount, gapCount,
- maxSSCount);
+ maxSSCount, seqWithSSCount);
+
if (saveFullProfile)
{
ssConsensus.annotations[i] = null;
return;
}
-
+
+ if(ssConsensus.getNoOfSequencesIncluded()<0) {
+ ssConsensus.setNoOfSequencesIncluded(profile.getSeqWithSSCount());
+ }
+
final int dp = getPercentageDp(nseq);
float value = profile.getSSPercentageIdentity(ignoreGaps);
private ResidueCount counts;
private SecondaryStructureCount ssCounts;
+
+ private int seqWithSSCount = -1;
/*
* the number of sequences (gapped or not) in the profile
this.modalResidue = modalRes;
}
- public Profile(String modalSS, int ssCount, int gaps, int maxSSCount)
+ public Profile(String modalSS, int ssCount, int gaps, int maxSSCount, int seqWithSSCount)
{
this.height = ssCount;
this.gapped = gaps;
this.maxSSCount = maxSSCount;
this.modalSS = modalSS;
+ this.setSeqWithSSCount(seqWithSSCount);
}
/* (non-Javadoc)
{
return height - gapped;
}
+
+ public int getSeqWithSSCount()
+ {
+ return seqWithSSCount;
+ }
+
+ public void setSeqWithSSCount(int seqWithSSCount)
+ {
+ this.seqWithSSCount = seqWithSSCount;
+ }
}
&& ssConsensusProfile != null)
{
if(ssConsensusProfile.get(0)!=null)
- ssConsensus.setNoOfSequencesIncluded(ssConsensusProfile.get(0).getHeight());
+ ssConsensus.setNoOfSequencesIncluded(ssConsensusProfile.get(0).getSeqWithSSCount());
deriveSSConsensus(ssConsensus, ssConsensusProfile);
AlignmentAnnotation gap = getGapAnnotation();
if (gap != null)