*/
package jalview.analysis;
+import java.util.Arrays;
+import java.util.Hashtable;
+import java.util.List;
+
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.util.MappingUtils;
import jalview.util.QuickSort;
-import java.util.Arrays;
-import java.util.Hashtable;
-import java.util.List;
-
/**
* Takes in a vector or array of sequences and column start and column end and
* returns a new Hashtable[] of size maxSeqLength, if Hashtable not supplied.
}
}
- public static final ProfilesI calculate(List<SequenceI> list,
- int start, int end)
+ public static final ProfilesI calculate(List<SequenceI> list, int start,
+ int end)
{
return calculate(list, start, end, false);
}
public static void completeGapAnnot(AlignmentAnnotation consensus,
ProfilesI profiles, int startCol, int endCol, long nseq)
{
- // long now = System.currentTimeMillis();
if (consensus == null || consensus.annotations == null
|| consensus.annotations.length < endCol)
{
final int gapped = profile.getGapped();
- String description = "" + gapped;
+ String description = String.valueOf(gapped);
- consensus.annotations[i] = new Annotation(gapped);
+ consensus.annotations[i] = new Annotation("", description, '0',
+ gapped);
}
- // long elapsed = System.currentTimeMillis() - now;
- // System.out.println(-elapsed);
}
/**
* calculations
* @return
*/
- public static int[] extractProfile(ProfileI profile,
- boolean ignoreGaps)
+ public static int[] extractProfile(ProfileI profile, boolean ignoreGaps)
{
int[] rtnval = new int[64];
ResidueCount counts = profile.getCounts();
*/
package jalview.viewmodel;
+import java.awt.Color;
+import java.beans.PropertyChangeSupport;
+import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.BitSet;
+import java.util.Deque;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
import jalview.analysis.Conservation;
import jalview.api.AlignCalcManagerI;
import jalview.workers.ConsensusThread;
import jalview.workers.StrucConsensusThread;
-import java.awt.Color;
-import java.beans.PropertyChangeSupport;
-import java.util.ArrayDeque;
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.Deque;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-
/**
* base class holding visualization and analysis attributes and common logic for
* an active alignment view displayed in the GUI
initConsensus(consensus);
gapcounts = new AlignmentAnnotation("Gaps", "Number of Gaps",
new Annotation[1], 0f, alignment.getHeight(),
- AlignmentAnnotation.LINE_GRAPH);
+ AlignmentAnnotation.BAR_GRAPH);
initGapCounts(gapcounts);
initComplementConsensus();
// these should be extracted from the view model - style and settings for
// derived annotation
- private void initGapCounts(AlignmentAnnotation gapcounts)
+ private void initGapCounts(AlignmentAnnotation counts)
{
- gapcounts.hasText = false;
- gapcounts.autoCalculated = true;
- gapcounts.graph = AlignmentAnnotation.BAR_GRAPH;
+ counts.hasText = false;
+ counts.autoCalculated = true;
+ counts.graph = AlignmentAnnotation.BAR_GRAPH;
if (showConsensus)
{
- alignment.addAnnotation(gapcounts);
+ alignment.addAnnotation(counts);
}
}
*/
private boolean selectionIsDefinedGroup = false;
-
@Override
public boolean isSelectionDefinedGroup()
{
AlignmentAnnotation consensus = getConsensusAnnotation();
consensus.annotations = new Annotation[aWidth];
AlignmentAnnotation gap = getGapAnnotation();
- if (gap!=null) {
+ if (gap != null)
+ {
gap.annotations = new Annotation[aWidth];
}
}
SequenceI[] aseqs = getSequences();
int width = alignment.getWidth();
- ProfilesI hconsensus = AAFrequency.calculate(aseqs, width, 0,
- width, true);
+ ProfilesI hconsensus = AAFrequency.calculate(aseqs, width, 0, width,
+ true);
alignViewport.setSequenceConsensusHash(hconsensus);
setColourSchemeConsensus(hconsensus);
long nseq = getSequences().length;
AAFrequency.completeConsensus(consensusAnnotation, hconsensus,
- hconsensus.getStartColumn(),
- hconsensus.getEndColumn() + 1,
+ hconsensus.getStartColumn(), hconsensus.getEndColumn() + 1,
alignViewport.isIgnoreGapsConsensus(),
alignViewport.isShowSequenceLogo(), nseq);
}
- /**
- * Convert the computed consensus data into a gap annotation row for
- * display.
- *
- * @param gapAnnotation
- * the annotation to be populated
- * @param hconsensus
- * the computed consensus data
- */
- protected void deriveGap(AlignmentAnnotation gapAnnotation,
- ProfilesI hconsensus)
- {
- long nseq = getSequences().length;
- AAFrequency.completeGapAnnot(gapAnnotation, hconsensus,
+ /**
+ * Convert the computed consensus data into a gap annotation row for display.
+ *
+ * @param gapAnnotation
+ * the annotation to be populated
+ * @param hconsensus
+ * the computed consensus data
+ */
+ protected void deriveGap(AlignmentAnnotation gapAnnotation,
+ ProfilesI hconsensus)
+ {
+ long nseq = getSequences().length;
+ AAFrequency.completeGapAnnot(gapAnnotation, hconsensus,
hconsensus.getStartColumn(), hconsensus.getEndColumn() + 1,
nseq);
-
}
/**