se[1])
se[1] = p;
}
}
if (se != null)
{
gl.add(se);
}
}
}
// are there any more sequences ungrouped that should be added as a single
// remaining group ? - these might be at the start or the end
if (gl.size() > 0)
{
if (lowest-1>minsize)
{
gl.add(0, new int[]
{ 0, lowest-2});
}
if ((al.getHeight()-1-highest)>minsize)
{
gl.add(new int[] { highest+1, al.getHeight()-1});
}
}
else
{
gl.add(new int[]
{ 0, al.getHeight() - 1 });
}
if (min >= 0 && gl.size() < min)
{
throw new NoValidInputDataException(
"Not enough sequence groups for input. Need at least " + min
+ " groups (including ungrouped regions).");
}
if (max > 0 && gl.size() > max)
{
throw new NoValidInputDataException(
"Too many sequence groups for input. Need at most " + max
+ " groups (including ungrouped regions).");
}
int[][] vals = gl.toArray(new int[gl.size()][]);
int[] srt = new int[gl.size()];
for (int i = 0; i < vals.length; i++)
srt[i] = vals[i][0];
jalview.util.QuickSort.sort(srt, vals);
list = false;
int last = vals[0][0] - 1;
for (int[] range : vals)
{
if (range[1] > last)
{
if (list)
{
idvector.append(sep);
}
idvector.append(range[1] - last);
last = range[1];
list = true;
}
}
return new StringBody(idvector.toString());
}
/**
* set minimum number of sequences allowed in a partition. Default is 1
* sequence.
*
* @param i
* (number greater than 1)
*/
public void setMinsize(int i)
{
if (minsize >= 1)
{
minsize = i;
}
else
{
minsize = 1;
}
}
@Override
public List