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/37ae420ab97d6b902ab1015f01f9a9f8c29c58b34be308e2c1024da6982d5189.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:17<00:00, 11.76it/s]
<molass.PlotUtils.PlotResult.PlotResult at 0x23437fc3ed0>
../../_images/f299948d5ae76c4f509f4017b35ea7433b17b962f342c2415c28973d94711040.png

9.2. Varied Binary Proportions#

If you are not sure about the default decomposition, 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/b10b534158b240d42029d230026e407dcc9ca076c9253ad65de674eeb03dd327.png ../../_images/beb5526714fe6b7bb8b8efede7c0b4d50afb5a8d45c8e8a889a1c75f67c06e7e.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/082c64a0b8c8a90ff9f75c8557b4e36808927ce65ebe450e39337b50aefb1c80.png ../../_images/4a9c0d445b13f3bdd296141cbd5374202881b00a7c0084bc9a178de30713abc4.png