* consensus calculation property
*/
private boolean showSequenceLogo = false;
+
+
+ private boolean showSequenceSSLogo = false;
/**
* flag indicating if logo should be rendered normalised
private boolean hidecols = false;
AlignmentAnnotation consensus = null;
+
+
+ AlignmentAnnotation ssConsensus = null;
AlignmentAnnotation conservation = null;
private boolean showConsensusHistogram;
+
+ private boolean showSSConsensusHistogram;
private AnnotatedCollectionI context;
showSequenceLogo = seqsel.showSequenceLogo;
normaliseSequenceLogo = seqsel.normaliseSequenceLogo;
showConsensusHistogram = seqsel.showConsensusHistogram;
+ showSSConsensusHistogram = seqsel.showSSConsensusHistogram;
idColour = seqsel.idColour;
outlineColour = seqsel.outlineColour;
seqrep = seqsel.seqrep;
endRes + 1);
if (seqipos != null)
{
- seqipos.setDescription(seq.getDescription());
- seqipos.setDBRefs(seq.getDBRefs());
- seqipos.setSequenceFeatures(seq.getSequenceFeatures());
- if (seq.getDatasetSequence() != null)
- {
- seqipos.setDatasetSequence(seq.getDatasetSequence());
- }
-
if (seq.getAnnotation() != null)
{
AlignmentAnnotation[] alann = align.getAlignmentAnnotation();
newannot.restrict(startRes, endRes);
newannot.setSequenceRef(seqs[ipos]);
newannot.adjustForAlignment();
- ContactMatrixI cm = seq.getContactMatrixFor(seq.getAnnotation()[a]);
- if (cm!=null)
+ ContactMatrixI cm = seq
+ .getContactMatrixFor(seq.getAnnotation()[a]);
+ if (cm != null)
{
seqs[ipos].addContactListFor(newannot, cm);
}
cs.setConsensus(cnsns);
upd = true;
}
+
+
+ ProfilesI ssCnsns = AAFrequency.calculateSS(sequences, startRes,
+ endRes + 1, showSequenceLogo);
+ if (ssConsensus != null)
+ {
+ _updateSSConsensusRow(ssCnsns, sequences.size());
+ upd = true;
+ }
+ if (cs != null)
+ {
+ cs.setSsConsensus(ssCnsns);
+ upd = true;
+ }
+
if ((conservation != null)
|| (cs != null && cs.conservationApplied()))
} catch (java.lang.OutOfMemoryError err)
{
// TODO: catch OOM
- System.out.println("Out of memory loading groups: " + err);
+ jalview.bin.Console
+ .outPrintln("Out of memory loading groups: " + err);
}
return upd;
}
// for
// ignoreGapsInConsensusCalculation);
}
+
+ public ProfilesI ssConsensusData = null;
+
+ private void _updateSSConsensusRow(ProfilesI ssCnsns, long nseq)
+ {
+ if (ssConsensus == null)
+ {
+ getSSConsensus();
+ }
+ ssConsensus.label = "Sec Str Consensus for " + getName();
+ ssConsensus.description = "Percent Identity";
+ ssConsensusData = ssCnsns;
+ // preserve width if already set
+ int aWidth = (ssConsensus.annotations != null)
+ ? (endRes < ssConsensus.annotations.length
+ ? ssConsensus.annotations.length
+ : endRes + 1)
+ : endRes + 1;
+ ssConsensus.annotations = null;
+ ssConsensus.annotations = new Annotation[aWidth]; // should be alignment width
+
+ AAFrequency.completeSSConsensus(ssConsensus, ssCnsns, startRes, endRes + 1,
+ ignoreGapsInConsensus, showSequenceLogo, nseq); // TODO: setting
+ // container
+ // for
+ // ignoreGapsInConsensusCalculation);
+ }
/**
* @param s
}
return consensus;
}
+
+ public AlignmentAnnotation getSSConsensus()
+ {
+ // TODO get or calculate and get consensus annotation row for this group
+ int aWidth = this.getWidth();
+ // pointer
+ // possibility
+ // here.
+ if (aWidth < 0)
+ {
+ return null;
+ }
+ if (ssConsensus == null)
+ {
+ ssConsensus = new AlignmentAnnotation("", "", new Annotation[1], 0f,
+ 100f, AlignmentAnnotation.BAR_GRAPH);
+ ssConsensus.hasText = true;
+ ssConsensus.autoCalculated = true;
+ ssConsensus.groupRef = this;
+ ssConsensus.label = "Sec Str Consensus for " + getName();
+ ssConsensus.description = "Percent Identity";
+ }
+ return ssConsensus;
+ }
/**
* set this alignmentAnnotation object as the one used to render consensus
}
this.showSequenceLogo = showSequenceLogo;
}
+
+
+ public void setshowSequenceSSLogo(boolean showSequenceSSLogo)
+ {
+ // TODO: decouple calculation from settings update
+ if (this.showSequenceSSLogo != showSequenceSSLogo && ssConsensus != null)
+ {
+ this.showSequenceSSLogo = showSequenceSSLogo;
+ recalcConservation();
+ }
+ this.showSequenceSSLogo = showSequenceSSLogo;
+ }
/**
*
}
this.showConsensusHistogram = showConsHist;
}
+
+ public void setShowSSConsensusHistogram(boolean showSSConsHist)
+ {
+
+ if (showSSConsensusHistogram != showSSConsHist && consensus != null)
+ {
+ this.showSSConsensusHistogram = showSSConsHist;
+ recalcConservation();
+ }
+ this.showSSConsensusHistogram = showSSConsHist;
+ }
/**
* @return the showConsensusHistogram