Skip to content

Commit

Permalink
feat(fastani): Add option to have results e-mailed to user.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmussig committed Apr 2, 2023
1 parent 9668370 commit 3bcb408
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions assets/api/fastani.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export interface FastAniJobRequest {
reference: string[],
parameters: FastAniParameters
priority: string
email?: string | null
}

export interface FastAniParameters {
Expand Down Expand Up @@ -96,6 +97,7 @@ export interface FastAniResult {

export interface FastAniConfig {
maxPairwise: number
maxPairwiseLow: number,
}

export enum FastAniHeatmapDataStatus {
Expand Down
20 changes: 18 additions & 2 deletions pages/tools/fastani.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
</p>
<p>
Note that requests that use more than <b>{{ fastAniMaxPairwise.toLocaleString() }}</b> pairwise
comparisons will be processed in the low priority queue ({{ curNumPairwise.toLocaleString() }} used).
comparisons will be processed in the low priority queue (<b>{{ curNumPairwise.toLocaleString() }}</b> used).<br>
There is a maximum of <b>{{ fastAniMaxPairwiseLow.toLocaleString() }}</b> pairwise comparisons allowed in total.
</p>
<v-btn
:disabled="isJobLoading"
Expand Down Expand Up @@ -230,6 +231,15 @@
</v-col>
</v-row>

<v-row justify="center" no-gutters>
<v-text-field
v-model="email"
label="E-mail (optional)"
outlined
clearable
></v-text-field>
</v-row>

<v-row justify="center" no-gutters>
<v-btn
:disabled="isSubmitButtonDisabled || !isFormValid || isJobLoading"
Expand Down Expand Up @@ -456,10 +466,12 @@ export default Vue.extend({
// FastANI Config
const fastAniConfig = await $api.fastani.getConfig();
const fastAniMaxPairwise = fastAniConfig.data.maxPairwise;
const fastAniMaxPairwiseLow = fastAniConfig.data.maxPairwiseLow;
// Merge with data
return {
fastAniMaxPairwise,
fastAniMaxPairwiseLow
}
},
Expand Down Expand Up @@ -512,6 +524,7 @@ export default Vue.extend({
// Config
fastAniMaxPairwise: 1000,
fastAniMaxPairwiseLow: 10000,
// Add genomes from taxon button
modalAddGenomesFromTaxonVisible: false,
Expand All @@ -525,6 +538,8 @@ export default Vue.extend({
modalFastAniPriorityQueueVisible: false,
fastAniPriorityQueueSecret: '',
fastAniPriorityQueueCookieName: 'fastAniPriorityQueueSecret',
email: '',
}),
computed: {
// Returns True if the form can be submitted
Expand Down Expand Up @@ -557,7 +572,8 @@ export default Vue.extend({
min_frac: this.minAlignmentFraction,
version: this.fastAniVersion
},
priority: this.fastAniPriorityQueueSecret
priority: this.fastAniPriorityQueueSecret,
email: this.email
}
},
curNumPairwise(): number {
Expand Down

0 comments on commit 3bcb408

Please sign in to comment.