Preprocessing RNA
Module for preprocessing and saving scRNA-seq data for trajectory analysis using PCA.
It applies Principal Component Analysis (PCA) to reduce the dimensionality of the dataset, optionally filters the data by specific timesteps, and saves the processed results and corresponding labels for downstream analysis.
- Main steps:
Load the dataset (in .npz format) containing PCA embeddings and sample labels.
Standardize (whiten) the PCA embeddings using StandardScaler.
Select a specified number of PCA components to retain, as provided via command-line arguments.
Save the processed PCA-transformed data and sample labels in .npy format.
- Command-line arguments:
--n-components: Number of PCA components to retain (default: 5).
- Example usage:
To run the script with 5 PCA components
python script.py --n-components 5
- preprocess_rna_seq.main(n_components: int) None[source]
Load, preprocess and save scRNA-seq PCA-transformed data for trajectory analysis.
- Parameters:
n_components (int) – Number of PCA components to retain.
- Return type:
None
References
Tong, A., Huang, J., Wolf, G., Van Dijk, D., & Krishnaswamy, S. (2020, November). TrajectoryNet: A dynamic optimal transport network for modeling cellular dynamics. In International Conference on Machine Learning (pp. 9526-9536). PMLR.