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
bf904a5b
Commit
bf904a5b
authored
5 years ago
by
JonStargaryen
Browse files
Options
Downloads
Patches
Plain Diff
OPM stub
parent
1ff83d96
No related branches found
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-props/computed/membrane.ts
+27
-9
27 additions, 9 deletions
src/mol-model-props/computed/membrane.ts
with
27 additions
and
9 deletions
src/mol-model-props/computed/membrane.ts
+
27
−
9
View file @
bf904a5b
...
@@ -10,12 +10,20 @@ import { Structure } from '../../mol-model/structure';
...
@@ -10,12 +10,20 @@ import { Structure } from '../../mol-model/structure';
import
{
CustomStructureProperty
}
from
'
../common/custom-structure-property
'
;
import
{
CustomStructureProperty
}
from
'
../common/custom-structure-property
'
;
import
{
CustomProperty
}
from
'
../common/custom-property
'
;
import
{
CustomProperty
}
from
'
../common/custom-property
'
;
import
{
CustomPropertyDescriptor
}
from
'
../../mol-model/custom-property
'
;
import
{
CustomPropertyDescriptor
}
from
'
../../mol-model/custom-property
'
;
import
{
ANVILParams
,
Membrane
}
from
'
./membrane/ANVIL
'
;
import
{
ANVILParams
,
Membrane
,
ANVILProps
}
from
'
./membrane/ANVIL
'
;
import
{
AccessibleSurfaceAreaProvider
}
from
'
./accessible-surface-area
'
;
import
{
AccessibleSurfaceAreaProvider
}
from
'
./accessible-surface-area
'
;
export
const
MembraneParams
=
{
function
getMembraneParams
(
data
?:
Structure
)
{
...
ANVILParams
let
defaultType
=
'
anvil
'
as
'
anvil
'
|
'
opm
'
;
// TODO flip - OPM should be default if PDB identifier is known
return
{
type
:
PD
.
MappedStatic
(
defaultType
,
{
'
opm
'
:
PD
.
EmptyGroup
({
label
:
'
OPM
'
}),
'
anvil
'
:
PD
.
Group
(
ANVILParams
,
{
label
:
'
ANVIL
'
})
},
{
options
:
[[
'
opm
'
,
'
OPM
'
],
[
'
anvil
'
,
'
ANVIL
'
]]
})
};
};
}
export
const
MembraneParams
=
getMembraneParams
();
export
type
MembraneParams
=
typeof
MembraneParams
export
type
MembraneParams
=
typeof
MembraneParams
export
type
MembraneProps
=
PD
.
Values
<
MembraneParams
>
export
type
MembraneProps
=
PD
.
Values
<
MembraneParams
>
...
@@ -29,11 +37,21 @@ export const MembraneProvider: CustomStructureProperty.Provider<MembraneParams,
...
@@ -29,11 +37,21 @@ export const MembraneProvider: CustomStructureProperty.Provider<MembraneParams,
defaultParams
:
MembraneParams
,
defaultParams
:
MembraneParams
,
getParams
:
(
data
:
Structure
)
=>
MembraneParams
,
getParams
:
(
data
:
Structure
)
=>
MembraneParams
,
isApplicable
:
(
data
:
Structure
)
=>
true
,
isApplicable
:
(
data
:
Structure
)
=>
true
,
// TODO needs ASA to be computed (or 'resolved' before trying computing topology) - how to achieve?
// TODO potentially, this could behave like secondary structure info where data can be either parsed or computed
obtain
:
async
(
ctx
:
CustomProperty
.
Context
,
data
:
Structure
,
props
:
Partial
<
MembraneProps
>
)
=>
{
obtain
:
async
(
ctx
:
CustomProperty
.
Context
,
data
:
Structure
,
props
:
Partial
<
MembraneProps
>
)
=>
{
await
AccessibleSurfaceAreaProvider
.
attach
(
ctx
,
data
);
const
p
=
{
...
PD
.
getDefaultValues
(
MembraneParams
),
...
props
};
const
p
=
{
...
PD
.
getDefaultValues
(
MembraneParams
),
...
props
};
return
{
value
:
await
Membrane
.
compute
(
data
,
p
).
runInContext
(
ctx
.
runtime
)
};
switch
(
p
.
type
.
name
)
{
case
'
anvil
'
:
return
{
value
:
await
computeAnvil
(
ctx
,
data
,
p
.
type
.
params
)
};
case
'
opm
'
:
return
{
value
:
await
computeOpm
(
data
)
};
}
}
}
});
});
async
function
computeAnvil
(
ctx
:
CustomProperty
.
Context
,
data
:
Structure
,
props
:
ANVILProps
):
Promise
<
Membrane
>
{
await
AccessibleSurfaceAreaProvider
.
attach
(
ctx
,
data
);
const
p
=
{
...
PD
.
getDefaultValues
(
MembraneParams
),
...
props
};
return
await
Membrane
.
compute
(
data
,
p
).
runInContext
(
ctx
.
runtime
);
}
async
function
computeOpm
(
structure
:
Structure
):
Promise
<
Membrane
>
{
throw
Error
(
'
TODO impl
'
);
}
\ 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
register
or
sign in
to comment