Skip to content
Snippets Groups Projects
Commit caff68b0 authored by Tim O'Donnell's avatar Tim O'Donnell Committed by GitHub
Browse files

Merge pull request #93 from hammerlab/script-updates

Small updates
parents 85b5a3f1 7f1e6c99
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,18 @@ git status
cd $SCRATCH_DIR/$DOWNLOAD_NAME
for mod in 0local 1local dense16 dense64 noL1
# Standard architecture on quantitative only
cp $SCRIPT_DIR/hyperparameters-standard.json .
mkdir models-standard-quantitative
time mhcflurry-class1-train-allele-specific-models \
--data "$(mhcflurry-downloads path data_curated)/curated_training_data.csv.bz2" \
--only-quantitative \
--hyperparameters hyperparameters-standard.json \
--out-models-dir models-standard-quantitative \
--min-measurements-per-allele 100
# Model variations on qualitative + quantitative
for mod in 0local_noL1 0local 1local dense16 dense64 noL1
do
cp $SCRIPT_DIR/hyperparameters-${mod}.json .
mkdir models-${mod}
......
......@@ -23,4 +23,4 @@
"dense_layer_l1_regularization": 0.001,
"dropout_probability": 0.0
}
]
\ No newline at end of file
]
[
{
"n_models": 8,
"max_epochs": 500,
"patience": 10,
"early_stopping": true,
"validation_split": 0.2,
"random_negative_rate": 0.0,
"random_negative_constant": 25,
"use_embedding": false,
"kmer_size": 15,
"batch_normalization": false,
"locally_connected_layers": [],
"activation": "relu",
"output_activation": "sigmoid",
"layer_sizes": [
32
],
"random_negative_affinity_min": 20000.0,
"random_negative_affinity_max": 50000.0,
"dense_layer_l1_regularization": 0.001,
"dropout_probability": 0.0
}
]
\ No newline at end of file
../models_class1/hyperparameters.json
\ No newline at end of file
......@@ -43,6 +43,11 @@ parser.add_argument(
metavar="N",
default=50,
help="Train models for alleles with >=N measurements.")
parser.add_argument(
"--only-quantitative",
action="store_true",
default=False,
help="Use only quantitative training data")
parser.add_argument(
"--verbosity",
type=int,
......@@ -67,6 +72,12 @@ def run(argv=sys.argv[1:]):
]
print("Subselected to 8-15mers: %s" % (str(df.shape)))
if args.only_quantitative:
df = df.loc[
df.measurement_type == "quantitative"
]
print("Subselected to quantitative: %s" % (str(df.shape)))
allele_counts = df.allele.value_counts()
if args.allele:
......
......@@ -105,6 +105,11 @@ input_mod_args.add_argument(
metavar="NAME",
default="peptide",
help="Input column name for peptides. Default: '%(default)s'")
input_mod_args.add_argument(
"--no-throw",
action="store_true",
default=False,
help="Return NaNs for unsupported alleles or peptides instead of raising")
output_args = parser.add_argument_group(title="Optional output modifiers")
......@@ -200,7 +205,8 @@ def run(argv=sys.argv[1:]):
predictions = predictor.predict_to_dataframe(
peptides=df[args.peptide_column].values,
alleles=df[args.allele_column].values,
include_individual_model_predictions=args.include_individual_model_predictions)
include_individual_model_predictions=args.include_individual_model_predictions,
throw=not args.no_throw)
for col in predictions.columns:
if col not in ("allele", "peptide"):
......
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