-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
198 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Clip and Invert Splines | ||
|
||
The "clip" operation of a spline is **not** removing the points defining the spline. | ||
Instead, it is equivalent to defining a linear transformation on the spline coordinate | ||
$u$ as follows: | ||
|
||
$\boldsymbol{C}_{clipped}(u) = \boldsymbol{C}(\alpha _{0} (1 - u) + \alpha _{1} u)$ | ||
|
||
$\boldsymbol{C}_{clipped}(0) = \boldsymbol{C}(\alpha _{0})$ and | ||
$\boldsymbol{C}_{clipped}(1) = \boldsymbol{C}(\alpha _{1})$ indicate that the new spline | ||
is defined by the $\alpha _{0} \le u \le \alpha _{1}$ region of the original spline. | ||
|
||
As it is simply a linear transformation, spline inversion can also be defined the same | ||
way: | ||
|
||
$\boldsymbol{C}_{inv}(u) = \boldsymbol{C}(1 - u)$ | ||
|
||
## Clip by Length | ||
|
||
:material-arrow-right-thin-circle-outline: API: [`clip_spline`][cylindra.widgets.main.CylindraMainWidget.clip_spline] | ||
|
||
:material-arrow-right-thin-circle-outline: GUI: `Splines > Clip spline` or ++ctrl+k++ → ++ctrl+x++ | ||
|
||
This method clips the selected spline at both ends by the given lengths. Local | ||
properties of the clipped spline will be discarded, while global properties will not. | ||
|
||
 | ||
|
||
## Spline Clipper | ||
|
||
:material-arrow-right-thin-circle-outline: GUI: `Splines > Open spline clipper` | ||
|
||
 | ||
|
||
For precise clipping, you can use the spline clipper widget. This widget synchronizes | ||
the clipping lengths and the projections of the spline edges. "Clip here" will call | ||
[`clip_spline`][cylindra.widgets.main.CylindraMainWidget.clip_spline] internally. | ||
|
||
|
||
## Invert Splines | ||
|
||
:material-arrow-right-thin-circle-outline: API: [`invert_spline`][cylindra.widgets.main.CylindraMainWidget.invert_spline] | ||
|
||
:material-arrow-right-thin-circle-outline: GUI: `Splines > Orientation > Invert spline` | ||
|
||
This method inverts the selected spline. This operation does not discard the local | ||
properties. They will be inverted as well. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# Spline Configurations | ||
|
||
A spline is tagged with a [SplineConfig][cylindra.components.SplineConfig] object. This | ||
object is practically used to annotate the spline with structural features. For example, | ||
if a spline represent a microtubule, it is tagged with a `SplineConfig` object with | ||
parameters appropriate for microtubules. These parameters are used in spline fitting, | ||
CFT analysis, and so on. | ||
|
||
Every time a new spline is created, it is initialized with the default `SplineConfig`. | ||
Make sure the correct configuration is used before adding splines. | ||
|
||
## List of Parameters | ||
|
||
- Parameters used during CFT analysis | ||
- `npf_range` ... an (`int`, `int`) tuple indicating the minimum/maximum of the | ||
number of protofilaments. | ||
- `spacing_range` ... an (`float`, `float`) tuple indicating the minimum/maximum of | ||
longitudinal spacing between monomers (in nanometer). | ||
- `twist_range` ... an (`float`, `float`) tuple indicating the minimum/maximum of | ||
twist angle (in degree). | ||
- `rise_range` ... an (`float`, `float`) tuple indicating the minimum/maximum of | ||
rise angle (in degree). | ||
- `rise_sign` ... the sign of the rise angle. This parameter is redundant for the | ||
mathematically. It was introduced only to make the rise angle and the start number positive, like "13_3" instead of "13_-3". | ||
|
||
- Other parameters | ||
- `clockwise` ... `"PlusToMinus"` or `"MinusToPlus"`. This parameter is used for | ||
automatic polarity determination. If the cross-sectional view of the cylindric | ||
structure in the plus-to-minus orientation has clockwise chirality, set this | ||
parameter to `"PlusToMinus"`. | ||
- `thickness_inner` ... distance between the inner surface and the peak of the radial | ||
profileradius (in nanometer). This parameter is used for construction of cylindric | ||
coordinate system. | ||
- `thickness_inner` ... distance between the outer surface and the peak of the radial | ||
profileradius (in nanometer). This parameter is used for construction of cylindric | ||
coordinate system. | ||
- `fit_depth` ... the depth of sub-volumes used for spline fitting region (in | ||
nanometer). | ||
- `fit_width` ... the width of sub-volumes used for spline fitting region (in | ||
nanometer). | ||
|
||
## Change the Default Configuration | ||
|
||
The configuration is optimized for microtubules by default. To analyze other structures, | ||
you need to change the default configuration. | ||
|
||
The default configuration is stored in the `default_config` property. | ||
|
||
``` python | ||
ui.default_config | ||
``` | ||
|
||
``` title="Output" | ||
SplineConfig( | ||
npf_range=Range(min=11, max=17), | ||
spacing_range=Range(min=3.9, max=4.3), | ||
twist_range=Range(min=-0.65, max=0.65), | ||
rise_range=Range(min=5.0, max=13.0), | ||
rise_sign=-1, | ||
clockwise='MinusToPlus', | ||
thickness_inner=2.8, | ||
thickness_outer=2.8, | ||
fit_depth=49.0, | ||
fit_width=40.0 | ||
) | ||
``` | ||
|
||
### Manually set the parameters | ||
|
||
:material-arrow-right-thin-circle-outline: GUI: `Splines > Config > Update default config` | ||
|
||
 | ||
|
||
### Measuring the approximate parameters of unknown structures | ||
|
||
:material-arrow-right-thin-circle-outline: GUI: `Analysis > Open spectra inspector` | ||
|
||
 | ||
|
||
This widget is used to measure lattice parameters by clicking the peak positions on the | ||
power spectrum. | ||
|
||
### Load presets | ||
|
||
:material-arrow-right-thin-circle-outline: GUI: `Splines > Config > Load default config` | ||
|
||
Presets are stored in the user directory. You can load the presets from the menu. | ||
|
||
## Save the Configuration | ||
|
||
:material-arrow-right-thin-circle-outline: GUI: `Splines > Config > Save default config` | ||
|
||
You can save current default configuration as a preset with arbitrary name. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Spline | ||
|
||
A 3D spline is a mapping from a 1D parameter to 3D points $(z, y, x)$: | ||
|
||
$$ | ||
\boldsymbol{C}(u) \in \mathbb{R}^3 \quad (0\le u \le 1) | ||
$$ | ||
|
||
In `cylindra`, several useful methods are provided to make the most of splines. | ||
|
||
- [Clip and Invert Splines](clip.md) | ||
- [Spline Configurations](config.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters