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
abcb7c44
Commit
abcb7c44
authored
2 years ago
by
Michal Malý
Browse files
Options
Downloads
Patches
Plain Diff
ReDNATCO plugin stage 18
parent
3569e22e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/apps/rednatco/api.ts
+12
-5
12 additions, 5 deletions
src/apps/rednatco/api.ts
src/apps/rednatco/idents.ts
+8
-1
8 additions, 1 deletion
src/apps/rednatco/idents.ts
src/apps/rednatco/viewer.ts
+42
-13
42 additions, 13 deletions
src/apps/rednatco/viewer.ts
with
62 additions
and
19 deletions
src/apps/rednatco/api.ts
+
12
−
5
View file @
abcb7c44
import
{
Filtering
}
from
'
./filtering
'
;
export
namespace
ReDNATCOMspApi
{
export
namespace
ReDNATCOMspApi
{
export
namespace
Commands
{
export
namespace
Commands
{
export
type
Type
=
'
deselect-step
'
|
'
redraw
'
|
'
select-step
'
|
'
switch-model
'
;
export
type
Type
=
'
deselect-step
'
|
'
filter
'
|
'
redraw
'
|
'
select-step
'
|
'
switch-model
'
;
export
type
Redraw
=
{
type
:
'
redraw
'
}
export
function
Redraw
():
Redraw
{
return
{
type
:
'
redraw
'
};
}
export
type
DeselectStep
=
{
type
:
'
deselect-step
'
}
export
type
DeselectStep
=
{
type
:
'
deselect-step
'
}
export
function
DeselectStep
()
{
export
function
DeselectStep
()
:
DeselectStep
{
return
{
type
:
'
deselect-step
'
};
return
{
type
:
'
deselect-step
'
};
}
}
export
type
Filter
=
{
type
:
'
filter
'
,
filter
:
Filtering
.
Filter
};
export
function
Filter
(
filter
:
Filtering
.
Filter
)
{
return
{
type
:
'
filter
'
,
filter
};
}
export
type
Redraw
=
{
type
:
'
redraw
'
}
export
function
Redraw
():
Redraw
{
return
{
type
:
'
redraw
'
};
}
export
type
SelectStep
=
{
export
type
SelectStep
=
{
type
:
'
select-step
'
;
type
:
'
select-step
'
;
stepName
:
string
;
stepName
:
string
;
...
...
This diff is collapsed.
Click to expand it.
src/apps/rednatco/idents.ts
+
8
−
1
View file @
abcb7c44
export
type
ID
=
'
data
'
|
'
trajectory
'
|
'
model
'
|
'
structure
'
|
'
visual
'
|
'
pyramids
'
|
'
superposition
'
;
export
type
ID
=
'
data
'
|
/* Source structural data */
'
trajectory
'
|
/* Source data parsed into trajectory */
'
model
'
|
/* Currently active model */
'
entire-structure
'
|
/* Entire structure (as Molstar structure PSO) of the active model */
'
structure
'
|
/* Possibly filtered structure as PSO - this is what shall be used to create visuals from */
'
visual
'
|
/* Visual PSO - the thing that is actually drawn on the screen */
'
pyramids
'
|
'
superposition
'
;
/* Additional identifiers for DNATCO-specific objects */
export
type
Substructure
=
'
nucleic
'
|
'
protein
'
|
'
water
'
|
'
selected-slice
'
|
'
remainder-slice
'
;
export
type
Substructure
=
'
nucleic
'
|
'
protein
'
|
'
water
'
|
'
selected-slice
'
|
'
remainder-slice
'
;
export
function
ID
(
id
:
ID
,
sub
:
Substructure
|
''
,
ref
:
string
)
{
export
function
ID
(
id
:
ID
,
sub
:
Substructure
|
''
,
ref
:
string
)
{
...
...
This diff is collapsed.
Click to expand it.
src/apps/rednatco/viewer.ts
+
42
−
13
View file @
abcb7c44
...
@@ -2,6 +2,7 @@ import * as IDs from './idents';
...
@@ -2,6 +2,7 @@ import * as IDs from './idents';
import
*
as
RefCfmr
from
'
./reference-conformers
'
;
import
*
as
RefCfmr
from
'
./reference-conformers
'
;
import
{
ReDNATCOMsp
,
Display
,
VisualRepresentations
}
from
'
./index
'
;
import
{
ReDNATCOMsp
,
Display
,
VisualRepresentations
}
from
'
./index
'
;
import
{
NtCColors
}
from
'
./colors
'
;
import
{
NtCColors
}
from
'
./colors
'
;
import
{
Filtering
}
from
'
./filtering
'
;
import
{
ReferenceConformersPdbs
}
from
'
./reference-conformers-pdbs
'
;
import
{
ReferenceConformersPdbs
}
from
'
./reference-conformers-pdbs
'
;
import
{
Step
}
from
'
./step
'
;
import
{
Step
}
from
'
./step
'
;
import
{
Superpose
}
from
'
./superpose
'
;
import
{
Superpose
}
from
'
./superpose
'
;
...
@@ -840,27 +841,55 @@ export class ReDNATCOMspViewer {
...
@@ -840,27 +841,55 @@ export class ReDNATCOMspViewer {
:
t
.
apply
(
StateTransforms
.
Data
.
ParseCif
).
apply
(
StateTransforms
.
Model
.
TrajectoryFromMmCif
,
{},
{
ref
:
IDs
.
ID
(
'
trajectory
'
,
''
,
BaseRef
)
})
:
t
.
apply
(
StateTransforms
.
Data
.
ParseCif
).
apply
(
StateTransforms
.
Model
.
TrajectoryFromMmCif
,
{},
{
ref
:
IDs
.
ID
(
'
trajectory
'
,
''
,
BaseRef
)
})
)(
this
.
plugin
.
state
.
data
.
build
().
toRoot
().
apply
(
RawData
,
{
data
},
{
ref
:
IDs
.
ID
(
'
data
'
,
''
,
BaseRef
)
}))
)(
this
.
plugin
.
state
.
data
.
build
().
toRoot
().
apply
(
RawData
,
{
data
},
{
ref
:
IDs
.
ID
(
'
data
'
,
''
,
BaseRef
)
}))
.
apply
(
StateTransforms
.
Model
.
ModelFromTrajectory
,
{
modelIndex
:
display
.
modelNumber
?
display
.
modelNumber
-
1
:
0
},
{
ref
:
IDs
.
ID
(
'
model
'
,
''
,
BaseRef
)
})
.
apply
(
StateTransforms
.
Model
.
ModelFromTrajectory
,
{
modelIndex
:
display
.
modelNumber
?
display
.
modelNumber
-
1
:
0
},
{
ref
:
IDs
.
ID
(
'
model
'
,
''
,
BaseRef
)
})
.
apply
(
StateTransforms
.
Model
.
StructureFromModel
,
{},
{
ref
:
IDs
.
ID
(
'
structure
'
,
''
,
BaseRef
)
})
.
apply
(
StateTransforms
.
Model
.
StructureFromModel
,
{},
{
ref
:
IDs
.
ID
(
'
entire-
structure
'
,
''
,
BaseRef
)
})
// Extract substructures
// Extract substructures
.
apply
(
StateTransforms
.
Model
.
StructureComplexElement
,
{
type
:
'
nucleic
'
},
{
ref
:
IDs
.
ID
(
'
structure
'
,
'
nucleic
'
,
BaseRef
)
})
.
apply
(
StateTransforms
.
Model
.
StructureComplexElement
,
{
type
:
'
nucleic
'
},
{
ref
:
IDs
.
ID
(
'
entire-
structure
'
,
'
nucleic
'
,
BaseRef
)
})
.
to
(
IDs
.
ID
(
'
structure
'
,
''
,
BaseRef
))
.
to
(
IDs
.
ID
(
'
entire-
structure
'
,
''
,
BaseRef
))
.
apply
(
StateTransforms
.
Model
.
StructureComplexElement
,
{
type
:
'
protein
'
},
{
ref
:
IDs
.
ID
(
'
structure
'
,
'
protein
'
,
BaseRef
)
})
.
apply
(
StateTransforms
.
Model
.
StructureComplexElement
,
{
type
:
'
protein
'
},
{
ref
:
IDs
.
ID
(
'
entire-
structure
'
,
'
protein
'
,
BaseRef
)
})
.
to
(
IDs
.
ID
(
'
structure
'
,
''
,
BaseRef
))
.
to
(
IDs
.
ID
(
'
entire-
structure
'
,
''
,
BaseRef
))
.
apply
(
StateTransforms
.
Model
.
StructureComplexElement
,
{
type
:
'
water
'
},
{
ref
:
IDs
.
ID
(
'
structure
'
,
'
water
'
,
BaseRef
)
});
.
apply
(
StateTransforms
.
Model
.
StructureComplexElement
,
{
type
:
'
water
'
},
{
ref
:
IDs
.
ID
(
'
entire-
structure
'
,
'
water
'
,
BaseRef
)
});
// Commit now so that we can check whether individual substructures are available
// Commit now so that we can check whether individual substructures are available
and apply filters
await
b
.
commit
();
await
b
.
commit
();
// Create the "possibly filtered" structure PSOs
const
b2
=
this
.
plugin
.
state
.
data
.
build
();
if
(
this
.
has
(
'
entire-structure
'
,
'
nucleic
'
))
{
b2
.
to
(
IDs
.
ID
(
'
entire-structure
'
,
'
nucleic
'
,
BaseRef
))
.
apply
(
StateTransforms
.
Model
.
StructureSelectionFromExpression
,
{
expression
:
Filtering
.
toExpression
(
Filtering
.
EmptyFilter
())
},
{
ref
:
IDs
.
ID
(
'
structure
'
,
'
nucleic
'
,
BaseRef
)
}
);
}
if
(
this
.
has
(
'
entire-structure
'
,
'
protein
'
))
{
b2
.
to
(
IDs
.
ID
(
'
entire-structure
'
,
'
protein
'
,
BaseRef
))
.
apply
(
StateTransforms
.
Model
.
StructureSelectionFromExpression
,
{
expression
:
Filtering
.
toExpression
(
Filtering
.
EmptyFilter
())
},
{
ref
:
IDs
.
ID
(
'
structure
'
,
'
protein
'
,
BaseRef
)
}
);
}
if
(
this
.
has
(
'
entire-structure
'
,
'
water
'
))
{
b2
.
to
(
IDs
.
ID
(
'
entire-structure
'
,
'
water
'
,
BaseRef
))
.
apply
(
StateTransforms
.
Model
.
StructureSelectionFromExpression
,
{
expression
:
Filtering
.
toExpression
(
Filtering
.
EmptyFilter
())
},
{
ref
:
IDs
.
ID
(
'
structure
'
,
'
water
'
,
BaseRef
)
}
);
}
await
b2
.
commit
();
// Create default visuals
// Create default visuals
const
b
b
=
this
.
plugin
.
state
.
data
.
build
();
const
b
3
=
this
.
plugin
.
state
.
data
.
build
();
if
(
display
.
showNucleic
&&
this
.
has
(
'
structure
'
,
'
nucleic
'
))
{
if
(
display
.
showNucleic
&&
this
.
has
(
'
structure
'
,
'
nucleic
'
))
{
b
b
.
to
(
IDs
.
ID
(
'
structure
'
,
'
nucleic
'
,
BaseRef
))
b
3
.
to
(
IDs
.
ID
(
'
structure
'
,
'
nucleic
'
,
BaseRef
))
.
apply
(
.
apply
(
StateTransforms
.
Representation
.
StructureRepresentation3D
,
StateTransforms
.
Representation
.
StructureRepresentation3D
,
this
.
substructureVisuals
(
'
cartoon
'
,
chainColor
),
this
.
substructureVisuals
(
'
cartoon
'
,
chainColor
),
{
ref
:
IDs
.
ID
(
'
visual
'
,
'
nucleic
'
,
BaseRef
)
}
{
ref
:
IDs
.
ID
(
'
visual
'
,
'
nucleic
'
,
BaseRef
)
}
);
);
if
(
display
.
showPyramids
)
{
if
(
display
.
showPyramids
)
{
b
b
.
to
(
IDs
.
ID
(
'
structure
'
,
'
nucleic
'
,
BaseRef
))
b
3
.
to
(
IDs
.
ID
(
'
structure
'
,
'
nucleic
'
,
BaseRef
))
.
apply
(
.
apply
(
StateTransforms
.
Representation
.
StructureRepresentation3D
,
StateTransforms
.
Representation
.
StructureRepresentation3D
,
this
.
pyramidsParams
(
display
.
conformerColors
??
NtCColors
.
Conformers
,
new
Map
(),
false
),
this
.
pyramidsParams
(
display
.
conformerColors
??
NtCColors
.
Conformers
,
new
Map
(),
false
),
...
@@ -869,7 +898,7 @@ export class ReDNATCOMspViewer {
...
@@ -869,7 +898,7 @@ export class ReDNATCOMspViewer {
}
}
}
}
if
(
display
.
showProtein
&&
this
.
has
(
'
structure
'
,
'
protein
'
))
{
if
(
display
.
showProtein
&&
this
.
has
(
'
structure
'
,
'
protein
'
))
{
b
b
.
to
(
IDs
.
ID
(
'
structure
'
,
'
protein
'
,
BaseRef
))
b
3
.
to
(
IDs
.
ID
(
'
structure
'
,
'
protein
'
,
BaseRef
))
.
apply
(
.
apply
(
StateTransforms
.
Representation
.
StructureRepresentation3D
,
StateTransforms
.
Representation
.
StructureRepresentation3D
,
this
.
substructureVisuals
(
'
cartoon
'
,
chainColor
),
this
.
substructureVisuals
(
'
cartoon
'
,
chainColor
),
...
@@ -877,7 +906,7 @@ export class ReDNATCOMspViewer {
...
@@ -877,7 +906,7 @@ export class ReDNATCOMspViewer {
);
);
}
}
if
(
display
.
showWater
&&
this
.
has
(
'
structure
'
,
'
water
'
))
{
if
(
display
.
showWater
&&
this
.
has
(
'
structure
'
,
'
water
'
))
{
b
b
.
to
(
IDs
.
ID
(
'
structure
'
,
'
water
'
,
BaseRef
))
b
3
.
to
(
IDs
.
ID
(
'
structure
'
,
'
water
'
,
BaseRef
))
.
apply
(
.
apply
(
StateTransforms
.
Representation
.
StructureRepresentation3D
,
StateTransforms
.
Representation
.
StructureRepresentation3D
,
this
.
waterVisuals
(
waterColor
),
this
.
waterVisuals
(
waterColor
),
...
@@ -885,7 +914,7 @@ export class ReDNATCOMspViewer {
...
@@ -885,7 +914,7 @@ export class ReDNATCOMspViewer {
);
);
}
}
await
b
b
.
commit
();
await
b
3
.
commit
();
this
.
haveMultipleModels
=
this
.
getModelCount
()
>
1
;
this
.
haveMultipleModels
=
this
.
getModelCount
()
>
1
;
...
...
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