|
@@ -47,11 +47,11 @@ export function getStructureRefWithModelId(structures: StructureRef[], target: {
|
|
|
export function select(plugin: PluginContext, targets: SelectTarget | SelectTarget[], mode: 'select' | 'hover', modifier: 'add' | 'set') {
|
|
|
if (modifier === 'set')
|
|
|
clearSelection(plugin, mode);
|
|
|
- (Array.isArray(targets) ? targets : [targets]).forEach(target => {
|
|
|
- const data = getStructureWithModelId(plugin.managers.structure.hierarchy.current.structures, target);
|
|
|
- if (!data) return;
|
|
|
+ (Array.isArray(targets) ? targets : [targets]).forEach((target, n)=>{
|
|
|
+ const structure = getStructureWithModelId(plugin.managers.structure.hierarchy.current.structures, target);
|
|
|
+ if (!structure) return;
|
|
|
|
|
|
- const loci = targetToLoci(target, data);
|
|
|
+ const loci = targetToLoci(target, structure);
|
|
|
if (!loci) return;
|
|
|
|
|
|
if (mode === 'hover') {
|
|
@@ -87,7 +87,7 @@ export async function createComponent(plugin: PluginContext, componentLabel: str
|
|
|
|
|
|
const residues = toResidues(target);
|
|
|
const sel = StructureSelectionQuery('innerQuery_' + Math.random().toString(36).substring(2),
|
|
|
- MS.struct.generator.atomGroups(rangeToTest(target.labelAsymId, residues)));
|
|
|
+ MS.struct.generator.atomGroups(rangeToTest(target.labelAsymId, residues, target.operatorName)));
|
|
|
await plugin.managers.structure.component.add({
|
|
|
selection: sel,
|
|
|
options: { checkExisting: false, label: componentLabel },
|