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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
1edc1e41
Commit
1edc1e41
authored
6 years ago
by
David Sehnal
Browse files
Options
Downloads
Patches
Plain Diff
Fixed inter-unit links computation
parent
2aa9f047
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/mol-model/structure/structure/unit/links/inter-compute.ts
+22
-8
22 additions, 8 deletions
...mol-model/structure/structure/unit/links/inter-compute.ts
src/mol-view/stage.ts
+2
-1
2 additions, 1 deletion
src/mol-view/stage.ts
with
24 additions
and
9 deletions
src/mol-model/structure/structure/unit/links/inter-compute.ts
+
22
−
8
View file @
1edc1e41
...
@@ -12,6 +12,7 @@ import { getElementIdx, getElementPairThreshold, getElementThreshold, isHydrogen
...
@@ -12,6 +12,7 @@ import { getElementIdx, getElementPairThreshold, getElementThreshold, isHydrogen
import
{
InterUnitBonds
}
from
'
./data
'
;
import
{
InterUnitBonds
}
from
'
./data
'
;
import
{
UniqueArray
}
from
'
mol-data/generic
'
;
import
{
UniqueArray
}
from
'
mol-data/generic
'
;
import
{
SortedArray
}
from
'
mol-data/int
'
;
import
{
SortedArray
}
from
'
mol-data/int
'
;
import
{
Vec3
,
Mat4
}
from
'
mol-math/linear-algebra
'
;
const
MAX_RADIUS
=
4
;
const
MAX_RADIUS
=
4
;
...
@@ -34,11 +35,14 @@ function addLink(indexA: number, indexB: number, order: number, flag: LinkType.F
...
@@ -34,11 +35,14 @@ function addLink(indexA: number, indexB: number, order: number, flag: LinkType.F
UniqueArray
.
add
(
state
.
bondedB
,
indexB
,
indexB
);
UniqueArray
.
add
(
state
.
bondedB
,
indexB
,
indexB
);
}
}
const
_imageTransform
=
Mat4
.
zero
();
function
findPairLinks
(
unitA
:
Unit
.
Atomic
,
unitB
:
Unit
.
Atomic
,
params
:
LinkComputationParameters
,
map
:
Map
<
number
,
InterUnitBonds
.
UnitPairBonds
[]
>
)
{
function
findPairLinks
(
unitA
:
Unit
.
Atomic
,
unitB
:
Unit
.
Atomic
,
params
:
LinkComputationParameters
,
map
:
Map
<
number
,
InterUnitBonds
.
UnitPairBonds
[]
>
)
{
const
state
:
PairState
=
{
mapAB
:
new
Map
(),
mapBA
:
new
Map
(),
bondedA
:
UniqueArray
.
create
(),
bondedB
:
UniqueArray
.
create
()
};
const
state
:
PairState
=
{
mapAB
:
new
Map
(),
mapBA
:
new
Map
(),
bondedA
:
UniqueArray
.
create
(),
bondedB
:
UniqueArray
.
create
()
};
let
bondCount
=
0
;
let
bondCount
=
0
;
const
{
elements
:
atomsA
,
conformation
:
{
x
,
y
,
z
}
}
=
unitA
;
const
{
elements
:
atomsA
}
=
unitA
;
const
{
x
:
xA
,
y
:
yA
,
z
:
zA
}
=
unitA
.
model
.
atomicConformation
;
const
{
elements
:
atomsB
}
=
unitB
;
const
{
elements
:
atomsB
}
=
unitB
;
const
atomCount
=
unitA
.
elements
.
length
;
const
atomCount
=
unitA
.
elements
.
length
;
...
@@ -47,17 +51,15 @@ function findPairLinks(unitA: Unit.Atomic, unitB: Unit.Atomic, params: LinkCompu
...
@@ -47,17 +51,15 @@ function findPairLinks(unitA: Unit.Atomic, unitB: Unit.Atomic, params: LinkCompu
const
{
lookup3d
}
=
unitB
;
const
{
lookup3d
}
=
unitB
;
const
structConn
=
unitA
.
model
===
unitB
.
model
&&
unitA
.
model
.
sourceData
.
kind
===
'
mmCIF
'
?
StructConn
.
fromModel
(
unitA
.
model
)
:
void
0
;
const
structConn
=
unitA
.
model
===
unitB
.
model
&&
unitA
.
model
.
sourceData
.
kind
===
'
mmCIF
'
?
StructConn
.
fromModel
(
unitA
.
model
)
:
void
0
;
// the lookup queries need to happen in the "unitB space".
// that means imageA = inverseOperB(operA(aI))
const
imageTransform
=
Mat4
.
mul
(
_imageTransform
,
unitB
.
conformation
.
operator
.
inverse
,
unitA
.
conformation
.
operator
.
matrix
);
const
imageA
=
Vec3
.
zero
();
for
(
let
_aI
=
0
;
_aI
<
atomCount
;
_aI
++
)
{
for
(
let
_aI
=
0
;
_aI
<
atomCount
;
_aI
++
)
{
const
aI
=
atomsA
[
_aI
];
const
aI
=
atomsA
[
_aI
];
const
aeI
=
getElementIdx
(
type_symbolA
.
value
(
aI
));
const
{
indices
,
count
,
squaredDistances
}
=
lookup3d
.
find
(
x
(
aI
),
y
(
aI
),
z
(
aI
),
MAX_RADIUS
);
const
isHa
=
isHydrogen
(
aeI
);
const
thresholdA
=
getElementThreshold
(
aeI
);
const
altA
=
label_alt_idA
.
value
(
aI
);
const
metalA
=
MetalsSet
.
has
(
aeI
);
const
structConnEntries
=
params
.
forceCompute
?
void
0
:
structConn
&&
structConn
.
getAtomEntries
(
aI
);
const
structConnEntries
=
params
.
forceCompute
?
void
0
:
structConn
&&
structConn
.
getAtomEntries
(
aI
);
if
(
structConnEntries
)
{
if
(
structConnEntries
)
{
for
(
const
se
of
structConnEntries
)
{
for
(
const
se
of
structConnEntries
)
{
if
(
se
.
distance
<
MAX_RADIUS
)
continue
;
if
(
se
.
distance
<
MAX_RADIUS
)
continue
;
...
@@ -71,6 +73,18 @@ function findPairLinks(unitA: Unit.Atomic, unitB: Unit.Atomic, params: LinkCompu
...
@@ -71,6 +73,18 @@ function findPairLinks(unitA: Unit.Atomic, unitB: Unit.Atomic, params: LinkCompu
}
}
}
}
const
aeI
=
getElementIdx
(
type_symbolA
.
value
(
aI
));
Vec3
.
set
(
imageA
,
xA
[
aI
],
yA
[
aI
],
zA
[
aI
]);
Vec3
.
transformMat4
(
imageA
,
imageA
,
imageTransform
);
const
{
indices
,
count
,
squaredDistances
}
=
lookup3d
.
find
(
imageA
[
0
],
imageA
[
1
],
imageA
[
2
],
MAX_RADIUS
);
if
(
count
===
0
)
continue
;
const
isHa
=
isHydrogen
(
aeI
);
const
thresholdA
=
getElementThreshold
(
aeI
);
const
altA
=
label_alt_idA
.
value
(
aI
);
const
metalA
=
MetalsSet
.
has
(
aeI
);
for
(
let
ni
=
0
;
ni
<
count
;
ni
++
)
{
for
(
let
ni
=
0
;
ni
<
count
;
ni
++
)
{
const
_bI
=
indices
[
ni
];
const
_bI
=
indices
[
ni
];
const
bI
=
atomsB
[
_bI
];
const
bI
=
atomsB
[
_bI
];
...
...
This diff is collapsed.
Click to expand it.
src/mol-view/stage.ts
+
2
−
1
View file @
1edc1e41
...
@@ -70,7 +70,8 @@ export class Stage {
...
@@ -70,7 +70,8 @@ export class Stage {
// this.loadPdbid('1jj2')
// this.loadPdbid('1jj2')
// this.loadPdbid('4umt') // ligand has bond with order 3
// this.loadPdbid('4umt') // ligand has bond with order 3
this
.
loadPdbid
(
'
1crn
'
)
// small
// this.loadPdbid('1crn') // small
this
.
loadPdbid
(
'
1hrv
'
)
// viral assembly
// this.loadPdbid('1rb8') // virus TODO funky inter unit bonds rendering
// this.loadPdbid('1rb8') // virus TODO funky inter unit bonds rendering
// this.loadPdbid('1blu') // metal coordination
// this.loadPdbid('1blu') // metal coordination
// this.loadPdbid('3pqr') // inter unit bonds
// this.loadPdbid('3pqr') // inter unit bonds
...
...
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