Skip to content

jinyangye119/Prodecov

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Protein Deconvolution Model - Prodecov

This repository contains a trained elastic net model for estimating prostate tumor purity from proteomic abundance data.

The model was trained from CPTAC prostate proteomics using xCell tumor epithelial percentage as the training target. The final deployed object keeps only the elastic net model, its preprocessing parameters, calibration object, selected features, and feature weights.

Repository Contents

  • inst/extdata/final_elastic_net_proteomic_deconvolution_model.rds
    Cleaned final elastic net model object.

  • data/final_elastic_net_feature_weights_clean.csv
    Final elastic net feature weights. Positive weights increase predicted tumor purity; negative weights decrease predicted tumor purity.

  • R/predict_purity.R
    Helper functions for loading the model and predicting tumor purity.

  • examples/predict_new_samples.R
    Minimal example script for applying the model to a new proteomic matrix.

Input Format

The input proteomic matrix should be a table with:

  • one row per protein
  • an Index column matching the model feature IDs
  • one numeric column per sample

Example:

Index sample_1 sample_2 sample_3
ENSP00000354587 0.12 -0.31 0.44
ENSP00000269305 -0.08 0.22 -0.17

The model expects log2 abundance or log-ratio style data. By default, each feature is median-centered within the new cohort before prediction.

Installation

Clone the repository:

git clone https://github.com/jinyangye119/Prodecov.git
cd Prodecov

Install required R packages:

install.packages(c("glmnet", "Matrix", "readr"))

You can either source the helper script directly:

source("R/predict_purity.R")

or install the folder as a small local R package:

install.packages("devtools")
devtools::install(".")

Quick Tutorial

Load the model:

source("R/predict_purity.R")

model <- load_protein_deconvolution_model(
  "inst/extdata/final_elastic_net_proteomic_deconvolution_model.rds"
)

Read a new protein matrix:

library(readr)

new_data <- read_tsv("path/to/new_protein_matrix.tsv", show_col_types = FALSE)

Predict tumor purity:

predictions <- predict_protein_purity(
  new_data = new_data,
  model = model,
  index_col = "Index",
  median_center = TRUE,
  calibrate = TRUE
)

predictions

The output contains:

  • sample_id: sample name from the input matrix column
  • predicted_purity_raw: raw elastic net prediction, clipped to 0-1
  • predicted_purity_calibrated: calibrated prediction, clipped to 0-1
  • n_model_features: number of model features
  • n_matched_features: number of model features found in the new data
  • missing_feature_fraction: fraction of model features missing from the new data

Save predictions:

write_csv(predictions, "predicted_tumor_purity.csv")

Notes

  • Use predicted_purity_calibrated as the main prediction.
  • If many model features are missing, interpret predictions cautiously.
  • For external cohorts, keep median_center = TRUE unless you have a specific reason not to.

About

R package for prostate tumor purity prediction from proteomic abundance data

Topics

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages