*/
private boolean normaliseSequenceLogo;
- /**
- * @return the includeAllConsSymbols
+ /*
+ * visibility of rows or represented rows covered by group
*/
- public boolean isShowSequenceLogo()
- {
- return showSequenceLogo;
- }
+ private boolean hidereps = false;
+
+ /*
+ * visibility of columns intersecting this group
+ */
+ private boolean hidecols = false;
+
+ AlignmentAnnotation consensus = null;
+
+ AlignmentAnnotation conservation = null;
+
+ private boolean showConsensusHistogram;
+
+ private AnnotatedCollectionI context;
/**
* Creates a new SequenceGroup object.
colourText = seqsel.colourText;
startRes = seqsel.startRes;
endRes = seqsel.endRes;
- cs = seqsel.cs;
+ cs = new ResidueShader(seqsel.getColourScheme());
if (seqsel.description != null)
{
description = new String(seqsel.description);
}
hidecols = seqsel.hidecols;
hidereps = seqsel.hidereps;
+ showNonconserved = seqsel.showNonconserved;
+ showSequenceLogo = seqsel.showSequenceLogo;
+ normaliseSequenceLogo = seqsel.normaliseSequenceLogo;
+ showConsensusHistogram = seqsel.showConsensusHistogram;
idColour = seqsel.idColour;
outlineColour = seqsel.outlineColour;
seqrep = seqsel.seqrep;
}
}
+ public boolean isShowSequenceLogo()
+ {
+ return showSequenceLogo;
+ }
+
public SequenceI[] getSelectionAsNewSequences(AlignmentI align)
{
int iSize = sequences.size();
}
/**
- * visibility of rows or represented rows covered by group
- */
- private boolean hidereps = false;
-
- /**
* set visibility of sequences covered by (if no sequence representative is
* defined) or represented by this group.
*
}
/**
- * visibility of columns intersecting this group
- */
- private boolean hidecols = false;
-
- /**
* set intended visibility of columns covered by this group
*
* @param visibility
this.showNonconserved = displayNonconserved;
}
- AlignmentAnnotation consensus = null, conservation = null;
-
- /**
- * flag indicating if consensus histogram should be rendered
- */
- private boolean showConsensusHistogram;
-
/**
* set this alignmentAnnotation object as the one used to render consensus
* annotation
}
}
- private AnnotatedCollectionI context;
-
/**
* Sets the alignment or group context for this group, and whether it is
* defined as a group
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertNotSame;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertSame;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
import jalview.schemes.NucleotideColourScheme;
+import jalview.schemes.PIDColourScheme;
-import org.testng.annotations.Test;
+import java.awt.Color;
import junit.extensions.PA;
+import org.testng.annotations.Test;
+
public class SequenceGroupTest
{
@Test(groups={"Functional"})
assertTrue(sg2.contains(seq2, 8));
sg2.deleteSequence(seq2, false);
assertFalse(sg2.contains(seq2));
+ }
+
+ @Test(groups = { "Functional" })
+ public void testCopyConstructor()
+ {
+ SequenceI seq = new Sequence("seq", "ABC");
+ SequenceGroup sg = new SequenceGroup();
+ sg.addSequence(seq, false);
+ sg.setName("g1");
+ sg.setDescription("desc");
+ sg.setColourScheme(new PIDColourScheme());
+ sg.setDisplayBoxes(false);
+ sg.setDisplayText(false);
+ sg.setColourText(true);
+ sg.isDefined = true;
+ sg.setShowNonconserved(true);
+ sg.setOutlineColour(Color.red);
+ sg.setIdColour(Color.blue);
+ sg.thresholdTextColour = 1;
+ sg.textColour = Color.orange;
+ sg.textColour2 = Color.yellow;
+ sg.setIgnoreGapsConsensus(false);
+ sg.setshowSequenceLogo(true);
+ sg.setNormaliseSequenceLogo(true);
+ sg.setHidereps(true);
+ sg.setHideCols(true);
+ sg.setShowConsensusHistogram(true);
+ sg.setContext(new SequenceGroup());
+
+ SequenceGroup sg2 = new SequenceGroup(sg);
+ assertEquals(sg2.getName(), sg.getName());
+ assertEquals(sg2.getDescription(), sg.getDescription());
+ assertNotSame(sg2.getGroupColourScheme(), sg.getGroupColourScheme());
+ assertSame(sg2.getColourScheme(), sg.getColourScheme());
+ assertEquals(sg2.getDisplayBoxes(), sg.getDisplayBoxes());
+ assertEquals(sg2.getDisplayText(), sg.getDisplayText());
+ assertEquals(sg2.getColourText(), sg.getColourText());
+ assertEquals(sg2.getShowNonconserved(), sg.getShowNonconserved());
+ assertEquals(sg2.getOutlineColour(), sg.getOutlineColour());
+ assertEquals(sg2.getIdColour(), sg.getIdColour());
+ assertEquals(sg2.thresholdTextColour, sg.thresholdTextColour);
+ assertEquals(sg2.textColour, sg.textColour);
+ assertEquals(sg2.textColour2, sg.textColour2);
+ assertEquals(sg2.getIgnoreGapsConsensus(), sg.getIgnoreGapsConsensus());
+ assertEquals(sg2.isShowSequenceLogo(), sg.isShowSequenceLogo());
+ assertEquals(sg2.isNormaliseSequenceLogo(),
+ sg.isNormaliseSequenceLogo());
+ assertEquals(sg2.isHidereps(), sg.isHidereps());
+ assertEquals(sg2.isHideCols(), sg.isHideCols());
+ assertEquals(sg2.isShowConsensusHistogram(),
+ sg.isShowConsensusHistogram());
+ /*
+ * copy of sequences
+ */
+ assertNotSame(sg2.getSequences(), sg.getSequences());
+ assertEquals(sg2.getSequences(), sg.getSequences());
+
+ /*
+ * isDefined should only be set true when a new group is added to
+ * an alignment, not in the copy constructor
+ */
+ assertFalse(sg2.isDefined());
+
+ /*
+ * context should be set explicitly, not by copy
+ */
+ assertNull(sg2.getContext());
}
}