features,
final boolean forwardStrand)
{
Collections.sort(features, forwardStrand ? FORWARD_STRAND
: REVERSE_STRAND);
}
/**
* {@inheritDoc} This method is 'semi-optimised': it only inspects features
* for types that include the specified group, but has to inspect every
* feature of those types for matching feature group. This is efficient unless
* a sequence has features that share the same type but are in different
* groups - an unlikely case.
*
* For example, if RESNUM feature is created with group = PDBID, then features
* would only be retrieved for those sequences associated with the target
* PDBID (group).
*/
@Override
public List getFeaturesForGroup(boolean positional,
String group, String... type)
{
List result = new ArrayList<>();
for (FeatureStore featureSet : varargToTypes(type))
{
if (featureSet.getFeatureGroups(positional).contains(group))
{
result.addAll(featureSet.getFeaturesForGroup(positional, group));
}
}
return result;
}
/**
* {@inheritDoc}
*/
@Override
public boolean shiftFeatures(int shift)
{
boolean modified = false;
for (FeatureStore fs : featureStore.values())
{
modified |= fs.shiftFeatures(shift);
}
return modified;
}
}