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
b72f57c0
Commit
b72f57c0
authored
Mar 3, 2020
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
assembly symmetry tweaks
parent
8a7ef1c7
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/mol-model-props/rcsb/assembly-symmetry.ts
+6
-0
6 additions, 0 deletions
src/mol-model-props/rcsb/assembly-symmetry.ts
src/mol-model-props/rcsb/representations/assembly-symmetry.ts
+5
-11
5 additions, 11 deletions
...mol-model-props/rcsb/representations/assembly-symmetry.ts
with
11 additions
and
11 deletions
src/mol-model-props/rcsb/assembly-symmetry.ts
+
6
−
0
View file @
b72f57c0
...
@@ -15,6 +15,7 @@ import { CustomProperty } from '../common/custom-property';
...
@@ -15,6 +15,7 @@ import { CustomProperty } from '../common/custom-property';
import
{
NonNullableArray
}
from
'
../../mol-util/type-helpers
'
;
import
{
NonNullableArray
}
from
'
../../mol-util/type-helpers
'
;
import
{
CustomStructureProperty
}
from
'
../common/custom-structure-property
'
;
import
{
CustomStructureProperty
}
from
'
../common/custom-structure-property
'
;
import
{
MmcifFormat
}
from
'
../../mol-model-formats/structure/mmcif
'
;
import
{
MmcifFormat
}
from
'
../../mol-model-formats/structure/mmcif
'
;
import
{
ReadonlyVec3
}
from
'
../../mol-math/linear-algebra/3d/vec3
'
;
const
BiologicalAssemblyNames
=
new
Set
([
const
BiologicalAssemblyNames
=
new
Set
([
'
author_and_software_defined_assembly
'
,
'
author_and_software_defined_assembly
'
,
...
@@ -65,6 +66,11 @@ export namespace AssemblySymmetry {
...
@@ -65,6 +66,11 @@ export namespace AssemblySymmetry {
}
}
return
result
.
assembly
.
rcsb_struct_symmetry
as
AssemblySymmetryValue
return
result
.
assembly
.
rcsb_struct_symmetry
as
AssemblySymmetryValue
}
}
export
type
RotationAxes
=
ReadonlyArray
<
{
order
:
number
,
start
:
ReadonlyVec3
,
end
:
ReadonlyVec3
}
>
export
function
isRotationAxes
(
x
:
AssemblySymmetryValue
[
0
][
'
rotation_axes
'
]):
x
is
RotationAxes
{
return
!!
x
&&
x
.
length
>
0
}
}
}
export
function
getSymmetrySelectParam
(
structure
?:
Structure
)
{
export
function
getSymmetrySelectParam
(
structure
?:
Structure
)
{
...
...
This diff is collapsed.
Click to expand it.
src/mol-model-props/rcsb/representations/assembly-symmetry.ts
+
5
−
11
View file @
b72f57c0
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
*/
*/
import
{
ParamDefinition
as
PD
}
from
'
../../../mol-util/param-definition
'
;
import
{
ParamDefinition
as
PD
}
from
'
../../../mol-util/param-definition
'
;
import
{
AssemblySymmetryValue
,
getSymmetrySelectParam
,
AssemblySymmetryProvider
}
from
'
../assembly-symmetry
'
;
import
{
AssemblySymmetryValue
,
getSymmetrySelectParam
,
AssemblySymmetryProvider
,
AssemblySymmetry
}
from
'
../assembly-symmetry
'
;
import
{
MeshBuilder
}
from
'
../../../mol-geo/geometry/mesh/mesh-builder
'
;
import
{
MeshBuilder
}
from
'
../../../mol-geo/geometry/mesh/mesh-builder
'
;
import
{
Vec3
,
Mat4
}
from
'
../../../mol-math/linear-algebra
'
;
import
{
Vec3
,
Mat4
}
from
'
../../../mol-math/linear-algebra
'
;
import
{
addCylinder
}
from
'
../../../mol-geo/geometry/mesh/builder/cylinder
'
;
import
{
addCylinder
}
from
'
../../../mol-geo/geometry/mesh/builder/cylinder
'
;
...
@@ -29,7 +29,6 @@ import { TetrahedronCage } from '../../../mol-geo/primitive/tetrahedron';
...
@@ -29,7 +29,6 @@ import { TetrahedronCage } from '../../../mol-geo/primitive/tetrahedron';
import
{
IcosahedronCage
}
from
'
../../../mol-geo/primitive/icosahedron
'
;
import
{
IcosahedronCage
}
from
'
../../../mol-geo/primitive/icosahedron
'
;
import
{
degToRad
,
radToDeg
}
from
'
../../../mol-math/misc
'
;
import
{
degToRad
,
radToDeg
}
from
'
../../../mol-math/misc
'
;
import
{
Mutable
}
from
'
../../../mol-util/type-helpers
'
;
import
{
Mutable
}
from
'
../../../mol-util/type-helpers
'
;
import
{
ReadonlyVec3
}
from
'
../../../mol-math/linear-algebra/3d/vec3
'
;
import
{
equalEps
}
from
'
../../../mol-math/linear-algebra/3d/common
'
;
import
{
equalEps
}
from
'
../../../mol-math/linear-algebra/3d/common
'
;
import
{
Structure
}
from
'
../../../mol-model/structure
'
;
import
{
Structure
}
from
'
../../../mol-model/structure
'
;
import
{
isInteger
}
from
'
../../../mol-util/number
'
;
import
{
isInteger
}
from
'
../../../mol-util/number
'
;
...
@@ -87,11 +86,6 @@ export type AssemblySymmetryProps = PD.Values<AssemblySymmetryParams>
...
@@ -87,11 +86,6 @@ export type AssemblySymmetryProps = PD.Values<AssemblySymmetryParams>
//
//
type
RotationAxes
=
ReadonlyArray
<
{
order
:
number
,
start
:
ReadonlyVec3
,
end
:
ReadonlyVec3
}
>
function
isRotationAxes
(
x
:
AssemblySymmetryValue
[
0
][
'
rotation_axes
'
]):
x
is
RotationAxes
{
return
!!
x
&&
x
.
length
>
0
}
function
getAssemblyName
(
s
:
Structure
)
{
function
getAssemblyName
(
s
:
Structure
)
{
const
{
id
}
=
s
.
units
[
0
].
conformation
.
operator
.
assembly
const
{
id
}
=
s
.
units
[
0
].
conformation
.
operator
.
assembly
return
isInteger
(
id
)
?
`Assembly
${
id
}
`
:
id
return
isInteger
(
id
)
?
`Assembly
${
id
}
`
:
id
...
@@ -122,7 +116,7 @@ function getAxesMesh(data: AssemblySymmetryValue, props: PD.Values<AxesParams>,
...
@@ -122,7 +116,7 @@ function getAxesMesh(data: AssemblySymmetryValue, props: PD.Values<AxesParams>,
const
{
symmetryIndex
,
scale
}
=
props
const
{
symmetryIndex
,
scale
}
=
props
const
{
rotation_axes
}
=
data
[
symmetryIndex
]
const
{
rotation_axes
}
=
data
[
symmetryIndex
]
if
(
!
isRotationAxes
(
rotation_axes
))
return
Mesh
.
createEmpty
(
mesh
)
if
(
!
AssemblySymmetry
.
isRotationAxes
(
rotation_axes
))
return
Mesh
.
createEmpty
(
mesh
)
const
{
start
,
end
}
=
rotation_axes
[
0
]
const
{
start
,
end
}
=
rotation_axes
[
0
]
const
radius
=
(
Vec3
.
distance
(
start
,
end
)
/
500
)
*
scale
const
radius
=
(
Vec3
.
distance
(
start
,
end
)
/
500
)
*
scale
...
@@ -227,11 +221,11 @@ function getSymbolScale(symbol: string) {
...
@@ -227,11 +221,11 @@ function getSymbolScale(symbol: string) {
return
1
return
1
}
}
function
setSymbolTransform
(
t
:
Mat4
,
symbol
:
string
,
axes
:
RotationAxes
,
size
:
number
,
structure
:
Structure
)
{
function
setSymbolTransform
(
t
:
Mat4
,
symbol
:
string
,
axes
:
AssemblySymmetry
.
RotationAxes
,
size
:
number
,
structure
:
Structure
)
{
const
eye
=
Vec3
()
const
eye
=
Vec3
()
const
target
=
Vec3
()
const
target
=
Vec3
()
const
up
=
Vec3
()
const
up
=
Vec3
()
let
pair
:
Mutable
<
RotationAxes
>
|
undefined
=
undefined
let
pair
:
Mutable
<
AssemblySymmetry
.
RotationAxes
>
|
undefined
=
undefined
if
(
symbol
.
startsWith
(
'
C
'
))
{
if
(
symbol
.
startsWith
(
'
C
'
))
{
pair
=
[
axes
[
0
]]
pair
=
[
axes
[
0
]]
...
@@ -288,7 +282,7 @@ function getCageMesh(data: Structure, props: PD.Values<CageParams>, mesh?: Mesh)
...
@@ -288,7 +282,7 @@ function getCageMesh(data: Structure, props: PD.Values<CageParams>, mesh?: Mesh)
const
{
symmetryIndex
,
scale
}
=
props
const
{
symmetryIndex
,
scale
}
=
props
const
{
rotation_axes
,
symbol
}
=
assemblySymmetry
[
symmetryIndex
]
const
{
rotation_axes
,
symbol
}
=
assemblySymmetry
[
symmetryIndex
]
if
(
!
isRotationAxes
(
rotation_axes
))
return
Mesh
.
createEmpty
(
mesh
)
if
(
!
AssemblySymmetry
.
isRotationAxes
(
rotation_axes
))
return
Mesh
.
createEmpty
(
mesh
)
const
cage
=
getSymbolCage
(
symbol
)
const
cage
=
getSymbolCage
(
symbol
)
if
(
!
cage
)
return
Mesh
.
createEmpty
(
mesh
)
if
(
!
cage
)
return
Mesh
.
createEmpty
(
mesh
)
...
...
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