import jalview.api.structures.JalviewStructureDisplayI;
import jalview.bin.Console;
import jalview.datamodel.AlignmentI;
+import jalview.datamodel.ColumnSelection;
import jalview.datamodel.HiddenColumns;
import jalview.datamodel.MappedFeatures;
import jalview.datamodel.PDBEntry;
{
AlignmentI alignment = view.getAlignment();
HiddenColumns hiddenCols = alignment.getHiddenColumns();
-
/*
* 'matched' bit i will be set for visible alignment columns i where
* all sequences have a residue with a mapping to their PDB structure
*/
- BitSet matched = new BitSet();
final int width = alignment.getWidth();
- for (int m = 0; m < width; m++)
+ BitSet matched = new BitSet();
+ ColumnSelection cs = view.getAlignViewport().getColumnSelection();
+ // restrict to active column selection, if there is one
+ if (cs != null && cs.hasSelectedColumns()
+ && cs.getSelected().size() >= 4)
{
- if (hiddenCols == null || hiddenCols.isVisible(m))
+ for (int s : cs.getSelected())
{
- matched.set(m);
+ if (hiddenCols == null)
+ {
+ matched.set(s);
+ }
+ else
+ {
+ matched.set(hiddenCols.visibleToAbsoluteColumn(s));
+ }
+ }
+ }
+ else
+ {
+ for (int m = 0; m < width; m++)
+ {
+ if (hiddenCols == null || hiddenCols.isVisible(m))
+ {
+ matched.set(m);
+ }
}
}
-
AAStructureBindingModel.SuperposeData[] structures = new AAStructureBindingModel.SuperposeData[files.length];
for (int f = 0; f < files.length; f++)
{
AtomSpecType backbone = structures[refStructure].isRna
? AtomSpecType.PHOSPHATE
: AtomSpecType.ALPHA;
+ List<AtomSpecModel> models = new ArrayList<AtomSpecModel>();
+ models.add(refAtoms);
/*
* superpose each (other) structure to the reference in turn
*/
error += "; " + reply;
}
}
+ models.add(atomSpec);
}
}
+ List<StructureCommandI> finalView = commandGenerator
+ .centerViewOn(models);
+ executeCommands(finalView, false, "Centered on Superposition");
}
-
return error;
}