-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: #1294: Added ability to process MV4 homework
--- docs: #1294: Added homework instructions and updated debug client models changelog. chore: #1294: Updated SQL queries. refactor: #1294: Yield Genotype matcher response as enumerable prevent memory exceptions. refactor: #1294: Use IEnumerable when bulk inserting to reduce memory usage. chore: #1294: Add SQL to select out chore: #1294: Store matching genotypes refactor: #1294: Move match prediction debug models to debug client models namespace. chore: #1294: Add HLA version to homework set. chore: #1294: SQL for selecting out homework subjects with missing HLA. chore: #1294: Process all sets imported found in a directory. chore: #1294: Import pdps directly from file. chore: #1294: Detect subjects with missing HLA. chore: #1294: Add functions to submit MV4 homework request. chore: #1294: Add genotype count to debug model, genotype matcher response.
- Loading branch information
Showing
97 changed files
with
8,269 additions
and
133 deletions.
There are no files selected for viewing
4 changes: 1 addition & 3 deletions
4
...otypeFrequencySet/FrequencySetMetadata.cs → ...s/MatchPrediction/FrequencySetMetadata.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...Models/Debug/GenotypeImputationRequest.cs → ...chPrediction/GenotypeImputationRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...odels/Debug/GenotypeImputationResponse.cs → ...hPrediction/GenotypeImputationResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...ns/Models/Debug/GenotypeMatcherRequest.cs → ...MatchPrediction/GenotypeMatcherRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ion.Functions/Models/Debug/SubjectInfo.cs → ...ent.Models/MatchPrediction/SubjectInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using Newtonsoft.Json; | ||
using Polly; | ||
|
||
namespace Atlas.ManualTesting.Common.Services | ||
{ | ||
public class AtlasHttpResult<TResult> | ||
{ | ||
public bool WasSuccess => Result != null; | ||
public TResult? Result { get; set; } | ||
|
||
public AtlasHttpResult(TResult? result) | ||
{ | ||
Result = result; | ||
} | ||
} | ||
|
||
public abstract class AtlasHttpRequester | ||
{ | ||
private readonly HttpClient httpRequestClient; | ||
private readonly string requestUrl; | ||
|
||
protected AtlasHttpRequester(HttpClient httpRequestClient, string requestUrl) | ||
{ | ||
this.httpRequestClient = httpRequestClient; | ||
this.requestUrl = requestUrl; | ||
} | ||
|
||
protected async Task<AtlasHttpResult<TResult>> PostRequest<TRequest, TResult>(TRequest request) | ||
{ | ||
var retryPolicy = Policy.Handle<Exception>().RetryAsync(10); | ||
|
||
var requestResponse = await retryPolicy.ExecuteAndCaptureAsync( | ||
async () => await SendRequest<TRequest, TResult>(request)); | ||
|
||
return new AtlasHttpResult<TResult>(requestResponse.Result); | ||
} | ||
|
||
private async Task<TResult?> SendRequest<TRequest, TResult>(TRequest request) | ||
{ | ||
try | ||
{ | ||
var response = await httpRequestClient.PostAsync( | ||
requestUrl, new StringContent(JsonConvert.SerializeObject(request))); | ||
response.EnsureSuccessStatusCode(); | ||
|
||
return JsonConvert.DeserializeObject<TResult>(await response.Content.ReadAsStringAsync()); | ||
} | ||
catch (Exception ex) | ||
{ | ||
System.Diagnostics.Debug.WriteLine($"Failed to send request {request}. Details: {ex.Message} " + | ||
"Re-attempting until success or re-attempt count reached."); | ||
throw; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Atlas.MatchPrediction.Functions/Functions/Debug/GenotypeLikelihoodFunctions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.