AlignmentAnnotation[] alignAnnotList, String selectedSSSource)
{
- Map<SequenceI, ArrayList<AlignmentAnnotation>> ssAlignmentAnnotationForSequences
- = new HashMap<SequenceI, ArrayList<AlignmentAnnotation>>();
+ Map<SequenceI, ArrayList<AlignmentAnnotation>> ssAlignmentAnnotationForSequences = new HashMap<SequenceI, ArrayList<AlignmentAnnotation>>();
if (alignAnnotList == null || alignAnnotList.length == 0)
{
return ssAlignmentAnnotationForSequences;
{
continue;
}
-
- for (String label : Constants.SECONDARY_STRUCTURE_LABELS.keySet())
+
+ if (isSecondaryStructureFrom(selectedSSSource, aa))
{
+ ssAlignmentAnnotationForSequences
+ .computeIfAbsent(aa.sequenceRef.getDatasetSequence(),
+ k -> new ArrayList<>())
+ .add(aa);
+ }
+ }
- if (label.equals(aa.label))
- {
+ return ssAlignmentAnnotationForSequences;
- if (selectedSSSource.equals(MessageManager.getString("option.ss_providers_all")))
- {
- ssAlignmentAnnotationForSequences
- .computeIfAbsent(aa.sequenceRef.getDatasetSequence(),
- k -> new ArrayList<>())
- .add(aa);
- break;
- }
+ }
- String ssSource = AlignmentUtils
- .extractSSSourceFromAnnotationDescription(aa);
- if (ssSource != null && ssSource.equals(selectedSSSource))
- {
+ public static boolean isSecondaryStructureFrom(String selectedSSSource,
+ AlignmentAnnotation aa)
+ {
- ssAlignmentAnnotationForSequences
- .computeIfAbsent(aa.sequenceRef.getDatasetSequence(),
- k -> new ArrayList<>())
- .add(aa);
- break;
- }
+ for (String label : Constants.SECONDARY_STRUCTURE_LABELS.keySet())
+ {
+
+ if (label.equals(aa.label))
+ {
+
+ if (selectedSSSource.equals(
+ MessageManager.getString("option.ss_providers_all")))
+ {
+ return true;
+ }
+
+ String ssSource = AlignmentUtils
+ .extractSSSourceFromAnnotationDescription(aa);
+ if (ssSource != null && ssSource.equals(selectedSSSource))
+ {
+ return true;
}
}
}
-
- return ssAlignmentAnnotationForSequences;
-
+ return false;
}
-
}