* @param hashtable
* @return
*/
- public static int[] extractCdnaProfile(Hashtable hashtable,
+ public static int[] extractCdnaProfile(
+ Hashtable<String, Object> hashtable,
boolean ignoreGaps)
{
// this holds #seqs, #ungapped, and then codon count, indexed by encoded
* the consensus data stores to be populated (one per column)
*/
public static void calculateCdna(AlignmentI alignment,
- Hashtable[] hconsensus)
+ Hashtable<String, Object>[] hconsensus)
{
final char gapCharacter = alignment.getGapCharacter();
List<AlignedCodonFrame> mappings = alignment.getCodonFrames();
for (int col = 0; col < cols; col++)
{
// todo would prefer a Java bean for consensus data
- Hashtable<String, int[]> columnHash = new Hashtable<>();
+ Hashtable<String, Object> columnHash = new Hashtable<>();
// #seqs, #ungapped seqs, counts indexed by (codon encoded + 1)
int[] codonCounts = new int[66];
codonCounts[0] = alignment.getSequences().size();
*/
public static void completeCdnaConsensus(
AlignmentAnnotation consensusAnnotation,
- Hashtable[] consensusData, boolean showProfileLogo, int nseqs)
+ Hashtable<String, Object>[] consensusData, boolean showProfileLogo,
+ int nseqs)
{
if (consensusAnnotation == null
|| consensusAnnotation.annotations == null
consensusAnnotation.scaleColLabel = true;
for (int col = 0; col < consensusData.length; col++)
{
- Hashtable hci = consensusData[col];
+ Hashtable<String, Object> hci = consensusData[col];
if (hci == null)
{
// gapped protein column?
import jalview.util.Comparison;
import jalview.util.Format;
-import java.util.ArrayList;
import java.util.Hashtable;
/**
* @param rnaStruc
*/
public static final void calculate(SequenceI[] sequences, int start,
- int end, Hashtable[] result, boolean profile,
+ int end, Hashtable<String, Object>[] result, boolean profile,
AlignmentAnnotation rnaStruc)
{
- Hashtable residueHash;
+ Hashtable<String, Object> residueHash;
String maxResidue;
char[] struc = rnaStruc.getRNAStruc().toCharArray();
}
}
- residueHash = new Hashtable();
+ residueHash = new Hashtable<>();
if (profile)
{
// TODO 1-dim array with jsize in [0], nongapped in [1]; or Pojo
maxResidue = maxResidue.equals("(") ? ")"
: maxResidue.equals("[") ? "]" : "}";
- residueHash = new Hashtable();
+ residueHash = new Hashtable<>();
if (profile)
{
residueHash.put(PROFILE,
* @param includeAllConsSymbols
*/
public static void completeConsensus(AlignmentAnnotation consensus,
- Hashtable[] hconsensus, int iStart, int width,
+ Hashtable<String, Object>[] hconsensus, int iStart, int width,
boolean ignoreGapsInConsensusCalculation,
boolean includeAllConsSymbols, long nseq)
{
for (int i = iStart; i < width; i++)
{
- Hashtable hci;
+ Hashtable<String, Object> hci;
if (i >= hconsensus.length || ((hci = hconsensus[i]) == null))
{
// happens if sequences calculated over were shorter than alignment
* @param hconsensus
* @return profile of the given column
*/
- public static int[] extractProfile(Hashtable hconsensus,
+ public static int[] extractProfile(Hashtable<String, Object> hconsensus,
boolean ignoreGapsInConsensusCalculation)
{
int[] rtnval = new int[STRUCTURE_PROFILE_LENGTH]; // 2*(5*5)+2
*
* @return
*/
- Hashtable[] getComplementConsensusHash();
+ Hashtable<String, Object>[] getComplementConsensusHash();
- Hashtable[] getRnaStructureConsensusHash();
+ Hashtable<String, Object>[] getRnaStructureConsensusHash();
boolean isIgnoreGapsConsensus();
*
* @param hconsensus
*/
- void setComplementConsensusHash(Hashtable[] hconsensus);
+ void setComplementConsensusHash(Hashtable<String, Object>[] hconsensus);
/**
*
*
* @param hStrucConsensus
*/
- void setRnaStructureConsensusHash(Hashtable[] hStrucConsensus);
+ void setRnaStructureConsensusHash(
+ Hashtable<String, Object>[] hStrucConsensus);
/**
* Sets the colour scheme for the background alignment (as distinct from
* @return
* @throws FileNotFoundException
*/
- @SuppressWarnings("unused")
public static BufferedReader getBufferedReader(Object file) throws FileNotFoundException {
if (file instanceof String)
{
import javax.swing.JScrollPane;
import javax.swing.border.Border;
+@SuppressWarnings("serial")
public class GAlignmentPanel extends JPanel
{
protected JScrollBar vscroll = new JScrollBar();
BorderLayout borderLayout11 = new BorderLayout();
- public JScrollPane annotationScroller = new JScrollPane();
+ public JScrollPane annotationScroller = new JScrollPane();
Border border1;
private ProfilesI hconsensus;
- private Hashtable[] complementConsensus;
+ private Hashtable<String, Object>[] complementConsensus;
- private Hashtable[] hStrucConsensus;
+ private Hashtable<String, Object>[] hStrucConsensus;
private boolean av_ignoreGapsConsensus;
updateFromAwtRenderPanel(annotPanel, av);
fm = g.getFontMetrics();
AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
- int temp = 0;
+ // int temp = 0;
if (aa == null)
{
return false;
boolean validRes = false;
boolean validEnd = false;
boolean labelAllCols = false;
- boolean centreColLabels;
- boolean centreColLabelsDef = av.isCentreColumnLabels();
+// boolean centreColLabels;
+// boolean centreColLabelsDef = av.isCentreColumnLabels();
boolean scaleColLabel = false;
final AlignmentAnnotation consensusAnnot = av
.getAlignmentConsensusAnnotation();
{
continue;
}
- centreColLabels = row.centreColLabels || centreColLabelsDef;
+// centreColLabels = row.centreColLabels || centreColLabelsDef;
labelAllCols = row.showAllColLabels;
scaleColLabel = row.scaleColLabel;
lastSS = ' ';
if (x > -1)
{
- int nb_annot = x - temp;
+ // int nb_annot = x - temp;
// System.out.println("\t type :"+lastSS+"\t x :"+x+"\t nbre
// annot :"+nb_annot);
switch (lastSS)
case ')': // and opposite direction
drawStemAnnot(g, row_annotations, lastSSX, x, y,
iconOffset, startRes, column, validRes, validEnd);
- temp = x;
+ // temp = x;
break;
case 'H':
drawNotCanonicalAnnot(g, nonCanColor, row_annotations,
lastSSX, x, y, iconOffset, startRes, column,
validRes, validEnd);
- temp = x;
+ // temp = x;
break;
default:
g.setColor(Color.gray);
g.fillRect(lastSSX, y + 6 + iconOffset,
(x * charWidth) - lastSSX, 2);
- temp = x;
+ // temp = x;
break;
}
}
public static final Color STEM_COLOUR = Color.blue;
- private Color sdNOTCANONICAL_COLOUR;
+ // private Color sdNOTCANONICAL_COLOUR;
void drawGlyphLine(Graphics g, Annotation[] row, int lastSSX, int x,
int y, int iconOffset, int startRes, int column, boolean validRes,
/**
* results of cDNA complement consensus visible portion of view
*/
- protected Hashtable[] hcomplementConsensus = null;
+ protected Hashtable<String, Object>[] hcomplementConsensus = null;
/**
* results of secondary structure base pair consensus for visible portion of
* view
*/
- protected Hashtable[] hStrucConsensus = null;
+ protected Hashtable<String, Object>[] hStrucConsensus = null;
protected Conservation hconservation = null;
}
@Override
- public void setComplementConsensusHash(Hashtable[] hconsensus)
+ public void setComplementConsensusHash(
+ Hashtable<String, Object>[] hconsensus)
{
this.hcomplementConsensus = hconsensus;
}
}
@Override
- public Hashtable[] getComplementConsensusHash()
+ public Hashtable<String, Object>[] getComplementConsensusHash()
{
return hcomplementConsensus;
}
@Override
- public Hashtable[] getRnaStructureConsensusHash()
+ public Hashtable<String, Object>[] getRnaStructureConsensusHash()
{
return hStrucConsensus;
}
@Override
- public void setRnaStructureConsensusHash(Hashtable[] hStrucConsensus)
+ public void setRnaStructureConsensusHash(
+ Hashtable<String, Object>[] hStrucConsensus)
{
this.hStrucConsensus = hStrucConsensus;
}
} while (end < max);
- int[][] startEnd = new int[regions.size()][2];
+ // int[][] startEnd = new int[regions.size()][2];
return regions;
}
* TODO reorder the annotation rows according to group/sequence ordering on
* alignment
*/
- boolean sortg = true;
+ // boolean sortg = true;
// remove old automatic annotation
// add any new annotation
import jalview.api.AlignmentViewPanel;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
-import jalview.datamodel.SequenceI;
import java.util.ConcurrentModificationException;
import java.util.Hashtable;
}
@Override
- protected Hashtable[] getViewportConsensus()
+ protected Hashtable<String, Object>[] getViewportConsensus()
{
return alignViewport.getComplementConsensusHash();
}
@Override
protected void computeConsensus(AlignmentI alignment)
{
- Hashtable[] hconsensus = new Hashtable[alignment.getWidth()];
+ @SuppressWarnings("unchecked")
+ Hashtable<String, Object>[] hconsensus = new Hashtable[alignment
+ .getWidth()];
- SequenceI[] aseqs = getSequences();
+ // SequenceI[] aseqs = getSequences();
/*
* Allow 3 tries at this, since this thread can start up while we are still
* the computed consensus data
*/
protected void deriveConsensus(AlignmentAnnotation consensusAnnotation,
- Hashtable[] consensusData)
+ Hashtable<String, Object>[] consensusData)
{
AAFrequency.completeCdnaConsensus(consensusAnnotation, consensusData,
alignViewport.isShowSequenceLogo(), getSequences().length);
public void updateResultAnnotation(boolean immediate)
{
AlignmentAnnotation consensus = getConsensusAnnotation();
- Hashtable[] hconsensus = getViewportConsensus();
+ Hashtable<String, Object>[] hconsensus = getViewportConsensus();
if (immediate || !calcMan.isWorking(this) && consensus != null
&& hconsensus != null)
{
return;
}
calcMan.notifyStart(this);
- long started = System.currentTimeMillis();
+ // long started = System.currentTimeMillis();
try
{
AlignmentAnnotation consensus = getConsensusAnnotation();