import jalview.analysis.AlignmentUtils;
import jalview.io.FastaFile;
+import jalview.util.Comparison;
import jalview.util.MessageManager;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Hashtable;
-import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
protected List<SequenceI> sequences;
- protected List<SequenceGroup> groups = java.util.Collections
- .synchronizedList(new ArrayList<SequenceGroup>());
+ protected List<SequenceGroup> groups;
protected char gapCharacter = '-';
public boolean hasRNAStructure = false;
- /** DOCUMENT ME!! */
public AlignmentAnnotation[] annotations;
- HiddenSequences hiddenSequences = new HiddenSequences(this);
+ HiddenSequences hiddenSequences;
public Hashtable alignmentProperties;
- private Set<AlignedCodonFrame> codonFrameList = new LinkedHashSet<AlignedCodonFrame>();
+ private List<AlignedCodonFrame> codonFrameList;
private void initAlignment(SequenceI[] seqs)
{
- int i = 0;
+ groups = Collections.synchronizedList(new ArrayList<SequenceGroup>());
+ hiddenSequences = new HiddenSequences(this);
+ codonFrameList = new ArrayList<AlignedCodonFrame>();
- if (jalview.util.Comparison.isNucleotide(seqs))
+ if (Comparison.isNucleotide(seqs))
{
type = NUCLEOTIDE;
}
type = PROTEIN;
}
- sequences = java.util.Collections
- .synchronizedList(new ArrayList<SequenceI>());
+ sequences = Collections.synchronizedList(new ArrayList<SequenceI>());
- for (i = 0; i < seqs.length; i++)
+ for (int i = 0; i < seqs.length; i++)
{
sequences.add(seqs[i]);
}
seqs[i] = new Sequence(seqs[i]);
}
+ initAlignment(seqs);
+
/*
- * Share the same dataset sequence mappings (if any). TODO: find a better
- * place for these to live (alignment dataset?).
+ * Share the same dataset sequence mappings (if any).
*/
this.setCodonFrames(al.getCodonFrames());
-
- initAlignment(seqs);
}
/**
@Override
public void addCodonFrame(AlignedCodonFrame codons)
{
- Set<AlignedCodonFrame> acfs = getCodonFrames();
- if (codons != null && acfs != null)
+ List<AlignedCodonFrame> acfs = getCodonFrames();
+ if (codons != null && acfs != null && !acfs.contains(codons))
{
acfs.add(codons);
}
* @see jalview.datamodel.AlignmentI#setCodonFrames()
*/
@Override
- public void setCodonFrames(Set<AlignedCodonFrame> acfs)
+ public void setCodonFrames(List<AlignedCodonFrame> acfs)
{
if (dataset != null)
{
* @see jalview.datamodel.AlignmentI#getCodonFrames()
*/
@Override
- public Set<AlignedCodonFrame> getCodonFrames()
+ public List<AlignedCodonFrame> getCodonFrames()
{
return dataset != null ? dataset.getCodonFrames() : codonFrameList;
}
@Override
public boolean removeCodonFrame(AlignedCodonFrame codons)
{
- Set<AlignedCodonFrame> acfs = getCodonFrames();
+ List<AlignedCodonFrame> acfs = getCodonFrames();
if (codons == null || acfs == null)
{
return false;
}
return hasValidSeq;
}
+
+ /**
+ * Update any mappings to 'virtual' sequences to compatible real ones, if
+ * present in the added sequences. Returns a count of mappings updated.
+ *
+ * @param seqs
+ * @return
+ */
+ @Override
+ public int realiseMappings(List<SequenceI> seqs)
+ {
+ int count = 0;
+ for (SequenceI seq : seqs)
+ {
+ for (AlignedCodonFrame mapping : getCodonFrames())
+ {
+ count += mapping.realiseWith(seq);
+ }
+ }
+ return count;
+ }
+
+ /**
+ * Returns the first AlignedCodonFrame that has a mapping between the given
+ * dataset sequences
+ *
+ * @param mapFrom
+ * @param mapTo
+ * @return
+ */
+ @Override
+ public AlignedCodonFrame getMapping(SequenceI mapFrom, SequenceI mapTo)
+ {
+ for (AlignedCodonFrame acf : getCodonFrames())
+ {
+ if (acf.getAaForDnaSeq(mapFrom) == mapTo)
+ {
+ return acf;
+ }
+ }
+ return null;
+ }
}
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
-import java.util.Set;
import java.util.Vector;
import javax.swing.JInternalFrame;
AlignmentI al = getAlignment();
if (al != null)
{
- Set<AlignedCodonFrame> mappings = al.getCodonFrames();
+ List<AlignedCodonFrame> mappings = al.getCodonFrames();
if (mappings != null)
{
StructureSelectionManager ssm = StructureSelectionManager
* Check if any added sequence could be the object of a mapping or
* cross-reference; if so, make the mapping explicit
*/
- realiseMappings(getAlignment(), toAdd);
+ getAlignment().realiseMappings(toAdd.getSequences());
/*
* If any cDNA/protein mappings exist or can be made between the alignments,
// TODO: JAL-407 regardless of above - identical sequences (based on ID and
// provenance) should share the same dataset sequence
+ AlignmentI al = getAlignment();
+ String gap = String.valueOf(al.getGapCharacter());
for (int i = 0; i < toAdd.getHeight(); i++)
{
- getAlignment().addSequence(toAdd.getSequenceAt(i));
- }
-
- setEndSeq(getAlignment().getHeight());
- firePropertyChange("alignment", null, getAlignment().getSequences());
- }
-
- /**
- * Check if any added sequence could be the object of a mapping or
- * cross-reference; if so, make the mapping explicit. Returns the count of
- * mappings updated.
- *
- * @param al
- * @param toAdd
- */
- protected int realiseMappings(AlignmentI al, AlignmentI toAdd)
- {
- // TODO this is proof of concept
- // we might want to give the user some choice here
- int count = 0;
- for (SequenceI seq : toAdd.getSequences())
- {
- count += realiseMappingsTo(al, seq);
- }
- return count;
- }
-
- /**
- * If the alignment holds any mappings to a virtual (placeholder) sequence
- * that matches all or part of the given sequence, then update the mapping to
- * point to the sequence. Returns the number of mappings updated.
- *
- * @param al
- * @param seq
- * @return
- */
- protected int realiseMappingsTo(AlignmentI al, SequenceI seq)
- {
- int count = 0;
- Set<AlignedCodonFrame> mappings = al.getCodonFrames();
- for (AlignedCodonFrame mapping : mappings)
- {
+ SequenceI seq = toAdd.getSequenceAt(i);
/*
- * TODO could just go straight to realiseWith() here unless we want
- * to give the user some choice before going ahead
+ * experimental!
+ * - 'align' any mapped sequences as per existing
+ * e.g. cdna to genome, domain hit to protein sequence
+ * very experimental! (need a separate menu option for this)
+ * - only add mapped sequences ('select targets from a dataset')
*/
- if (mapping.isRealisableWith(seq))
+ if (true /*AlignmentUtils.alignSequenceAs(seq, al, gap, true, true)*/)
{
- count += mapping.realiseWith(seq);
+ al.addSequence(seq);
}
}
- return count;
+
+ setEndSeq(getAlignment().getHeight());
+ firePropertyChange("alignment", null, getAlignment().getSequences());
}
/**
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
-import java.util.Set;
/**
* base class holding visualization and analysis attributes and common logic for
* @param name
* @see jalview.api.ViewStyleI#setFontName(java.lang.String)
*/
+ @Override
public void setFontName(String name)
{
viewStyle.setFontName(name);
* @param style
* @see jalview.api.ViewStyleI#setFontStyle(int)
*/
+ @Override
public void setFontStyle(int style)
{
viewStyle.setFontStyle(style);
* @param size
* @see jalview.api.ViewStyleI#setFontSize(int)
*/
+ @Override
public void setFontSize(int size)
{
viewStyle.setFontSize(size);
* @return
* @see jalview.api.ViewStyleI#getFontStyle()
*/
+ @Override
public int getFontStyle()
{
return viewStyle.getFontStyle();
* @return
* @see jalview.api.ViewStyleI#getFontName()
*/
+ @Override
public String getFontName()
{
return viewStyle.getFontName();
* @return
* @see jalview.api.ViewStyleI#getFontSize()
*/
+ @Override
public int getFontSize()
{
return viewStyle.getFontSize();
* @param upperCasebold
* @see jalview.api.ViewStyleI#setUpperCasebold(boolean)
*/
+ @Override
public void setUpperCasebold(boolean upperCasebold)
{
viewStyle.setUpperCasebold(upperCasebold);
* @return
* @see jalview.api.ViewStyleI#isUpperCasebold()
*/
+ @Override
public boolean isUpperCasebold()
{
return viewStyle.isUpperCasebold();
* @return
* @see jalview.api.ViewStyleI#isSeqNameItalics()
*/
+ @Override
public boolean isSeqNameItalics()
{
return viewStyle.isSeqNameItalics();
* @param colourByReferenceSeq
* @see jalview.api.ViewStyleI#setColourByReferenceSeq(boolean)
*/
+ @Override
public void setColourByReferenceSeq(boolean colourByReferenceSeq)
{
viewStyle.setColourByReferenceSeq(colourByReferenceSeq);
* @param b
* @see jalview.api.ViewStyleI#setColourAppliesToAllGroups(boolean)
*/
+ @Override
public void setColourAppliesToAllGroups(boolean b)
{
viewStyle.setColourAppliesToAllGroups(b);
* @return
* @see jalview.api.ViewStyleI#getColourAppliesToAllGroups()
*/
+ @Override
public boolean getColourAppliesToAllGroups()
{
return viewStyle.getColourAppliesToAllGroups();
* @return
* @see jalview.api.ViewStyleI#getAbovePIDThreshold()
*/
+ @Override
public boolean getAbovePIDThreshold()
{
return viewStyle.getAbovePIDThreshold();
* @param inc
* @see jalview.api.ViewStyleI#setIncrement(int)
*/
+ @Override
public void setIncrement(int inc)
{
viewStyle.setIncrement(inc);
* @return
* @see jalview.api.ViewStyleI#getIncrement()
*/
+ @Override
public int getIncrement()
{
return viewStyle.getIncrement();
* @param b
* @see jalview.api.ViewStyleI#setConservationSelected(boolean)
*/
+ @Override
public void setConservationSelected(boolean b)
{
viewStyle.setConservationSelected(b);
* @param show
* @see jalview.api.ViewStyleI#setShowHiddenMarkers(boolean)
*/
+ @Override
public void setShowHiddenMarkers(boolean show)
{
viewStyle.setShowHiddenMarkers(show);
* @return
* @see jalview.api.ViewStyleI#getShowHiddenMarkers()
*/
+ @Override
public boolean getShowHiddenMarkers()
{
return viewStyle.getShowHiddenMarkers();
* @param b
* @see jalview.api.ViewStyleI#setScaleRightWrapped(boolean)
*/
+ @Override
public void setScaleRightWrapped(boolean b)
{
viewStyle.setScaleRightWrapped(b);
* @param b
* @see jalview.api.ViewStyleI#setScaleLeftWrapped(boolean)
*/
+ @Override
public void setScaleLeftWrapped(boolean b)
{
viewStyle.setScaleLeftWrapped(b);
* @param b
* @see jalview.api.ViewStyleI#setScaleAboveWrapped(boolean)
*/
+ @Override
public void setScaleAboveWrapped(boolean b)
{
viewStyle.setScaleAboveWrapped(b);
* @return
* @see jalview.api.ViewStyleI#getScaleLeftWrapped()
*/
+ @Override
public boolean getScaleLeftWrapped()
{
return viewStyle.getScaleLeftWrapped();
* @return
* @see jalview.api.ViewStyleI#getScaleAboveWrapped()
*/
+ @Override
public boolean getScaleAboveWrapped()
{
return viewStyle.getScaleAboveWrapped();
* @return
* @see jalview.api.ViewStyleI#getScaleRightWrapped()
*/
+ @Override
public boolean getScaleRightWrapped()
{
return viewStyle.getScaleRightWrapped();
* @param b
* @see jalview.api.ViewStyleI#setAbovePIDThreshold(boolean)
*/
+ @Override
public void setAbovePIDThreshold(boolean b)
{
viewStyle.setAbovePIDThreshold(b);
* @param thresh
* @see jalview.api.ViewStyleI#setThreshold(int)
*/
+ @Override
public void setThreshold(int thresh)
{
viewStyle.setThreshold(thresh);
* @return
* @see jalview.api.ViewStyleI#getThreshold()
*/
+ @Override
public int getThreshold()
{
return viewStyle.getThreshold();
* @return
* @see jalview.api.ViewStyleI#getShowJVSuffix()
*/
+ @Override
public boolean getShowJVSuffix()
{
return viewStyle.getShowJVSuffix();
* @param b
* @see jalview.api.ViewStyleI#setShowJVSuffix(boolean)
*/
+ @Override
public void setShowJVSuffix(boolean b)
{
viewStyle.setShowJVSuffix(b);
* @param state
* @see jalview.api.ViewStyleI#setWrapAlignment(boolean)
*/
+ @Override
public void setWrapAlignment(boolean state)
{
viewStyle.setWrapAlignment(state);
* @param state
* @see jalview.api.ViewStyleI#setShowText(boolean)
*/
+ @Override
public void setShowText(boolean state)
{
viewStyle.setShowText(state);
* @param state
* @see jalview.api.ViewStyleI#setRenderGaps(boolean)
*/
+ @Override
public void setRenderGaps(boolean state)
{
viewStyle.setRenderGaps(state);
* @return
* @see jalview.api.ViewStyleI#getColourText()
*/
+ @Override
public boolean getColourText()
{
return viewStyle.getColourText();
* @param state
* @see jalview.api.ViewStyleI#setColourText(boolean)
*/
+ @Override
public void setColourText(boolean state)
{
viewStyle.setColourText(state);
* @return
* @see jalview.api.ViewStyleI#getWrapAlignment()
*/
+ @Override
public boolean getWrapAlignment()
{
return viewStyle.getWrapAlignment();
* @return
* @see jalview.api.ViewStyleI#getShowText()
*/
+ @Override
public boolean getShowText()
{
return viewStyle.getShowText();
* @return
* @see jalview.api.ViewStyleI#getWrappedWidth()
*/
+ @Override
public int getWrappedWidth()
{
return viewStyle.getWrappedWidth();
* @param w
* @see jalview.api.ViewStyleI#setWrappedWidth(int)
*/
+ @Override
public void setWrappedWidth(int w)
{
viewStyle.setWrappedWidth(w);
* @return
* @see jalview.api.ViewStyleI#getCharHeight()
*/
+ @Override
public int getCharHeight()
{
return viewStyle.getCharHeight();
* @param h
* @see jalview.api.ViewStyleI#setCharHeight(int)
*/
+ @Override
public void setCharHeight(int h)
{
viewStyle.setCharHeight(h);
* @return
* @see jalview.api.ViewStyleI#getCharWidth()
*/
+ @Override
public int getCharWidth()
{
return viewStyle.getCharWidth();
* @param w
* @see jalview.api.ViewStyleI#setCharWidth(int)
*/
+ @Override
public void setCharWidth(int w)
{
viewStyle.setCharWidth(w);
* @return
* @see jalview.api.ViewStyleI#getShowBoxes()
*/
+ @Override
public boolean getShowBoxes()
{
return viewStyle.getShowBoxes();
* @return
* @see jalview.api.ViewStyleI#getShowUnconserved()
*/
+ @Override
public boolean getShowUnconserved()
{
return viewStyle.getShowUnconserved();
* @param showunconserved
* @see jalview.api.ViewStyleI#setShowUnconserved(boolean)
*/
+ @Override
public void setShowUnconserved(boolean showunconserved)
{
viewStyle.setShowUnconserved(showunconserved);
* @param default1
* @see jalview.api.ViewStyleI#setSeqNameItalics(boolean)
*/
+ @Override
public void setSeqNameItalics(boolean default1)
{
viewStyle.setSeqNameItalics(default1);
/*
* A separate thread to compute cDNA consensus for a protein alignment
+ * which has mapping to cDNA
*/
final AlignmentI al = this.getAlignment();
if (!al.isNucleotide() && al.getCodonFrames() != null
&& !al.getCodonFrames().isEmpty())
{
- if (calculator
- .getRegisteredWorkersOfClass(ComplementConsensusThread.class) == null)
+ /*
+ * fudge - check first mapping is protein-to-nucleotide
+ * (we don't want to do this for protein-to-protein)
+ */
+ AlignedCodonFrame mapping = al.getCodonFrames().iterator().next();
+ // TODO hold mapping type e.g. dna-to-protein in AlignedCodonFrame?
+ if (mapping.getdnaToProt()[0].getFromRatio() == 3)
{
- calculator.registerWorker(new ComplementConsensusThread(this, ap));
+ if (calculator
+ .getRegisteredWorkersOfClass(ComplementConsensusThread.class) == null)
+ {
+ calculator
+ .registerWorker(new ComplementConsensusThread(this, ap));
+ }
}
}
}
if (hiddenRepSequences == null)
{
- hiddenRepSequences = new Hashtable();
+ hiddenRepSequences = new Hashtable<SequenceI, SequenceCollectionI>();
}
hiddenRepSequences.put(repSequence, sg);
{
if (!alignment.isNucleotide())
{
- final Set<AlignedCodonFrame> codonMappings = alignment
+ final List<AlignedCodonFrame> codonMappings = alignment
.getCodonFrames();
if (codonMappings != null && !codonMappings.isEmpty())
{
- complementConsensus = new AlignmentAnnotation("cDNA Consensus",
- "PID for cDNA", new Annotation[1], 0f, 100f,
- AlignmentAnnotation.BAR_GRAPH);
- initConsensus(complementConsensus);
+ // fudge: check mappings are not protein-to-protein
+ // TODO: nicer
+ AlignedCodonFrame mapping = codonMappings.iterator().next();
+ if (mapping.getdnaToProt()[0].getFromRatio() == 3)
+ {
+ complementConsensus = new AlignmentAnnotation("cDNA Consensus",
+ "PID for cDNA", new Annotation[1], 0f, 100f,
+ AlignmentAnnotation.BAR_GRAPH);
+ initConsensus(complementConsensus);
+ }
}
}
}
* @return
* @see jalview.api.ViewStyleI#getTextColour()
*/
+ @Override
public Color getTextColour()
{
return viewStyle.getTextColour();
* @return
* @see jalview.api.ViewStyleI#getTextColour2()
*/
+ @Override
public Color getTextColour2()
{
return viewStyle.getTextColour2();
* @return
* @see jalview.api.ViewStyleI#getThresholdTextColour()
*/
+ @Override
public int getThresholdTextColour()
{
return viewStyle.getThresholdTextColour();
* @return
* @see jalview.api.ViewStyleI#isConservationColourSelected()
*/
+ @Override
public boolean isConservationColourSelected()
{
return viewStyle.isConservationColourSelected();
* @return
* @see jalview.api.ViewStyleI#isRenderGaps()
*/
+ @Override
public boolean isRenderGaps()
{
return viewStyle.isRenderGaps();
* @return
* @see jalview.api.ViewStyleI#isShowColourText()
*/
+ @Override
public boolean isShowColourText()
{
return viewStyle.isShowColourText();
* @param conservationColourSelected
* @see jalview.api.ViewStyleI#setConservationColourSelected(boolean)
*/
+ @Override
public void setConservationColourSelected(
boolean conservationColourSelected)
{
* @param showColourText
* @see jalview.api.ViewStyleI#setShowColourText(boolean)
*/
+ @Override
public void setShowColourText(boolean showColourText)
{
viewStyle.setShowColourText(showColourText);
* @param textColour
* @see jalview.api.ViewStyleI#setTextColour(java.awt.Color)
*/
+ @Override
public void setTextColour(Color textColour)
{
viewStyle.setTextColour(textColour);
* @param thresholdTextColour
* @see jalview.api.ViewStyleI#setThresholdTextColour(int)
*/
+ @Override
public void setThresholdTextColour(int thresholdTextColour)
{
viewStyle.setThresholdTextColour(thresholdTextColour);
* @param textColour2
* @see jalview.api.ViewStyleI#setTextColour2(java.awt.Color)
*/
+ @Override
public void setTextColour2(Color textColour2)
{
viewStyle.setTextColour2(textColour2);
* @return
* @see jalview.api.ViewStyleI#getIdWidth()
*/
+ @Override
public int getIdWidth()
{
return viewStyle.getIdWidth();
* @param i
* @see jalview.api.ViewStyleI#setIdWidth(int)
*/
+ @Override
public void setIdWidth(int i)
{
viewStyle.setIdWidth(i);
* @return
* @see jalview.api.ViewStyleI#isCentreColumnLabels()
*/
+ @Override
public boolean isCentreColumnLabels()
{
return viewStyle.isCentreColumnLabels();
* @param centreColumnLabels
* @see jalview.api.ViewStyleI#setCentreColumnLabels(boolean)
*/
+ @Override
public void setCentreColumnLabels(boolean centreColumnLabels)
{
viewStyle.setCentreColumnLabels(centreColumnLabels);
* @param showdbrefs
* @see jalview.api.ViewStyleI#setShowDBRefs(boolean)
*/
+ @Override
public void setShowDBRefs(boolean showdbrefs)
{
viewStyle.setShowDBRefs(showdbrefs);
* @return
* @see jalview.api.ViewStyleI#isShowDBRefs()
*/
+ @Override
public boolean isShowDBRefs()
{
return viewStyle.isShowDBRefs();
* @return
* @see jalview.api.ViewStyleI#isShowNPFeats()
*/
+ @Override
public boolean isShowNPFeats()
{
return viewStyle.isShowNPFeats();
* @param shownpfeats
* @see jalview.api.ViewStyleI#setShowNPFeats(boolean)
*/
+ @Override
public void setShowNPFeats(boolean shownpfeats)
{
viewStyle.setShowNPFeats(shownpfeats);
return startRes;
}
+ @Override
public int getEndRes()
{
return endRes;
{
return 0;
}
- final Set<AlignedCodonFrame> mappings = proteinAlignment
+ final List<AlignedCodonFrame> mappings = proteinAlignment
.getCodonFrames();
/*
import jalview.io.FormatAdapter;
import jalview.structure.StructureSelectionManager;
-import java.util.LinkedHashSet;
-import java.util.Set;
+import java.util.ArrayList;
+import java.util.List;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
AlignedCodonFrame acf1 = new AlignedCodonFrame();
AlignedCodonFrame acf2 = new AlignedCodonFrame();
- Set<AlignedCodonFrame> mappings = new LinkedHashSet<AlignedCodonFrame>();
+ List<AlignedCodonFrame> mappings = new ArrayList<AlignedCodonFrame>();
mappings.add(acf1);
mappings.add(acf2);
af1.getViewport().getAlignment().setCodonFrames(mappings);
*/
StructureSelectionManager ssm = StructureSelectionManager
.getStructureSelectionManager(Desktop.instance);
- assertEquals(2, ssm.seqmappings.size());
- assertTrue(ssm.seqmappings.contains(acf1));
- assertTrue(ssm.seqmappings.contains(acf2));
+ assertEquals(2, ssm.getSequenceMappings().size());
+ assertTrue(ssm.getSequenceMappings().contains(acf1));
+ assertTrue(ssm.getSequenceMappings().contains(acf2));
/*
* Close the second view. Verify that mappings are not removed as the first
* view still holds a reference to them.
*/
af1.closeMenuItem_actionPerformed(false);
- assertEquals(2, ssm.seqmappings.size());
- assertTrue(ssm.seqmappings.contains(acf1));
- assertTrue(ssm.seqmappings.contains(acf2));
+ assertEquals(2, ssm.getSequenceMappings().size());
+ assertTrue(ssm.getSequenceMappings().contains(acf1));
+ assertTrue(ssm.getSequenceMappings().contains(acf2));
}
/**
AlignedCodonFrame acf2 = new AlignedCodonFrame();
AlignedCodonFrame acf3 = new AlignedCodonFrame();
- Set<AlignedCodonFrame> mappings1 = new LinkedHashSet<AlignedCodonFrame>();
+ List<AlignedCodonFrame> mappings1 = new ArrayList<AlignedCodonFrame>();
mappings1.add(acf1);
af1.getViewport().getAlignment().setCodonFrames(mappings1);
- Set<AlignedCodonFrame> mappings2 = new LinkedHashSet<AlignedCodonFrame>();
+ List<AlignedCodonFrame> mappings2 = new ArrayList<AlignedCodonFrame>();
mappings2.add(acf2);
mappings2.add(acf3);
af2.getViewport().getAlignment().setCodonFrames(mappings2);
* AlignFrame1 has mapping acf1, AlignFrame2 has acf2 and acf3
*/
- Set<AlignedCodonFrame> ssmMappings = ssm.seqmappings;
+ List<AlignedCodonFrame> ssmMappings = ssm.getSequenceMappings();
assertEquals(0, ssmMappings.size());
ssm.registerMapping(acf1);
assertEquals(1, ssmMappings.size());
AlignedCodonFrame acf2 = new AlignedCodonFrame();
AlignedCodonFrame acf3 = new AlignedCodonFrame();
- Set<AlignedCodonFrame> mappings1 = new LinkedHashSet<AlignedCodonFrame>();
+ List<AlignedCodonFrame> mappings1 = new ArrayList<AlignedCodonFrame>();
mappings1.add(acf1);
mappings1.add(acf2);
af1.getViewport().getAlignment().setCodonFrames(mappings1);
- Set<AlignedCodonFrame> mappings2 = new LinkedHashSet<AlignedCodonFrame>();
+ List<AlignedCodonFrame> mappings2 = new ArrayList<AlignedCodonFrame>();
mappings2.add(acf2);
mappings2.add(acf3);
af2.getViewport().getAlignment().setCodonFrames(mappings2);
* AlignFrame1 has mappings acf1 and acf2, AlignFrame2 has acf2 and acf3
*/
- Set<AlignedCodonFrame> ssmMappings = ssm.seqmappings;
+ List<AlignedCodonFrame> ssmMappings = ssm.getSequenceMappings();
assertEquals(0, ssmMappings.size());
ssm.registerMapping(acf1);
assertEquals(1, ssmMappings.size());