I want to create a model to predict proteins which could be associated with drug response in cancer cell lines. I have cell line proteomics data, with compound screening data they have gained for a number of these cells. My aim is to relate these proteins to drug response. I am using this exercise as an introduction in the use of ML in biology.
To this end, I have created dictionaries, with selected compounds as the keys, and their respective datasets. Cells are rows, proteins are columns, and the drug response is the y
variable.
I have approached the task as a regression task. The aim being to predict the ln(IC50) - a measure of the concentration required to induce cell death - and subsequently pull out the features (proteins) which have made the largest contribution to this prediction. As my baseline model, I have attempted linear regression. However, my model performance has consistently been very poor. A problem with this dataset is the large number of missing values (heatmap below - yellow = missing). However, even when trying a simple feature selection strategy with sklearn (first function), the explained variance is around 0.3 for the best performing compound. I have plotted the residuals in attempt to dig into this further, but the spread looks quite distributed.
Any advise/suggestions would be appreciated. Or any further reading/papers relating to ML in biology which could help a beginner build and use effective models.
Training and test functions shown below.
def process_training_and_test_data_for_LG(df):
training_datasets = {}
test_datasets = {}
for drug in df.keys():
df[drug].dropna(axis=1,inplace=True)
print("at "+drug)
X = df[drug].drop(["cell_line_name", "ln_IC50","putative_target"], axis=1)
y = df[drug]["ln_IC50"]
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=42)
feature_selector = SelectKBest(score_func=f_regression, k=50)
feature_selector.fit(X_train, y_train)
X_train = feature_selector.transform(X_train)
X_test = feature_selector.transform(X_test)
#Add data to relevant dictionaries
training_datasets[drug] = [X_train, y_train]
test_datasets[drug] = [X_test, y_test]
return training_datasets, test_datasets
def train_models(training_data):
trained_models = {}
for drug in training_data.keys():
#initiate model
lm = LinearRegression()
#extract drug specific training data
X_train = training_data[drug][0]
y_train = training_data[drug][1]
#fit model
model = lm.fit(X_train, y_train)
#Append dict of trained models
trained_models[drug] = model
print("Model for {} trained".format(drug))
return trained_models
def test_models(model_dict, test_data):
prediction_dict = {}
for drug in model_dict.keys():
drug_model = model_dict[drug]
X_test = test_data[drug][0]
predictions = drug_model.predict(X_test)
prediction_dict[drug] = predictions
return prediction_dict