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
7b55ef85
Commit
7b55ef85
authored
3 years ago
by
Michal Malý
Browse files
Options
Downloads
Patches
Plain Diff
DNATCO extension: Fix missing Confal pyramids in some structures
parent
23ec35d1
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/extensions/dnatco/confal-pyramids/property.ts
+1
-3
1 addition, 3 deletions
src/extensions/dnatco/confal-pyramids/property.ts
src/extensions/dnatco/confal-pyramids/util.ts
+19
-23
19 additions, 23 deletions
src/extensions/dnatco/confal-pyramids/util.ts
with
20 additions
and
26 deletions
src/extensions/dnatco/confal-pyramids/property.ts
+
1
−
3
View file @
7b55ef85
...
...
@@ -123,10 +123,8 @@ function createPyramidsFromCif(model: Model,
for
(
let
i
=
0
;
i
<
_rowCount
;
i
++
)
{
const
model_num
=
PDB_model_number
.
value
(
i
);
if
(
model_num
!==
model
.
modelNum
)
{
if
(
model_num
!==
model
.
modelNum
)
hasMultipleModels
=
true
;
continue
;
// We are only interested in data for the current model
}
const
{
_NtC
,
_confal_score
}
=
getNtCAndConfalScore
(
id
.
value
(
i
),
i
,
stepsSummary
);
...
...
This diff is collapsed.
Click to expand it.
src/extensions/dnatco/confal-pyramids/util.ts
+
19
−
23
View file @
7b55ef85
...
...
@@ -7,7 +7,7 @@
import
{
ConfalPyramidsProvider
}
from
'
./property
'
;
import
{
ConfalPyramidsTypes
as
CPT
}
from
'
./types
'
;
import
{
OrderedSet
,
Segmentation
}
from
'
../../../mol-data/int
'
;
import
{
Segmentation
}
from
'
../../../mol-data/int
'
;
import
{
Vec3
}
from
'
../../../mol-math/linear-algebra
'
;
import
{
ChainIndex
,
ElementIndex
,
ResidueIndex
,
Structure
,
StructureElement
,
StructureProperties
,
Unit
}
from
'
../../../mol-model/structure
'
;
...
...
@@ -63,15 +63,12 @@ export namespace ConfalPyramidsUtil {
return
prop
.
data
.
hasMultipleModels
;
}
function
getPossibleAltIdsIndices
(
eIFirst
:
ElementIndex
,
eILast
:
ElementIndex
,
structure
:
Structure
,
unit
:
Unit
.
Atomic
):
string
[]
{
const
loc
=
StructureElement
.
Location
.
create
(
structure
,
unit
,
-
1
as
ElementIndex
);
const
uIFirst
=
OrderedSet
.
indexOf
(
unit
.
elements
,
eIFirst
);
const
uILast
=
OrderedSet
.
indexOf
(
unit
.
elements
,
eILast
);
function
getPossibleAltIds
(
residue
:
Residue
,
structure
:
Structure
,
unit
:
Unit
.
Atomic
):
string
[]
{
const
possibleAltIds
:
string
[]
=
[];
for
(
let
uI
=
uIFirst
;
uI
<=
uILast
;
uI
++
)
{
loc
.
element
=
unit
.
elements
[
uI
];
const
loc
=
StructureElement
.
Location
.
create
(
structure
,
unit
,
-
1
as
ElementIndex
);
for
(
let
rI
=
residue
.
start
;
rI
<=
residue
.
end
-
1
;
rI
++
)
{
loc
.
element
=
unit
.
elements
[
rI
];
const
altId
=
StructureProperties
.
atom
.
label_alt_id
(
loc
);
if
(
altId
!==
''
&&
!
possibleAltIds
.
includes
(
altId
))
possibleAltIds
.
push
(
altId
);
}
...
...
@@ -79,10 +76,6 @@ export namespace ConfalPyramidsUtil {
return
possibleAltIds
;
}
function
getPossibleAltIdsResidue
(
residue
:
Residue
,
structure
:
Structure
,
unit
:
Unit
.
Atomic
):
string
[]
{
return
getPossibleAltIdsIndices
(
unit
.
elements
[
residue
.
start
],
unit
.
elements
[
residue
.
end
-
1
],
structure
,
unit
);
}
class
Utility
{
protected
getPyramidByName
(
name
:
string
):
{
pyramid
:
CPT
.
Pyramid
|
undefined
,
index
:
number
}
{
const
index
=
this
.
data
.
names
.
get
(
name
);
...
...
@@ -122,19 +115,22 @@ export namespace ConfalPyramidsUtil {
export
class
UnitWalker
extends
Utility
{
private
getAtomIndices
(
names
:
string
[],
residue
:
Residue
):
ElementIndex
[]
{
let
rI
=
residue
.
start
;
const
rILast
=
residue
.
end
-
1
;
const
indices
:
ElementIndex
[]
=
[];
for
(;
rI
!==
rILast
;
rI
++
)
{
const
e
I
=
this
.
unit
.
elements
[
rI
];
const
loc
=
StructureElement
.
Location
.
create
(
this
.
structure
,
this
.
unit
,
eI
)
;
const
loc
=
StructureElement
.
Location
.
create
(
this
.
structure
,
this
.
unit
,
-
1
as
ElementIndex
);
for
(
let
rI
=
residue
.
start
;
r
I
<
=
residue
.
end
-
1
;
rI
++
)
{
loc
.
element
=
this
.
unit
.
elements
[
rI
]
;
const
thisName
=
StructureProperties
.
atom
.
label_atom_id
(
loc
);
if
(
names
.
includes
(
thisName
))
indices
.
push
(
eI
);
if
(
names
.
includes
(
thisName
))
indices
.
push
(
loc
.
element
);
}
if
(
indices
.
length
===
0
)
throw
new
Error
(
`Element
${
name
}
not found on residue
${
residue
.
index
}
`
);
if
(
indices
.
length
===
0
)
{
let
namesStr
=
''
;
for
(
const
n
of
names
)
namesStr
+=
`
${
n
}
`
;
throw
new
Error
(
`Element [
${
namesStr
}
] not found on residue
${
residue
.
index
}
`
);
}
return
indices
;
}
...
...
@@ -257,12 +253,12 @@ export namespace ConfalPyramidsUtil {
}
private
step
(
residue
:
Residue
):
{
firstAtoms
:
FirstResidueAtoms
[],
secondAtoms
:
SecondResidueAtoms
[]
}
{
const
firstPossibleAltIds
=
getPossibleAltIds
Residue
(
residue
,
this
.
structure
,
this
.
unit
);
const
firstPossibleAltIds
=
getPossibleAltIds
(
residue
,
this
.
structure
,
this
.
unit
);
const
firstAtoms
=
this
.
processFirstResidue
(
residue
,
firstPossibleAltIds
);
residue
=
this
.
residueIt
.
move
();
const
secondPossibleAltIds
=
getPossibleAltIds
Residue
(
residue
,
this
.
structure
,
this
.
unit
);
const
secondPossibleAltIds
=
getPossibleAltIds
(
residue
,
this
.
structure
,
this
.
unit
);
const
secondAtoms
=
this
.
processSecondResidue
(
residue
,
secondPossibleAltIds
);
return
{
firstAtoms
,
secondAtoms
};
...
...
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