Skip to content
Snippets Groups Projects
Commit 7cd518a6 authored by Tim O'Donnell's avatar Tim O'Donnell
Browse files

First pass on models_class1_allele_specific_single_kim2014_only

parent 7b293d95
No related merge requests found
#!/bin/bash
if [[ $# -eq 0 ]] ; then
echo 'WARNING: This script is intended to be called with additional arguments to pass to mhcflurry-class1-allele-specific-cv-and-train'
echo 'At minimum you probably want to pass --dask-scheduler <IP:PORT> as training many models on one node is extremely '
echo 'slow.'
fi
set -e
set -x
DOWNLOAD_NAME=models_class1_allele_specific_single_kim2014_only
SCRATCH_DIR=/tmp/mhcflurry-downloads-generation
SCRIPT_ABSOLUTE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/$(basename "${BASH_SOURCE[0]}")"
SCRIPT_DIR=$(dirname "$SCRIPT_ABSOLUTE_PATH")
mkdir -p "$SCRATCH_DIR"
rm -rf "$SCRATCH_DIR/$DOWNLOAD_NAME"
mkdir "$SCRATCH_DIR/$DOWNLOAD_NAME"
# Send stdout and stderr to a logfile included with the archive.
exec > >(tee -ia "$SCRATCH_DIR/$DOWNLOAD_NAME/LOG.txt")
exec 2> >(tee -ia "$SCRATCH_DIR/$DOWNLOAD_NAME/LOG.txt" >&2)
# Log some environment info
date
pip freeze
git rev-parse HEAD
git status
cd $SCRATCH_DIR/$DOWNLOAD_NAME
mkdir models
cp $SCRIPT_DIR/models.py $SCRIPT_DIR/imputer.json .
python models.py > models.json
time mhcflurry-class1-allele-specific-cv-and-train \
--model-architectures models.json \
--imputer-description imputer.json \
--train-data "$(mhcflurry-downloads path data_kim2014)/bdata.2009.mhci.public.1.txt" \
--test-data "$(mhcflurry-downloads path data_kim2014)/bdata.2013.mhci.public.blind.1.txt" \
--min-samples-per-allele 70 \
--out-cv-results cv.csv \
--out-production-results production.csv \
--out-models models \
--verbose \
"$@"
cp $SCRIPT_ABSOLUTE_PATH .
tar -cjf "../${DOWNLOAD_NAME}.tar.bz2" *
echo "Created archive: $SCRATCH_DIR/$DOWNLOAD_NAME.tar.bz2"
# Class I allele specific models (single) trained and tested in Kim 2014 dataset
This is a reimplementation of the analysis in [Predicting Peptide-MHC Binding Affinities With Imputed Training Data](http://biorxiv.org/content/early/2016/05/22/054775).
{
"imputation_method_name": "mice",
"n_burn_in": 5,
"n_imputations": 50,
"n_nearest_columns": 25,
"min_observations_per_peptide": 5,
"min_observations_per_allele": 100
}
import sys
from mhcflurry.class1_allele_specific.train import HYPERPARAMETER_DEFAULTS
import json
models = HYPERPARAMETER_DEFAULTS.models_grid(
#impute=[False, True],
impute=[False],
activation=["tanh"],
layer_sizes=[[12], [64], [128]],
embedding_output_dim=[8, 32, 64],
dropout_probability=[0, .1, .25],
# fraction_negative=[0, .1, .2],
n_training_epochs=[250])
sys.stderr.write("Models: %d\n" % len(models))
print(json.dumps(models, indent=4))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment