thtools.crt.CelsiusRangeTest¶
- class thtools.crt.CelsiusRangeTest(thtest, celsius_range)¶
Utility for running a
ToeholdTestat a range of temperatures.The name is sometimes abbreviated to CRT as a shorthand.
Note
There is no performance to be gained from using the
run()method instead ofgenerate(), unlike withToeholdTest.This is because each individual
ToeholdTestin the temperature range already utilizes the specified number of CPU core, so further multiprocessing is impossible.- Parameters
- thtestToeholdTest
The
ToeholdTestto adjust the temperature of.- celsius_rangeSequence[float]
The array of temperature values in °C.
See also
Examples
>>> import thtools as tt >>> ths = "UUAGCCGCUGUCACACGCACAGGGAUUUACAAAAAGAGGAGAGUAAAAUGCUGUGCGUGCACCAUAAAACGAACAUAGAC" >>> rbs = "AGAGGAGA" >>> triggers = ["CUGUGCGUGUGACAGCGGCUGA", "CUAUACAAUCUACUGUCUUUCC", "UGUACAGCCUCCUAGCUUUCC"] >>> temperatures = range(10, 61, 5) >>> my_test = tt.autoconfig(ths, rbs, triggers) >>> my_crt = tt.CelsiusRangeTest(my_test, temperatures) >>> my_result = my_crt.run(max_size=3, n_samples=100) >>> my_result.inferred_target 'CUGUGCGUGUGACAGCGGCUGA'
- Attributes
- thtestToeholdTest
- celsius_rangeSequence[float]
- resultCelsiusRangeResult
- metaMapping[str, str | int | float]
- generate(max_size, n_samples=100, n_nodes=2)¶
Run the test, returning a generator that the user must iterate through.
It stores a
CelsiusRangeResultto theresultattribute.- Parameters
- max_sizeint
The maximum RNA complex size to simulate
- n_samplesint, default = 100
The number of Boltzmann samples to take of each complex’s secondary structure.
- n_nodesint, default =
os.cpu_count() The number of CPU cores to distribute work across using Pathos.
- Yields
- ToeholdResult
The result of the test at the nth temperature in the
celsius_range.
Notes
Unlike
generate(), this method has no significant performance penalty compared torun().
- run(max_size, n_samples=100, n_nodes=2)¶
Run the test.
This is an alias to the
generate()method and handles the iteration for you. Thus, there is no performance gain from using this overgenerate().- Parameters
- max_sizeint
The maximum RNA complex size to simulate
- n_samplesint, default=100
The number of Boltzmann samples to take of each complex’s secondary structure.
- n_nodesint, default=os.cpu_count()
The number of CPU cores to distribute work across using Pathos.
- Returns
- ToeholdResult
A container for the data.
Notes
The result is also stored in the
resultattribute.