You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently IndependentMassSpectrometer supports two kinds of arguments to generate scan times. (Example.) The first is a dictionary mapping MS-levels (int) to either static values or a callable (of no arguments). The second is an object supporting a function with the signature sample(current_level, next_level, current_rt). This is intended to be used with a ScanTimeSampler.
A consequence of this is that the simulated mass spec must ask for the scan level of the next scan before it can compute the current RT. However, the TaskFilter used in dynamically adjusting scan times must know the current RT before deciding what the next scan (and its level) will be. For this to work the call to compute the scan time therefore had to be moved and the scan level of the next scan ignored by passing None in this commit.
To resupport this functionality, the code must therefore be changed so that scan samplers use a method sample(previous_level, current_level, current_rt). This preserves the idea that the scan time depends on whether you are switching MS level while not requiring us to "see into the future" and allowing TaskFilter to get the current RT.
Additionally, on initialising an IndependentMassSpectrometer, it could cast an argument, if it is given as dictionary, to a subclass of ScanTimeSampler. DefaultScanTimeSampler requires only minor changes to account for this (i.e. must allow the values in the dictionary to be callables rather than just values). This would allow us to avoid having messy type handling code in the body of IndependentMassSpectrometer while retaining backwards compatibility. (i.e. We just call sample on it regardless of which form the argument was given in.)
The text was updated successfully, but these errors were encountered:
Currently
IndependentMassSpectrometer
supports two kinds of arguments to generate scan times. (Example.) The first is a dictionary mapping MS-levels (int) to either static values or a callable (of no arguments). The second is an object supporting a function with the signaturesample(current_level, next_level, current_rt)
. This is intended to be used with a ScanTimeSampler.A consequence of this is that the simulated mass spec must ask for the scan level of the next scan before it can compute the current RT. However, the
TaskFilter
used in dynamically adjusting scan times must know the current RT before deciding what the next scan (and its level) will be. For this to work the call to compute the scan time therefore had to be moved and the scan level of the next scan ignored by passingNone
in this commit.To resupport this functionality, the code must therefore be changed so that scan samplers use a method
sample(previous_level, current_level, current_rt)
. This preserves the idea that the scan time depends on whether you are switching MS level while not requiring us to "see into the future" and allowingTaskFilter
to get the current RT.Additionally, on initialising an
IndependentMassSpectrometer
, it could cast an argument, if it is given as dictionary, to a subclass ofScanTimeSampler
. DefaultScanTimeSampler requires only minor changes to account for this (i.e. must allow the values in the dictionary to be callables rather than just values). This would allow us to avoid having messy type handling code in the body ofIndependentMassSpectrometer
while retaining backwards compatibility. (i.e. We just callsample
on it regardless of which form the argument was given in.)The text was updated successfully, but these errors were encountered: