* @param width
* @param ignoreGapsInConsensusCalculation
* @param includeAllConsSymbols
+ * @param nseq
*/
public static void completeConsensus(AlignmentAnnotation consensus,
Hashtable[] hconsensus, int iStart, int width,
boolean ignoreGapsInConsensusCalculation,
- boolean includeAllConsSymbols)
+ boolean includeAllConsSymbols, long nseq)
{
completeConsensus(consensus, hconsensus, iStart, width,
- ignoreGapsInConsensusCalculation, includeAllConsSymbols, null); // new
+ ignoreGapsInConsensusCalculation, includeAllConsSymbols, null, nseq); // new
// char[]
// { 'A', 'C', 'G', 'T', 'U' });
}
public static void completeConsensus(AlignmentAnnotation consensus,
Hashtable[] hconsensus, int iStart, int width,
boolean ignoreGapsInConsensusCalculation,
- boolean includeAllConsSymbols, char[] alphabet)
+ boolean includeAllConsSymbols, char[] alphabet, long nseq)
{
float tval, value;
if (consensus == null || consensus.annotations == null
public static void completeConsensus(AlignmentAnnotation consensus,
Hashtable[] hconsensus, int iStart, int width,
boolean ignoreGapsInConsensusCalculation,
- boolean includeAllConsSymbols)
+ boolean includeAllConsSymbols, long nseq)
{
float tval, value;
if (consensus == null || consensus.annotations == null
endRes + 1, showSequenceLogo);
if (consensus != null)
{
- _updateConsensusRow(cnsns);
+ _updateConsensusRow(cnsns, sequences.size());
}
if (cs != null)
{
public Hashtable[] consensusData = null;
- private void _updateConsensusRow(Hashtable[] cnsns)
+ private void _updateConsensusRow(Hashtable[] cnsns, long nseq)
{
if (consensus == null)
{
consensus.annotations = new Annotation[aWidth]; // should be alignment width
AAFrequency.completeConsensus(consensus, cnsns, startRes, endRes + 1,
- ignoreGapsInConsensus, showSequenceLogo); // TODO: setting container
+ ignoreGapsInConsensus, showSequenceLogo, nseq); // TODO: setting container
// for
// ignoreGapsInConsensusCalculation);
}
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Annotation;
+import jalview.datamodel.SequenceI;
import jalview.schemes.ColourSchemeI;
import java.util.Hashtable;
public class ConsensusThread extends AlignCalcWorker implements
AlignCalcWorkerI
{
+ private long nseq=-1;
+
public ConsensusThread(AlignViewportI alignViewport,
AlignmentViewPanel alignPanel)
{
hconsensus = new Hashtable[aWidth];
try
{
- AAFrequency.calculate(alignment.getSequencesArray(), 0,
+ SequenceI aseqs[] = alignment.getSequencesArray();
+ nseq = aseqs.length;
+ AAFrequency.calculate(aseqs, 0,
alignment.getWidth(), hconsensus, true);
} catch (ArrayIndexOutOfBoundsException x)
{
{
AAFrequency.completeConsensus(consensus, hconsensus, 0,
hconsensus.length, alignViewport.getIgnoreGapsConsensus(),
- alignViewport.isShowSequenceLogo());
+ alignViewport.isShowSequenceLogo(), nseq);
}
}
}
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Annotation;
+import jalview.datamodel.SequenceI;
public class StrucConsensusThread extends AlignCalcWorker implements
AlignCalcWorkerI
Hashtable[] hStrucConsensus;
+ private long nseq=-1;
+
@Override
public void run()
{
try
{
- jalview.analysis.StructureFrequency.calculate(
- alignment.getSequencesArray(), 0, alignment.getWidth(),
+ final SequenceI[] arr=
+ alignment.getSequencesArray();
+ nseq = arr.length;
+ jalview.analysis.StructureFrequency.calculate(arr, 0, alignment.getWidth(),
hStrucConsensus, true, rnaStruc);
} catch (ArrayIndexOutOfBoundsException x)
{
StructureFrequency.completeConsensus(strucConsensus, hStrucConsensus,
0, hStrucConsensus.length,
alignViewport.getIgnoreGapsConsensus(),
- alignViewport.isShowSequenceLogo());
+ alignViewport.isShowSequenceLogo(), nseq);
}
}