glasgowcompbio / vimms

A programmable and modular LC/MS simulator in Python
MIT License
19 stars 6 forks source link

mz_tol and rt_tol are not scan parameters #126

Open joewandy opened 4 years ago

joewandy commented 4 years ago

They're actually used for Top-N dynamic exclusion window, so should be removed from scan_params (when making ms2 scans)

https://github.com/sdrogers/vimms/blob/master/vimms/Controller/base.py#L72

sdrogers commented 4 years ago

Any suggestion as to where they should go?

sdrogers commented 4 years ago

These are just used for DEW exclusion, right? In which case they just belong to the TopN controllers? Or do they get picked up elsewhere?

joewandy commented 4 years ago

Another spaghetti 🍝 code, sorry.

I started an initial attempt to get rid of these DYNAMIC_EXCLUSION_MZ_TOL and DYNAMIC_EXCLUSION_RT_TOL parameters in the TopN controller. See this commit. That was the easy part.

Then I realised DYNAMIC_EXCLUSION_RT_TOL is actually used inside the simulated mass spec. It is stored to the self.current_DEW property of the mass spec.

        next_DEW = next_scan_param.get(ScanParameters.DYNAMIC_EXCLUSION_RT_TOL)
        ...
        if next_DEW is not None:
            self.current_DEW = next_DEW

which in turn is used for time sampling ...

        current_DEW = self.current_DEW
        current_scan_duration = self._increase_time(current_level, current_N, current_DEW, next_scan_param)
        scan.scan_duration = current_scan_duration

Will fix this as part of issue #46.