package jalview.analysis;
import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.HiddenColumns;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
* @param sequences
* @param columnSelection
* @param list
+ * @param hiddenColumns
* @return
*/
public static SequenceGroup[] makeGroupsFromCols(SequenceI[] sequences,
- ColumnSelection cs, List<SequenceGroup> list)
+ ColumnSelection cs, List<SequenceGroup> list,
+ HiddenColumns hiddenColumns)
{
// TODO: determine how to get/recover input data for group generation
Map<String, List<SequenceI>> gps = new HashMap<String, List<SequenceI>>();
int i = 0;
for (Integer pos : cs.getSelected())
{
- spos[i++] = pos.intValue();
+ if (hiddenColumns == null || hiddenColumns.isVisible(pos.intValue()))
+ {
+ spos[i++] = pos.intValue();
+ }
}
-
+ if (i < spos.length)
+ {
+ // mark end of visible column position
+ spos[i] = -1;
+ }
+ // actual number of visible columns
for (i = 0; i < sequences.length; i++)
{
int slen = sequences[i].getLength();
}
for (int p : spos)
{
+ if (p < 0)
+ {
+ break;
+ }
if (p >= slen)
{
schar.append("~");
gps = jalview.analysis.Grouping.makeGroupsFromCols(
(sg == null) ? viewport.getAlignment().getSequencesArray()
: sg.getSequences().toArray(new SequenceI[0]),
- cs, viewport.getAlignment().getGroups());
+ cs, viewport.getAlignment().getGroups(),
+ viewport.getAlignment().getHiddenColumns());
}
}
if (gps != null)