Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
00f9dcee
Commit
00f9dcee
authored
Oct 7, 2019
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
added StructureSymmetryMatesFromModel transform, fixes for findMatesRadius
parent
505af2bc
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/mol-model/structure/structure/symmetry.ts
+13
-3
13 additions, 3 deletions
src/mol-model/structure/structure/symmetry.ts
src/mol-plugin/index.ts
+1
-0
1 addition, 0 deletions
src/mol-plugin/index.ts
src/mol-plugin/state/transforms/model.ts
+26
-0
26 additions, 0 deletions
src/mol-plugin/state/transforms/model.ts
with
40 additions
and
3 deletions
src/mol-model/structure/structure/symmetry.ts
+
13
−
3
View file @
00f9dcee
...
...
@@ -191,7 +191,13 @@ async function findMatesRadius(ctx: RuntimeContext, structure: Structure, radius
const
operators
=
getOperatorsCached333
(
symmetry
,
modelCenter
);
const
lookup
=
structure
.
lookup3d
;
const
assembler
=
Structure
.
Builder
();
// keep track of added invariant-unit and operator combinations
const
added
=
new
Set
<
string
>
()
function
hash
(
unit
:
Unit
,
oper
:
SymmetryOperator
)
{
return
`
${
unit
.
invariantId
}
|
${
oper
.
name
}
`
}
const
assembler
=
Structure
.
Builder
({
label
:
structure
.
label
});
const
{
units
}
=
structure
;
const
center
=
Vec3
.
zero
();
...
...
@@ -204,13 +210,17 @@ async function findMatesRadius(ctx: RuntimeContext, structure: Structure, radius
for
(
let
uI
=
0
,
_uI
=
closeUnits
.
count
;
uI
<
_uI
;
uI
++
)
{
const
closeUnit
=
units
[
closeUnits
.
indices
[
uI
]];
if
(
!
closeUnit
.
lookup3d
.
check
(
center
[
0
],
center
[
1
],
center
[
2
],
boundingSphere
.
radius
+
radius
))
continue
;
const
h
=
hash
(
unit
,
oper
)
if
(
!
added
.
has
(
h
))
{
assembler
.
addWithOperator
(
unit
,
oper
);
added
.
add
(
h
)
}
}
}
if
(
ctx
.
shouldUpdate
)
await
ctx
.
update
(
'
Building symmetry...
'
);
}
return
assembler
.
getStructure
();
}
...
...
This diff is collapsed.
Click to expand it.
src/mol-plugin/index.ts
+
1
−
0
View file @
00f9dcee
...
...
@@ -42,6 +42,7 @@ export const DefaultPluginSpec: PluginSpec = {
PluginSpec
.
Action
(
StateTransforms
.
Model
.
TrajectoryFromPDB
),
PluginSpec
.
Action
(
StateTransforms
.
Model
.
StructureAssemblyFromModel
),
PluginSpec
.
Action
(
StateTransforms
.
Model
.
StructureSymmetryFromModel
),
PluginSpec
.
Action
(
StateTransforms
.
Model
.
StructureSymmetryMatesFromModel
),
PluginSpec
.
Action
(
TransformStructureConformation
),
PluginSpec
.
Action
(
StateTransforms
.
Model
.
StructureFromModel
),
PluginSpec
.
Action
(
StateTransforms
.
Model
.
StructureFromTrajectory
),
...
...
This diff is collapsed.
Click to expand it.
src/mol-plugin/state/transforms/model.ts
+
26
−
0
View file @
00f9dcee
...
...
@@ -40,6 +40,7 @@ export { StructureFromTrajectory };
export
{
StructureFromModel
};
export
{
StructureAssemblyFromModel
};
export
{
StructureSymmetryFromModel
};
export
{
StructureSymmetryMatesFromModel
};
export
{
TransformStructureConformation
};
export
{
TransformStructureConformationByMatrix
};
export
{
StructureSelectionFromExpression
};
...
...
@@ -301,6 +302,31 @@ const StructureSymmetryFromModel = PluginStateTransform.BuiltIn({
}
});
type
StructureSymmetryMatesFromModel
=
typeof
StructureSymmetryMatesFromModel
const
StructureSymmetryMatesFromModel
=
PluginStateTransform
.
BuiltIn
({
name
:
'
structure-symmetry-mates-from-model
'
,
display
:
{
name
:
'
Structure Symmetry Mates
'
,
description
:
'
Create molecular structure symmetry mates.
'
},
from
:
SO
.
Molecule
.
Model
,
to
:
SO
.
Molecule
.
Structure
,
params
(
a
)
{
return
{
radius
:
PD
.
Numeric
(
5
),
}
}
})({
apply
({
a
,
params
},
plugin
:
PluginContext
)
{
return
Task
.
create
(
'
Build Symmetry Mates
'
,
async
ctx
=>
{
const
{
radius
}
=
params
const
model
=
a
.
data
;
const
base
=
Structure
.
ofModel
(
model
);
const
s
=
await
StructureSymmetry
.
builderSymmetryMates
(
base
,
radius
).
runInContext
(
ctx
);
await
ensureSecondaryStructure
(
s
)
const
props
=
{
label
:
`Symmetry Mates`
,
description
:
structureDesc
(
s
)
};
return
new
SO
.
Molecule
.
Structure
(
s
,
props
);
})
}
});
const
_translation
=
Vec3
.
zero
(),
_m
=
Mat4
.
zero
(),
_n
=
Mat4
.
zero
();
type
TransformStructureConformation
=
typeof
TransformStructureConformation
const
TransformStructureConformation
=
PluginStateTransform
.
BuiltIn
({
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment