UCLouvain-CBIO / scp

Single cell proteomics data processing
https://uclouvain-cbio.github.io/scp/index.html
21 stars 2 forks source link

Implementing a QR decomposition Modeling Method for scp #71

Open leopoldguyot opened 2 months ago

leopoldguyot commented 2 months ago

Implementing a QR decomposition Modeling Method for scp

Current Challenges in the scp Linear Regression

The current implementation of linear regression estimation in scp relies on simple matrix computation methods. While this approach is straightforward, it has several limitations:

Implementing QR Decomposition for Linear Regression

This project aims to implement a QR decomposition method in scp for computing the linear regression. This new approach will be integrated through the lm.fit function from the stats package. This new implementation will have some advantages:

Structural Changes to scp

In addition to changing the linear regression computation method, this project will also modify how different elements of the scpModel are accessed and stored:

Elements such as effects matrices (scpModelFitEffects), residuals (scpModelFitResiduals), p (scpModelFitP), and n (scpModelFitN) will no longer be stored as slots in the scpModelFit class. Instead, these elements will be computed on the fly when needed, at the level of the scpModel class. By computing these elements dynamically rather than storing them, the memory consumption of the scpModel object will be significantly reduced. But despite the shift to on-the-fly computation, access times for these elements will remain reasonable due to efficient matrix computations.

User Interface Continuity

Importantly, these changes will be implemented without affecting the interface used by the user. All the exported functions will still have the same arguments and return the same output.