public IHttpActionResult Put([FromBody] int id, PredictionScore score) { if (score == null) { return(InternalServerError(new Exception("Pediction score not valid"))); } try { // prediction.Player = get the player from the token authentication module OpenPredictionRepository.UpdateScore(id, score); return(Ok()); } catch (Exception ex) { // TODO: Log return(InternalServerError(ex)); } }
public AnnotatedTranscript(ITranscript transcript, string referenceAminoAcids, string alternateAminoAcids, string referenceCodons, string alternateCodons, IMappedPosition mappedPosition, string hgvsCoding, string hgvsProtein, PredictionScore sift, PredictionScore polyphen, List <ConsequenceTag> consequences, bool?completeOverlap) { Transcript = transcript; ReferenceAminoAcids = referenceAminoAcids; AlternateAminoAcids = alternateAminoAcids; ReferenceCodons = referenceCodons; AlternateCodons = alternateCodons; MappedPosition = mappedPosition; HgvsCoding = hgvsCoding; HgvsProtein = hgvsProtein; Sift = sift; PolyPhen = polyphen; Consequences = consequences; CompleteOverlap = completeOverlap; }
public AnnotatedTranscript(ITranscript transcript, string referenceAminoAcids, string alternateAminoAcids, string referenceCodons, string alternateCodons, IMappedPosition mappedPosition, string hgvsCoding, string hgvsProtein, PredictionScore sift, PredictionScore polyphen, IEnumerable <ConsequenceTag> consequences, IGeneFusionAnnotation geneFusionAnnotation) { Transcript = transcript; ReferenceAminoAcids = referenceAminoAcids; AlternateAminoAcids = alternateAminoAcids; ReferenceCodons = referenceCodons; AlternateCodons = alternateCodons; MappedPosition = mappedPosition; HgvsCoding = hgvsCoding; HgvsProtein = hgvsProtein; Sift = sift; PolyPhen = polyphen; Consequences = consequences; GeneFusionAnnotation = geneFusionAnnotation; PluginData = new List <IPluginData>(); }
private PredictionScore getScore(Prediction prediction, PredictionOutcome outcome) { PredictionScore score = new PredictionScore(); if (prediction.FinishDate != null) { var date = (DateTime)prediction.Date; var time = ((DateTime)prediction.Time).ToLocalTime(); time = new DateTime(2013, 12, 10, time.Hour, time.Minute, 0); if (prediction.Gender == outcome.Gender) score.Gender = 3; if (date.Month == outcome.Date.Month && date.Day == outcome.Date.Day) score.Date = 5; var timedif = (outcome.Time - time); if (timedif.TotalHours <= 4 && timedif.TotalHours >= 0) score.Time = 4; if (prediction.Weight <= outcome.Weight && prediction.Weight <= (outcome.Weight + 1.5M)) score.Weight = 2; if (prediction.Length <= outcome.Length && outcome.Length <= prediction.Length + 2M) score.Length = 1; } return score; }