}
/**
- * This method returns the a new SequenceI [] with
- * the selection sequence and start and end points adjusted
+ * This method returns an array of new SequenceI objects
+ * derived from the whole alignment or just the current
+ * selection with start and end points adjusted
+ * @note if you need references to the actual SequenceI objects in the alignment or currently selected then use getSequenceSelection()
* @return String[]
*/
public SequenceI[] getSelectionAsNewSequence()
if (selectionGroup == null)
{
sequences = alignment.getSequencesArray();
+ for (int i=0; i<sequences.length; i++)
+ {
+ sequences[i] = new Sequence(sequences[i]); // construct new sequence
+ }
}
else
{
return sequences;
}
-
+ /**
+ * get the currently selected sequence objects or all the sequences in the alignment.
+ * @return array of references to sequence objects
+ */
+ public SequenceI[] getSequenceSelection()
+ {
+ SequenceI[] sequences;
+ if (selectionGroup==null)
+ {
+ sequences = alignment.getSequencesArray();
+ }
+ else
+ {
+ sequences = selectionGroup.getSequencesInOrder(alignment);
+ }
+ return sequences;
+ }
/**
* This method returns the visible alignment as text, as
* seen on the GUI, ie if columns are hidden they will not