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

fix

parent cd8e0e82
No related branches found
No related tags found
No related merge requests found
...@@ -74,6 +74,7 @@ do ...@@ -74,6 +74,7 @@ do
--allele $(bzcat "$MODELS_DIR/train_data.csv.bz2" | cut -f 1 -d , | grep -v allele | uniq | sort | uniq) \ --allele $(bzcat "$MODELS_DIR/train_data.csv.bz2" | cut -f 1 -d , | grep -v allele | uniq | sort | uniq) \
--verbosity 1 \ --verbosity 1 \
--worker-log-dir "$SCRATCH_DIR/$DOWNLOAD_NAME" \ --worker-log-dir "$SCRATCH_DIR/$DOWNLOAD_NAME" \
--prediction-batch-size 524288 \
--cluster-parallelism \ --cluster-parallelism \
--cluster-submit-command bsub \ --cluster-submit-command bsub \
--cluster-results-workdir ~/mhcflurry-scratch \ --cluster-results-workdir ~/mhcflurry-scratch \
......
...@@ -18,6 +18,7 @@ export PYTHONUNBUFFERED=1 ...@@ -18,6 +18,7 @@ export PYTHONUNBUFFERED=1
export KMP_SETTINGS=1 export KMP_SETTINGS=1
set -e set -e
set -x
free -m free -m
module add cuda/10.0.130 cudnn/7.1.1 module add cuda/10.0.130 cudnn/7.1.1
......
...@@ -80,6 +80,11 @@ parser.add_argument( ...@@ -80,6 +80,11 @@ parser.add_argument(
nargs=2, nargs=2,
help="Min and max peptide length to calibrate, inclusive. " help="Min and max peptide length to calibrate, inclusive. "
"Default: %(default)s") "Default: %(default)s")
parser.add_argument(
"--prediction-batch-size",
type=int,
default=4096,
help="Keras batch size for predictions")
parser.add_argument( parser.add_argument(
"--verbosity", "--verbosity",
type=int, type=int,
...@@ -149,7 +154,10 @@ def run(argv=sys.argv[1:]): ...@@ -149,7 +154,10 @@ def run(argv=sys.argv[1:]):
GLOBAL_DATA["args"] = { GLOBAL_DATA["args"] = {
'motif_summary': args.motif_summary, 'motif_summary': args.motif_summary,
'summary_top_peptide_fractions': args.summary_top_peptide_fraction, 'summary_top_peptide_fractions': args.summary_top_peptide_fraction,
'verbose': args.verbosity > 0 'verbose': args.verbosity > 0,
'model_kwargs': {
'batch_size': args.prediction_batch_size,
}
} }
del encoded_peptides del encoded_peptides
...@@ -222,13 +230,20 @@ def calibrate_percentile_ranks( ...@@ -222,13 +230,20 @@ def calibrate_percentile_ranks(
peptides=None, peptides=None,
motif_summary=False, motif_summary=False,
summary_top_peptide_fractions=[0.001], summary_top_peptide_fractions=[0.001],
verbose=False): verbose=False,
model_kwargs={}):
if verbose:
print("Calibrating", allele)
start = time.time()
summary_results = predictor.calibrate_percentile_ranks( summary_results = predictor.calibrate_percentile_ranks(
peptides=peptides, peptides=peptides,
alleles=[allele], alleles=[allele],
motif_summary=motif_summary, motif_summary=motif_summary,
summary_top_peptide_fractions=summary_top_peptide_fractions, summary_top_peptide_fractions=summary_top_peptide_fractions,
verbose=verbose) verbose=verbose,
model_kwargs=model_kwargs)
if verbose:
print("Done calibrating", allele, "in", time.time() - start, "sec")
transforms = { transforms = {
allele: predictor.allele_to_percent_rank_transform[allele], allele: predictor.allele_to_percent_rank_transform[allele],
} }
......
...@@ -1157,7 +1157,8 @@ class Class1AffinityPredictor(object): ...@@ -1157,7 +1157,8 @@ class Class1AffinityPredictor(object):
bins=None, bins=None,
motif_summary=False, motif_summary=False,
summary_top_peptide_fractions=[0.001], summary_top_peptide_fractions=[0.001],
verbose=False): verbose=False,
model_kwargs={}):
""" """
Compute the cumulative distribution of ic50 values for a set of alleles Compute the cumulative distribution of ic50 values for a set of alleles
over a large universe of random peptides, to enable computing quantiles in over a large universe of random peptides, to enable computing quantiles in
...@@ -1208,7 +1209,8 @@ class Class1AffinityPredictor(object): ...@@ -1208,7 +1209,8 @@ class Class1AffinityPredictor(object):
length_distributions = None length_distributions = None
for (i, allele) in enumerate(alleles): for (i, allele) in enumerate(alleles):
start = time.time() start = time.time()
predictions = self.predict(encoded_peptides, allele=allele) predictions = self.predict(
encoded_peptides, allele=allele, model_kwargs=model_kwargs)
if verbose: if verbose:
elapsed = time.time() - start elapsed = time.time() - start
print( print(
......
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