-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add iterative searcher to Foldseek #97
base: master
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,102 +35,147 @@ | |
v-model="query"> | ||
</query-textarea> | ||
|
||
<div class="actions input-buttons-panel"> | ||
<div class="input-buttons-left"> | ||
<load-acession-button v-if="$APP == 'foldseek'" @select="query = $event" @loading="accessionLoading = $event" :preload-source="preloadSource" :preload-accession="preloadAccession"></load-acession-button> | ||
<file-button id="file" :label="$STRINGS.UPLOAD_LABEL" v-on:upload="upload"></file-button> | ||
<PredictStructureButton v-if="$APP == 'foldseek'" :query="query" v-model="predictable" v-on:predict="query = $event"></PredictStructureButton> | ||
<file-button id="localFile" label="Upload previous results" @upload="uploadJSON"></file-button> | ||
</div> | ||
</div> | ||
</template> | ||
</panel> | ||
</v-flex> | ||
<v-flex xs12> | ||
<panel collapsible collapsed render-collapsed> | ||
<template slot="header"> | ||
<template v-if="!$vuetify.breakpoint.smAndDown"> | ||
Databases | ||
</template> | ||
<template v-else> | ||
DBs | ||
</template> | ||
& search settings | ||
</template> | ||
<div slot="content"> | ||
<databases | ||
:selected="database" | ||
:all-databases="databases" | ||
@update:selected="database = $event" | ||
@update:all-databases="databases = $event" | ||
:hideEmail="hideEmail" | ||
></databases> | ||
<div class="actions input-buttons-panel"> | ||
<div class="input-buttons-left"> | ||
<load-acession-button v-if="$APP == 'foldseek'" @select="query = $event" @loading="accessionLoading = $event" :preload-source="preloadSource" :preload-accession="preloadAccession"></load-acession-button> | ||
<file-button id="file" :label="$STRINGS.UPLOAD_LABEL" v-on:upload="upload"></file-button> | ||
<PredictStructureButton v-if="$APP == 'foldseek'" :query="query" v-model="predictable" v-on:predict="query = $event"></PredictStructureButton> | ||
</div> | ||
<file-button id="localFile" label="Upload previous results" @upload="uploadJSON"></file-button> | ||
</div> | ||
</template> | ||
</panel> | ||
</v-flex> | ||
<v-flex xs12> | ||
<!-- Databases Section --> | ||
<panel collapsible collapsed> | ||
<template slot="header"> | ||
<template v-if="!$vuetify.breakpoint.smAndDown"> | ||
Databases | ||
</template> | ||
<template v-else> | ||
DBs | ||
</template> | ||
</template> | ||
<div slot="content"> | ||
<!-- Existing Database Selection --> | ||
<div class="input-group"> | ||
<v-tooltip open-delay="300" top> | ||
<template v-slot:activator="{ on }"> | ||
<label v-on="on">Databases <v-icon color="#FFFFFFB3" style="margin-top:-3px" small v-on="on">{{ $MDI.HelpCircleOutline }}</v-icon></label> | ||
</template> | ||
<span v-if="$ELECTRON || hideEmail">Choose the databases to search against and the result mode.</span> | ||
<span v-else>Choose the databases to search against, the result mode, and optionally an email to notify you when the job is done.</span> | ||
</v-tooltip> | ||
</div> | ||
|
||
<template v-if="databases.length > 0"> | ||
<v-checkbox v-for="(db, index) in databases" v-model="database" :key="index" :value="db.path" :label="db.name + ' ' + db.version" :append-icon="(db.status == 'ERROR' || db.status == 'UNKNOWN') ? $MDI.AlertCircleOutline : ((db.status == 'PENDING' || db.status == 'RUNNING') ? $MDI.ProgressWrench : undefined)" :disabled="db.status != 'COMPLETE'" hide-details></v-checkbox> | ||
</template> | ||
|
||
<div v-if="databasesNotReady" class="alert alert-info mt-1"> | ||
<span>Databases are loading...</span> | ||
</div> | ||
</div> | ||
</panel> | ||
|
||
<v-radio-group v-model="mode"> | ||
<v-tooltip open-delay="300" top> | ||
<template v-slot:activator="{ on }"> | ||
<label v-on="on">Mode <v-icon color="#FFFFFFB3" style="margin-top:-3px" small v-on="on">{{ $MDI.HelpCircleOutline }}</v-icon></label> | ||
<!-- Search Parameters Section --> | ||
<panel collapsible collapsed> | ||
<template slot="header"> | ||
<template v-if="!$vuetify.breakpoint.smAndDown"> | ||
Search Parameters | ||
</template> | ||
<template v-else> | ||
Params | ||
</template> | ||
</template> | ||
<span v-html="$STRINGS.MODE_HELP"></span> | ||
</v-tooltip> | ||
<v-radio hide-details | ||
v-for="i in ($STRINGS.MODE_COUNT - 0)" | ||
:key="i" | ||
:value="$STRINGS['MODE_KEY_' + i]" | ||
:label="$STRINGS['MODE_TITLE_' + i]" | ||
></v-radio> | ||
</v-radio-group> | ||
<div slot="content"> | ||
<!-- Mode Section --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please revert unrelated changes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
<v-radio-group v-model="mode"> | ||
<v-tooltip open-delay="300" top> | ||
<template v-slot:activator="{ on }"> | ||
<label v-on="on">Mode <v-icon color="#FFFFFFB3" style="margin-top:-3px" small v-on="on">{{ $MDI.HelpCircleOutline }}</v-icon></label> | ||
</template> | ||
<span v-html="$STRINGS.MODE_HELP"></span> | ||
</v-tooltip> | ||
<v-radio hide-details | ||
v-for="i in ($STRINGS.MODE_COUNT - 0)" | ||
:key="i" | ||
:value="$STRINGS['MODE_KEY_' + i]" | ||
:label="$STRINGS['MODE_TITLE_' + i]"> | ||
</v-radio> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please revert the whitespace changes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
</v-radio-group> | ||
|
||
<TaxonomyAutocomplete v-model="taxFilter"></TaxonomyAutocomplete> | ||
<TaxonomyAutocomplete v-model="taxFilter"></TaxonomyAutocomplete> | ||
|
||
<v-tooltip v-if="!$ELECTRON && !hideEmail" open-delay="300" top> | ||
<template v-slot:activator="{ on }"> | ||
<v-text-field v-on="on" label="Notification Email (Optional)" placeholder="[email protected]" v-model="email"></v-text-field> | ||
</template> | ||
<span>Send an email when the job is done.</span> | ||
</v-tooltip> | ||
</div> | ||
</panel> | ||
</v-flex> | ||
<v-flex> | ||
<panel> | ||
<template slot="content"> | ||
<div class="actions" :style="!$vuetify.breakpoint.xsOnly ?'display:flex; align-items: center;' : null"> | ||
<v-item-group class="v-btn-toggle"> | ||
<v-btn color="primary" :block="false" x-large v-on:click="search" :disabled="searchDisabled"><v-icon>{{ $MDI.Magnify }}</v-icon> Search</v-btn> | ||
<v-btn v-if="isMultimer" color="secondary" :block="false" x-large v-on:click="goToMultimer"><v-icon>{{ $MDI.Multimer }}</v-icon> Go to Multimer</v-btn> | ||
</v-item-group> | ||
<div :style="!$vuetify.breakpoint.xsOnly ? 'margin-left: 1em;' : 'margin-top: 1em;'"> | ||
<span><strong>Summary</strong></span><br> | ||
Search <template v-if="taxFilter"> | ||
<strong>{{ taxFilter.text }}</strong> in | ||
</template> | ||
<template v-if="database.length == databases.length"> | ||
<strong>all available</strong> databases | ||
<v-divider class="my-2"></v-divider> | ||
|
||
<v-radio-group v-model="iterativeSearch"> | ||
<v-tooltip open-delay="300" top> | ||
<template v-slot:activator="{ on }"> | ||
<label v-on="on"> | ||
Iterative search | ||
<v-icon color="#FFFFFFB3" style="margin-top:-3px" small v-on="on">{{ $MDI.HelpCircleOutline }}</v-icon> | ||
</label> | ||
</template> | ||
<span>Improve sensitivity of search by performing an iterative search (--num-iterations 3).</span> | ||
</v-tooltip> | ||
|
||
<v-radio label="On" :value="true"></v-radio> | ||
<v-radio label="Off" :value="false"></v-radio> | ||
</v-radio-group> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please keep email in addition to the new iterative search There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
</div> | ||
</panel> | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove empty newlines There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
</v-flex> | ||
<v-flex> | ||
<panel> | ||
<template slot="content"> | ||
<div class="actions" :style="!$vuetify.breakpoint.xsOnly ?'display:flex; align-items: center;' : null"> | ||
<v-btn color="primary" :block="$vuetify.breakpoint.xsOnly" x-large v-on:click="search" :disabled="searchDisabled"><v-icon>{{ $MDI.Magnify }}</v-icon> Search</v-btn> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please restore previous changes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
<div :style="!$vuetify.breakpoint.xsOnly ? 'margin-left: 1em;' : 'margin-top: 1em;'"> | ||
<span><strong>Summary</strong></span><br> | ||
Search <template v-if="taxFilter"> | ||
<strong>{{ taxFilter.text }}</strong> in | ||
</template> | ||
<template v-if="database.length == databases.length"> | ||
<strong>all available</strong> databases | ||
</template> | ||
<template v-else> | ||
<strong>{{ database.length }}</strong> | ||
<template v-if="database.length == 1"> | ||
database | ||
</template> | ||
<template v-else> | ||
databases | ||
</template> | ||
({{ | ||
databases.filter(db => database.includes(db.path)).map(db => db.name).sort().join(", ") | ||
}}) | ||
</template> with {{ $STRINGS.APP_NAME }} in <strong>{{ modes[mode] }}</strong> mode<span v-if="iterativeSearch"><strong> iterative</strong></span>. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add iterative to beginning of sentence There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why? |
||
<div v-if="errorMessage != ''" class="v-alert v-alert--outlined warning--text mt-2"> | ||
<span>{{ errorMessage }}</span> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
<template v-else> | ||
<strong>{{ database.length }}</strong> | ||
<template v-if="database.length == 1"> | ||
database | ||
</template> | ||
<template v-else> | ||
databases | ||
</template> | ||
({{ | ||
databases.filter(db => database.includes(db.path)).map(db => db.name).sort().join(", ") | ||
}}) | ||
</template> with {{ $STRINGS.APP_NAME }} in <strong>{{ modes[mode] }}</strong> mode. | ||
<div v-if="errorMessage != ''" class="v-alert v-alert--outlined warning--text mt-2"> | ||
<span>{{ errorMessage }}</span> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
</panel> | ||
</panel> | ||
</v-flex> | ||
</v-layout> | ||
<v-layout wrap> | ||
<v-flex xs12> | ||
<v-card rounded="0"> | ||
<v-card-title primary-title class="pb-0 mb-0"> | ||
<div class="text-h5 mb-0">Reference</div> | ||
</v-card-title> | ||
<v-card-title primary-title class="pt-0 mt-0"> | ||
<p class="text-subtitle-2 mb-0" v-html="$STRINGS.CITATION"></p> | ||
</v-card-title> | ||
</v-card> | ||
</v-flex> | ||
</v-layout> | ||
<reference :reference="$STRINGS.CITATION"></reference> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please restore the previous version There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
</v-container> | ||
</v-container> | ||
</template> | ||
|
||
<script> | ||
|
@@ -168,14 +213,16 @@ export default { | |
return { | ||
inSearch: false, | ||
errorMessage: "", | ||
mode: storage.getItem('mode') || this.$STRINGS.MODE_DEFAULT_KEY, | ||
showCurl: false, | ||
mode: this.$STRINGS.MODE_DEFAULT_KEY, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please restore the previous version There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
modes: Array.from({length: this.$STRINGS.MODE_COUNT - 0}, (_, i) => i + 1) | ||
.reduce((dict, i, _) => { dict[this.$STRINGS['MODE_KEY_' + i]] = this.$STRINGS['MODE_TITLE_' + i]; return dict; }, {}), | ||
email: storage.getItem('email') || "", | ||
hideEmail: true, | ||
query: "", | ||
database: JSON.parse(storage.getItem('database') || '[]'), | ||
databases: JSON.parse(storage.getItem('databases') || '[]'), | ||
iterativeSearch: JSON.parse(storage.getItem('iterativeSearch') || false), | ||
taxFilter: JSON.parse(storage.getItem('taxFilter') || 'null'), | ||
predictable: false, | ||
accessionLoading: false, | ||
|
@@ -193,6 +240,18 @@ export default { | |
} else { | ||
this.query = this.$STRINGS.QUERY_DEFAULT; | ||
} | ||
if (localStorageEnabled && localStorage.database) { | ||
this.database = JSON.parse(localStorage.database); | ||
} | ||
if (localStorageEnabled && localStorage.databases) { | ||
this.databases = JSON.parse(localStorage.databases); | ||
} | ||
if (localStorageEnabled && localStorage.iterativeSearch) { | ||
this.iterativeSearch = JSON.parse(localStorage.iterativeSearch); | ||
} | ||
if (localStorageEnabled && localStorage.taxFilter) { | ||
this.taxFilter = JSON.parse(localStorage.taxFilter); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These should be set somewhere else, they were removed in the last refactoring There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
}, | ||
computed: { | ||
searchDisabled() { | ||
|
@@ -235,6 +294,9 @@ export default { | |
databases(value) { | ||
storage.setItem('databases', JSON.stringify(value)); | ||
}, | ||
iterativeSearch(value) { | ||
storage.setItem('iterativeSearch', JSON.stringify(value)); | ||
}, | ||
taxFilter(value) { | ||
storage.setItem('taxFilter', JSON.stringify(value)); | ||
}, | ||
|
@@ -245,7 +307,8 @@ export default { | |
q: this.query, | ||
database: this.database, | ||
mode: this.mode, | ||
email: this.email | ||
email: this.email, | ||
iterativesearch: this.iterativeSearch | ||
}; | ||
if (__APP__ == "foldseek" && typeof(request.q) === 'string' && request.q != '') { | ||
if (request.q[request.q.length - 1] != '\n') { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert unrelated changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done