Converts each column to ranks divided by column length, producing values in the range 0 to 1 (exclusive of 0, inclusive of 1). This is a crucial preprocessing step when using your own expression data with PERCEPTIONx.
Why rank normalization?
PERCEPTIONx models are trained on DepMap expression data that has been rank-normalized. The model coefficients capture the relationship between relative gene expression ranks and drug response, not absolute expression values. Therefore, any new expression data fed into the model must undergo the same rank normalization to ensure compatibility.
How it works
For each column (cell/sample), every gene's expression value is replaced by its rank within that column, divided by the total number of genes: $$x_{ij}^{norm} = \frac{\mathrm{rank}(x_{ij})}{n}$$ where \(n\) is the number of rows (genes) and ties are resolved by averaging. This transforms each column into a uniform distribution over \((0,1]\), making the data robust to batch effects, library size differences, and outliers.
Important
If you provide your own expression data that has not been
rank-normalized, predictions will be unreliable. Always run
rank_normalization_mat() on your raw expression matrix before passing
it to predict_drugs().
