- List<Integer> positions = attsMap.get(val).get(seq);
- Collections.sort(positions);
- // TODO find reusable code that compacts the list
- List<int[]> ranges = null;// compacted list
- for (int[] range : ranges)
- {
- float score = Float.NaN;
- try
- {
- score = Float.valueOf(val);
- } catch (NumberFormatException e)
- {
- // was not a float value
- }
- String featureGroup = getViewerFeatureGroup();
- SequenceFeature sf = new SequenceFeature(attName, val, range[0],
- range[1], score, featureGroup);
- // note: repeating the action shouldn't duplicate features
- seq.addSequenceFeature(sf);
- }
+ spec = AtomSpec.fromChimeraAtomspec(atomSpec);
+ } catch (IllegalArgumentException e)
+ {
+ System.err.println("Problem parsing atomspec " + atomSpec);
+ continue;
+ }
+
+ String chainId = spec.getChain();
+ String description = attValue;
+ float score = Float.NaN;
+ try
+ {
+ score = Float.valueOf(attValue);
+ description = chainId;
+ } catch (NumberFormatException e)
+ {
+ // was not a float value
+ }
+
+ String pdbFile = getPdbFileForModel(spec.getModelNumber());
+ spec.setPdbFile(pdbFile);
+
+ List<AtomSpec> atoms = Collections.singletonList(spec);
+
+ /*
+ * locate the mapped position in the alignment (if any)
+ */
+ SearchResultsI sr = getSsm()
+ .findAlignmentPositionsForStructurePositions(atoms);
+
+ /*
+ * expect one matched alignment position, or none
+ * (if the structure position is not mapped)
+ */
+ for (SearchResultMatchI m : sr.getResults())
+ {
+ SequenceI seq = m.getSequence();
+ int start = m.getStart();
+ int end = m.getEnd();
+ SequenceFeature sf = new SequenceFeature(attName, description,
+ start, end, score, featureGroup);
+ // todo: should SequenceFeature have an explicit property for chain?
+ // note: repeating the action shouldn't duplicate features
+ featureAdded |= seq.addSequenceFeature(sf);