9. Nontrivial Decomposition#

This chapter will discuss the cases where component peaks are not apparent.

9.1. Initial Observation#

Let us first observe such an example.

from molass import get_version
assert get_version() >= '0.6.0', "This tutorial requires molass version 0.6.0 or higher."
from molass_data import get_version
assert get_version() >= '0.3.0', "This tutorial requires molass_data version 0.3.0 or higher."
from molass_data import SAMPLE4
from molass.DataObjects import SecSaxsData as SSD
ssd = SSD(SAMPLE4)
trimmed_ssd = ssd.trimmed_copy()
corrected_ssd = trimmed_ssd.corrected_copy()
corrected_ssd.plot_compact();
../../_images/ef5f3e2c9b0587d57a56cef0aea5de0489c965c6ea4af43d5a31ca356dcd4454.png

At first glance, the peak may seem to consist of a single component. For a more detailed observation, let us assume it may consist of two components and add the Rg curve.

rgcurve = corrected_ssd.xr.compute_rgcurve()
decomposition = corrected_ssd.quick_decomposition(num_components=2)
decomposition.plot_components(rgcurve=rgcurve)
100%|██████████| 203/203 [00:07<00:00, 25.46it/s]
<molass.PlotUtils.PlotResult.PlotResult at 0x24a368a6f60>
../../_images/3e368c4047c9e0551376a46697356691437d598c4ad317f9678f2370898fac01.png

9.2. Varied Binary Proportions#

If you are not sure about the default compositiun, you can compare the results with different proportions as follows.

import numpy as np
num_trails = 8
species1_proportions = np.ones(num_trails) * 3
species2_proportions = np.linspace(1, 3, num_trails)
proportions = np.array([species1_proportions, species2_proportions]).T
proportions
array([[3.        , 1.        ],
       [3.        , 1.28571429],
       [3.        , 1.57142857],
       [3.        , 1.85714286],
       [3.        , 2.14285714],
       [3.        , 2.42857143],
       [3.        , 2.71428571],
       [3.        , 3.        ]])
corrected_ssd.plot_varied_decompositions(proportions, rgcurve=rgcurve, best=3)
../../_images/6d434ed0fb42766889ca639f94db88dd4a9c55f17ce2854c6839ce22256914c0.png ../../_images/411b7384e2366bf28ef0ba50a128f248aeaa180d5956936b54db33936b54b2ca.png

9.3. Varied Tertiary Proportions#

If the existence of three components are suspected, do as follows.

species3_proportions = np.ones(num_trails) * 1
proportions = np.array([species1_proportions, species2_proportions, species3_proportions]).T
proportions
array([[3.        , 1.        , 1.        ],
       [3.        , 1.28571429, 1.        ],
       [3.        , 1.57142857, 1.        ],
       [3.        , 1.85714286, 1.        ],
       [3.        , 2.14285714, 1.        ],
       [3.        , 2.42857143, 1.        ],
       [3.        , 2.71428571, 1.        ],
       [3.        , 3.        , 1.        ]])
corrected_ssd.plot_varied_decompositions(proportions, rgcurve=rgcurve, best=3)
../../_images/a1dcae8ffc0d493369473ecb593bfb440fe9c5012cd0066c9e734523a554c909.png ../../_images/943306f1f04c30840757f511fe2c51dcb185cfd110ec429998b02803529141a6.png