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
27ee5763
Commit
27ee5763
authored
Apr 18, 2020
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
improved .hasDensityMap and .isFromPdbArchive helpers
parent
58492328
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mol-model/structure/model/model.ts
+27
-11
27 additions, 11 deletions
src/mol-model/structure/model/model.ts
with
27 additions
and
11 deletions
src/mol-model/structure/model/model.ts
+
27
−
11
View file @
27ee5763
...
...
@@ -143,16 +143,19 @@ export namespace Model {
//
export
function
isFromPdbArchive
(
model
:
Model
)
{
export
function
isFromPdbArchive
(
model
:
Model
)
:
boolean
{
if
(
!
MmcifFormat
.
is
(
model
.
sourceData
))
return
false
;
const
{
db
}
=
model
.
sourceData
.
data
;
return
(
db
.
database_2
.
database_id
.
isDefined
||
model
.
entryId
.
length
===
4
// 4 character PDB id
model
.
entryId
.
match
(
/^
[
1-9
][
a-z0-9
]{3,3}
$/i
)
!==
null
||
// long PDB id
model
.
entryId
.
match
(
/^pdb_
[
0-9
]{4,4}[
1-9
][
a-z0-9
]{3,3}
$/i
)
!==
null
);
}
export
function
hasSecondaryStructure
(
model
:
Model
)
{
export
function
hasSecondaryStructure
(
model
:
Model
)
:
boolean
{
if
(
!
MmcifFormat
.
is
(
model
.
sourceData
))
return
false
;
const
{
db
}
=
model
.
sourceData
.
data
;
return
(
...
...
@@ -163,7 +166,7 @@ export namespace Model {
const
tmpAngles90
=
Vec3
.
create
(
1.5707963
,
1.5707963
,
1.5707963
);
// in radians
const
tmpLengths1
=
Vec3
.
create
(
1
,
1
,
1
);
export
function
hasCrystalSymmetry
(
model
:
Model
)
{
export
function
hasCrystalSymmetry
(
model
:
Model
)
:
boolean
{
const
spacegroup
=
ModelSymmetry
.
Provider
.
get
(
model
)?.
spacegroup
;
return
!!
spacegroup
&&
!
(
spacegroup
.
num
===
1
&&
...
...
@@ -172,7 +175,7 @@ export namespace Model {
);
}
export
function
isFromXray
(
model
:
Model
)
{
export
function
isFromXray
(
model
:
Model
)
:
boolean
{
if
(
!
MmcifFormat
.
is
(
model
.
sourceData
))
return
false
;
const
{
db
}
=
model
.
sourceData
.
data
;
for
(
let
i
=
0
;
i
<
db
.
exptl
.
method
.
rowCount
;
i
++
)
{
...
...
@@ -182,7 +185,7 @@ export namespace Model {
return
false
;
}
export
function
isFromEm
(
model
:
Model
)
{
export
function
isFromEm
(
model
:
Model
)
:
boolean
{
if
(
!
MmcifFormat
.
is
(
model
.
sourceData
))
return
false
;
const
{
db
}
=
model
.
sourceData
.
data
;
for
(
let
i
=
0
;
i
<
db
.
exptl
.
method
.
rowCount
;
i
++
)
{
...
...
@@ -192,7 +195,7 @@ export namespace Model {
return
false
;
}
export
function
isFromNmr
(
model
:
Model
)
{
export
function
isFromNmr
(
model
:
Model
)
:
boolean
{
if
(
!
MmcifFormat
.
is
(
model
.
sourceData
))
return
false
;
const
{
db
}
=
model
.
sourceData
.
data
;
for
(
let
i
=
0
;
i
<
db
.
exptl
.
method
.
rowCount
;
i
++
)
{
...
...
@@ -202,7 +205,7 @@ export namespace Model {
return
false
;
}
export
function
hasXrayMap
(
model
:
Model
)
{
export
function
hasXrayMap
(
model
:
Model
)
:
boolean
{
if
(
!
MmcifFormat
.
is
(
model
.
sourceData
))
return
false
;
// Check exprimental method to exclude models solved with
// 'ELECTRON CRYSTALLOGRAPHY' which also have structure factors
...
...
@@ -217,7 +220,7 @@ export namespace Model {
* like 6TEK which are solved with 'X-RAY DIFFRACTION' but have an related
* EMDB entry of type 'other EM volume'.
*/
export
function
hasEmMap
(
model
:
Model
)
{
export
function
hasEmMap
(
model
:
Model
)
:
boolean
{
if
(
!
MmcifFormat
.
is
(
model
.
sourceData
))
return
false
;
const
{
db
}
=
model
.
sourceData
.
data
;
const
{
db_name
,
content_type
}
=
db
.
pdbx_database_related
;
...
...
@@ -229,7 +232,20 @@ export namespace Model {
return
false
;
}
export
function
hasDensityMap
(
model
:
Model
)
{
return
hasXrayMap
(
model
)
||
hasEmMap
(
model
);
export
function
hasDensityMap
(
model
:
Model
):
boolean
{
if
(
!
MmcifFormat
.
is
(
model
.
sourceData
))
return
false
;
const
{
db
}
=
model
.
sourceData
.
data
;
return
(
hasXrayMap
(
model
)
||
hasEmMap
(
model
)
||
(
// check if from pdb archive but missing relevant meta data
isFromPdbArchive
(
model
)
&&
!
db
.
pdbx_database_related
.
db_name
.
isDefined
&&
!
db
.
pdbx_database_status
.
status_code_sf
.
isDefined
&&
(
!
db
.
exptl
.
method
.
isDefined
||
isFromXray
(
model
)
||
isFromEm
(
model
)
)
)
);
}
}
\ No newline at end of file
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
sign in
to comment