Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch Correction changes all values to 0 #88

Open
misch91 opened this issue Jun 15, 2022 · 4 comments
Open

Batch Correction changes all values to 0 #88

misch91 opened this issue Jun 15, 2022 · 4 comments

Comments

@misch91
Copy link
Contributor

misch91 commented Jun 15, 2022

Hey,
I am working on a dataset that was acquired in two steps and requires batch correction (see plot below).

Dataset

Batch Correction Assessment report however suggests either changing all intensities to zero or touching only certain samples (see plots below). This happens regardless of the chosen window (I tried everything between 2-30). I first thought the preview must be mistaken but it turned out that running batch correction here really delivers the previewed correction.
There were no errors before, data had been imported and matched with metadata correctly. I suppose it is some bug within the batch and run order module?

Figure 2022-06-15 205005
Figure 2022-06-15 205011
Figure 2022-06-15 205021

@Gscorreia89
Copy link
Member

Hi,

Interesting, definitely its misbehaving - Would it be possible to get a small example set to replicate this?

Thanks,
Goncalo

@misch91
Copy link
Contributor Author

misch91 commented Jul 13, 2022 via email

@Gscorreia89
Copy link
Member

Hi,

Found out the problem and a fix. The code is infering (correctly) the type of the data matrix as int and the loess correction is no longer modifying it to float (possibly due to some change in numpy/statsmodels?), which causes rounding to 0 whenever a value is below 1 - any value below the SR basically. The data matrix type (.intensityData) should be always float to avoid this issue.

For now, it can be patched by running msData.intensityData = msData.intensityData.astype(float) immediately after importing the dataset, but I will add a permanent fix.

Gscorreia89 added a commit that referenced this issue Aug 9, 2022
@Gscorreia89
Copy link
Member

Fixed by 005047b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants