# Tao Lab – Machine Learning Pipeline for Peptide-Based Classification of Breast Cancer Subtypes # (TNBC, LAB, Control) This repository contains the formal instructions to replicate the Breast Cancer Subtype Machine Learning Pipeline used by Tao Lab to determine the final list of relevant peptides to differentiate between Triple Negative Breast Cancer, Luminal AB Breast Cancer, and Healthy samples. --- ## Instructions ### **Step 1:** Run the `RFE_top30.py` file with the appropriate file path for the `Adjusted_062223_MH_Data_For_Training.xlsx` dataset. This dataset contains the 111 peptides we narrowed down to after statistical analysis. The code will use recursive feature elimination and narrow down the list to 30 peptides with the best accuracy / auroc scores. When running the code you must run it twice for (LAB vs rest) & (TN vs Rest): **First with:** ```python auc_score, accuracy, cm = perform_analysis(data, ['TN', 'Control'], 'LAB', 30, exclude_features) ``` **Then with:** ```python auc_score, accuracy, cm = perform_analysis(data, ['LAB', 'Control'], 'TN', 30, exclude_features) ``` Will produce two lists of the best performing 30 peptides for differentiating between peptides specific to LAB Breast Cancer & TN Breast Cancer. --- ### **Step 2:** Run `Filterdataset.py`, this will use the 30 features found from the last step and create new datasets with just the LAB and TN features. This will create the `LAB_30.xlsx` and `TN_30.xlsx`. Make sure to comment out the 30 features you are not creating the dataset for. --- ### **Step 3:** Run `Exhaustive_top7.py` on the dataset to get the 7 most important peptides based off differentiability between LAB, TN, and Control. Make sure to Change this line to run LAB vs Rest or TN vs Rest: **LAB vs Rest:** ```python auc_score, accuracy, selected_features = exhaustive_feature_selection(data, ['TN', 'Control'], 'LAB', 7) ``` **TN vs Rest:** ```python auc_score, accuracy, selected_features = exhaustive_feature_selection(data, ['LAB', 'Control'], 'TN', 7) ``` *Warning: there are (30 choose 7) 2035800 combinations to run depending on processor limitations. This can take 3+ hours to run.* --- ### **Step 4:** Run `grid_search.py` to perform hyperparameter tuning for the Random Forest classifier. This step uses the selected 7 features from Step 3 to optimize model performance. The script performs a grid search with cross-validation to find the best combination of hyperparameters: `n_estimators`, `min_samples_split`, `min_samples_leaf`, `max_features`, `bootstrap`, `max_depth`. --- ## Contact This code has been released under an OSI-approved open source license Any questions feel free to contact **rachitb10@gmail.com**