Skip to content

Commit

Permalink
Missed cleavage handling always enabled now
Browse files Browse the repository at this point in the history
  • Loading branch information
pverscha committed Aug 8, 2024
1 parent 5441b5f commit cc6b1e0
Show file tree
Hide file tree
Showing 11 changed files with 226 additions and 245 deletions.
6 changes: 3 additions & 3 deletions src/components/analysis/AnalysisSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
:horizontal="true"
:equate-il.sync="equateIl"
:filter-duplicates.sync="filterDuplicates"
:missing-cleavage.sync="missedCleavage">
:missing-cleavage="true">
</search-settings-form>

<div class="d-flex justify-center align-center mt-4">
Expand Down Expand Up @@ -120,7 +120,6 @@ import {
ProteomicsAssay,
CountTable,
Peptide,
SearchSettingsForm,
SearchConfiguration,
PeptideTrust,
Pept2DataCommunicator,
Expand All @@ -139,6 +138,7 @@ import AnalysisSourceSelect from "@/components/assay/AnalysisSourceSelect.vue";
import ConfigurationManager from "@/logic/configuration/ConfigurationManager";
import CustomDatabase from "@/logic/custom_database/CustomDatabase";
import ExportResultsButton from "@/components/analysis/ExportResultsButton.vue";
import SearchSettingsForm from "@/components/analysis/SearchSettingsForm.vue";
@Component({
components: { PeptideSummaryTable, SearchSettingsForm, ExportResultsButton, Tooltip, AnalysisSourceSelect }
Expand Down Expand Up @@ -323,7 +323,7 @@ export default class AnalysisSummary extends Vue {
}
private update() {
const config = new SearchConfiguration(this.equateIl, this.filterDuplicates, this.missedCleavage);
const config = new SearchConfiguration(this.equateIl, this.filterDuplicates, true);
this.assay.setSearchConfiguration(config);
this.assay.setAnalysisSource(this.analysisSource);
Expand Down
110 changes: 110 additions & 0 deletions src/components/analysis/CustomTooltip.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<template>
<div
class="tooltip-wrapper"
@mouseenter="startShowTooltipTimer"
@mouseleave="cancelShowTooltipTimer"
>
<slot></slot>
<div
v-if="visible"
class="custom-tooltip"
ref="tooltip"
@mouseenter="cancelHideTooltipTimer"
@mouseleave="startHideTooltipTimer"
>
Missed cleavage handling is now always enabled. Because of a change in
Unipept's underlying search engine, enabling missed cleavage handling no
longer results in a performance penalty. As a result, this configuration
option will be removed in a future release. See
<a
href="https://github.com/unipept/unipept/wiki/Unipept-Next"
target="_blank"
rel="noopener noreferrer"
class="text-white"
>this page</a>
for more information.
</div>
</div>
</template>

<script lang="ts">
import { Vue, Component } from 'vue-property-decorator';
@Component
export default class CustomTooltip extends Vue {
visible = false;
showTooltipTimer: number | null = null;
hideTooltipTimer: number | null = null;
startShowTooltipTimer() {
this.cancelHideTooltipTimer();
if (this.showTooltipTimer !== null) {
clearTimeout(this.showTooltipTimer);
this.showTooltipTimer = null;
}
this.showTooltipTimer = window.setTimeout(() => {
this.visible = true;
}, 300);
}
cancelShowTooltipTimer() {
if (this.showTooltipTimer !== null) {
clearTimeout(this.showTooltipTimer);
this.showTooltipTimer = null;
}
this.startHideTooltipTimer();
}
startHideTooltipTimer() {
this.cancelHideTooltipTimer();
this.hideTooltipTimer = window.setTimeout(() => {
this.visible = false;
}, 1000);
}
cancelHideTooltipTimer() {
if (this.hideTooltipTimer !== null) {
clearTimeout(this.hideTooltipTimer);
this.hideTooltipTimer = null;
}
}
}
</script>

<style scoped>
.tooltip-wrapper {
position: relative;
display: inline-block;
overflow: visible;
}
.custom-tooltip {
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
background-color: #323232;
color: #fff;
padding: 8px;
border-radius: 4px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
z-index: 1000;
margin-bottom: 8px;
transition: opacity 0.2s ease-in-out;
pointer-events: auto;
max-width: 400px;
width: max-content;
overflow: hidden;
white-space: normal;
line-height: 1.4;
}
.custom-tooltip a {
color: #1e88e5;
text-decoration: underline;
}
.custom-tooltip a:hover {
color: #1565c0;
}
</style>
98 changes: 98 additions & 0 deletions src/components/analysis/SearchSettingsForm.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<template>
<div
:class="{
'search-settings-form': true,
'd-flex': true,
'flex-column': !horizontal,
'flex-row': horizontal,
'justify-space-between': horizontal
}">
<tooltip message="Equate isoleucine (I) and leucine (L) when matching peptides to UniProt entries.">
<v-checkbox :disabled="disabled" v-model="equateIlModel" label="Equate I and L" hide-details class="mt-0">
<span slot="label">Equate I and L</span>
</v-checkbox>
</tooltip>
<tooltip message="Remove duplicate peptides from the input before searching.">
<v-checkbox :disabled="disabled" v-model="filterDuplicatesModel" hide-details class="mt-0">
<span slot="label">Filter duplicate peptides</span>
</v-checkbox>
</tooltip>
<custom-tooltip message="Recombine subpeptides of miscleavages. Enabling this has a serious performance impact!">
<v-checkbox disabled input-value="true" hide-details class="mt-0">
<span slot="label">Advanced missed cleavage handling</span>
</v-checkbox>
</custom-tooltip>
</div>
</template>

<script lang="ts">
import Vue from "vue";
import Component from "vue-class-component";
import { Prop, Watch } from "vue-property-decorator";
import CustomTooltip from "@/components/analysis/CustomTooltip.vue";
import { Tooltip } from "unipept-web-components"
@Component({
components: {
CustomTooltip,
Tooltip
},
computed: {
equateIlModel: {
get() {
return this.equateIl;
},
set(val) {
this.equateIlData = val;
this.$emit("update:equate-il", val);
}
},
filterDuplicatesModel: {
get(): boolean {
return this.filterDuplicates;
},
set(val: boolean) {
this.filterDuplicatesData = val;
this.$emit("update:filter-duplicates", val);
}
},
missingCleavageModel: {
get() {
return this.missingCleavage;
},
set(val) {
this.missingCleavageData = val;
this.$emit("update:missing-cleavage", val);
}
}
}
})
export default class SearchSetingsForm extends Vue {
@Prop({ default: false }) disabled!: boolean;
@Prop({ default: true }) equateIl!: boolean;
@Prop({ default: true }) filterDuplicates!: boolean;
@Prop({ default: false }) missingCleavage!: boolean;
/**
* Show the component in a horizontal or vertical fashion? Set to true to show the different checkboxes on one line.
*/
@Prop({ required: false, default: true })
private horizontal: boolean;
private equateIlData: boolean = this.equateIl;
private filterDuplicatesData: boolean = this.filterDuplicates;
private missingCleavageData: boolean = this.missingCleavage;
@Watch("equateIl") onEquateIlChanged() {
this.equateIlData = this.equateIl;
}
@Watch("filterDuplicates") onFilterDuplicatesChanged() {
this.filterDuplicatesData = this.filterDuplicates;
}
@Watch("missingCleavage") onMissingCleavageChanged() {
this.missingCleavageData = this.missingCleavage;
}
}
</script>
19 changes: 10 additions & 9 deletions src/components/assay/CreateAssayDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,10 @@
</v-simple-checkbox>
</template>
<template v-slot:item.missedCleavage="{ item }">
<v-simple-checkbox v-model="item.searchConfiguration.enableMissingCleavageHandling" color="primary">
</v-simple-checkbox>
<custom-tooltip>
<v-simple-checkbox disabled :value="true" color="primary">
</v-simple-checkbox>
</custom-tooltip>
</template>
<template v-slot:item.actions="{ item }">
<v-tooltip bottom open-delay="500">
Expand Down Expand Up @@ -231,6 +233,7 @@ import ConfigurationManager from "@/logic/configuration/ConfigurationManager";
import AssayFileSystemDataWriter from "@/logic/filesystem/assay/AssayFileSystemDataWriter";
import CustomDatabase from "@/logic/custom_database/CustomDatabase";
import ConfirmDeletionDialog from "@/components/dialogs/ConfirmDeletionDialog.vue";
import CustomTooltip from "@/components/analysis/CustomTooltip.vue";
const { dialog } = require("@electron/remote");
Expand All @@ -250,7 +253,7 @@ type ProteomicsAssayPlaceholder = {
}
@Component({
components: { ConfirmDeletionDialog, AnalysisSourceSelect }
components: { ConfirmDeletionDialog, AnalysisSourceSelect, CustomTooltip }
})
export default class CreateAssayDialog extends Vue {
@Prop({ required: true })
Expand Down Expand Up @@ -345,14 +348,12 @@ export default class CreateAssayDialog extends Vue {
}
get areAllMissedCleavage(): boolean {
return this.assayPlaceholders.every(
(item: ProteomicsAssayPlaceholder) => item.searchConfiguration.enableMissingCleavageHandling
);
return true;
}
set areAllMissedCleavage(value: boolean) {
for (const item of this.assayPlaceholders) {
item.searchConfiguration.enableMissingCleavageHandling = value;
item.searchConfiguration.enableMissingCleavageHandling = true;
}
}
Expand Down Expand Up @@ -550,7 +551,7 @@ export default class CreateAssayDialog extends Vue {
name: this.generateUniqueAssayName("New assay"),
nameError: "",
peptides: "",
searchConfiguration: new SearchConfiguration(),
searchConfiguration: new SearchConfiguration(true, true, true),
analysisSource: this.renderableSources[0],
analysisSourceError: "",
inProgress: false
Expand All @@ -577,7 +578,7 @@ export default class CreateAssayDialog extends Vue {
name: assayName,
nameError: "",
peptides: "",
searchConfiguration: new SearchConfiguration(),
searchConfiguration: new SearchConfiguration(true, true, true),
analysisSource: this.renderableSources[0],
analysisSourceError: "",
inProgress: true
Expand Down
Loading

0 comments on commit cc6b1e0

Please sign in to comment.