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
147fa955
Commit
147fa955
authored
6 years ago
by
David Sehnal
Browse files
Options
Downloads
Patches
Plain Diff
model-server: fixed AtomSiteSchema type
parent
e36d483f
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/servers/model/query/atoms.ts
+6
-6
6 additions, 6 deletions
src/servers/model/query/atoms.ts
src/servers/model/server/api.ts
+3
-1
3 additions, 1 deletion
src/servers/model/server/api.ts
with
9 additions
and
7 deletions
src/servers/model/query/atoms.ts
+
6
−
6
View file @
147fa955
...
...
@@ -6,7 +6,7 @@
import
{
QueryPredicate
,
StructureElement
,
StructureProperties
as
Props
}
from
'
mol-model/structure
'
;
import
{
AtomsQueryParams
}
from
'
mol-model/structure/query/queries/generators
'
;
import
{
AtomSiteSchema
}
from
'
../server/api
'
;
import
{
AtomSiteSchema
,
AtomSiteSchemaElement
}
from
'
../server/api
'
;
export
function
getAtomsTests
(
params
:
AtomSiteSchema
):
Partial
<
AtomsQueryParams
>
[]
{
if
(
!
params
)
return
[{
}];
...
...
@@ -17,7 +17,7 @@ export function getAtomsTests(params: AtomSiteSchema): Partial<AtomsQueryParams>
}
}
function
atomsTest
(
params
:
AtomSiteSchema
):
Partial
<
AtomsQueryParams
>
{
function
atomsTest
(
params
:
AtomSiteSchema
Element
):
Partial
<
AtomsQueryParams
>
{
return
{
entityTest
:
entityTest
(
params
),
chainTest
:
chainTest
(
params
),
...
...
@@ -26,13 +26,13 @@ function atomsTest(params: AtomSiteSchema): Partial<AtomsQueryParams> {
};
}
function
entityTest
(
params
:
AtomSiteSchema
):
QueryPredicate
|
undefined
{
function
entityTest
(
params
:
AtomSiteSchema
Element
):
QueryPredicate
|
undefined
{
if
(
!
params
||
typeof
params
.
label_entity_id
===
'
undefined
'
)
return
void
0
;
const
p
=
Props
.
entity
.
id
,
id
=
''
+
params
.
label_entity_id
;
return
ctx
=>
p
(
ctx
.
element
)
===
id
;
}
function
chainTest
(
params
:
AtomSiteSchema
):
QueryPredicate
|
undefined
{
function
chainTest
(
params
:
AtomSiteSchema
Element
):
QueryPredicate
|
undefined
{
if
(
!
params
)
return
void
0
;
if
(
typeof
params
.
label_asym_id
!==
'
undefined
'
)
{
...
...
@@ -46,7 +46,7 @@ function chainTest(params: AtomSiteSchema): QueryPredicate | undefined {
return
void
0
;
}
function
residueTest
(
params
:
AtomSiteSchema
):
QueryPredicate
|
undefined
{
function
residueTest
(
params
:
AtomSiteSchema
Element
):
QueryPredicate
|
undefined
{
if
(
!
params
)
return
void
0
;
const
props
:
StructureElement
.
Property
<
any
>
[]
=
[],
values
:
any
[]
=
[];
...
...
@@ -79,7 +79,7 @@ function residueTest(params: AtomSiteSchema): QueryPredicate | undefined {
return
andEqual
(
props
,
values
);
}
function
atomTest
(
params
:
AtomSiteSchema
):
QueryPredicate
|
undefined
{
function
atomTest
(
params
:
AtomSiteSchema
Element
):
QueryPredicate
|
undefined
{
if
(
!
params
)
return
void
0
;
const
props
:
StructureElement
.
Property
<
any
>
[]
=
[],
values
:
any
[]
=
[];
...
...
This diff is collapsed.
Click to expand it.
src/servers/model/server/api.ts
+
3
−
1
View file @
147fa955
...
...
@@ -35,7 +35,7 @@ export interface QueryDefinition<Params = any> {
'
@params
'
:
Params
}
export
interface
AtomSiteSchema
{
export
interface
AtomSiteSchema
Element
{
label_entity_id
?:
string
,
label_asym_id
?:
string
,
...
...
@@ -52,6 +52,8 @@ export interface AtomSiteSchema {
type_symbol
?:
string
}
export
type
AtomSiteSchema
=
AtomSiteSchemaElement
|
AtomSiteSchemaElement
[]
const
AtomSiteTestParams
:
QueryParamInfo
=
{
name
:
'
atom_site
'
,
type
:
QueryParamType
.
JSON
,
...
...
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