Skip to content

Commit

Permalink
Fixed #819 - Skip peak validation in edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
eselmeister committed Nov 23, 2021
1 parent 9e19b33 commit 29597d2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.eclipse.chemclipse.model.identifier.IIdentificationTarget;
import org.eclipse.chemclipse.model.implementation.TripleQuadMethod;
import org.eclipse.chemclipse.model.notifier.IChromatogramSelectionUpdateNotifier;
import org.eclipse.chemclipse.model.preferences.PreferenceSupplier;
import org.eclipse.chemclipse.model.processor.IChromatogramProcessor;
import org.eclipse.chemclipse.model.selection.IChromatogramSelection;
import org.eclipse.chemclipse.model.signals.ITotalScanSignalExtractor;
Expand Down Expand Up @@ -1091,7 +1092,14 @@ public int getNumberOfPeaks() {
@Override
public void addPeak(T peak) {

if(peak.getPeakModel().getWidthByInflectionPoints() > 0) {
boolean addPeak = false;
if(PreferenceSupplier.isSkipPeakWidthCheck()) {
addPeak = true;
} else {
addPeak = peak.getPeakModel().getWidthByInflectionPoints() > 0;
}
//
if(addPeak) {
peaks.addPeak(peak);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public class PreferenceSupplier implements IPreferenceSupplier {
public static final String DEF_BEST_TARGET_LIBRARY_FIELD = LibraryField.NAME.name();
public static final String P_ION_ROUND_METHOD = "ionRoundMethod"; // When changing this value, call clearCacheActiveIonRoundMethod.
public static final String DEF_ION_ROUND_METHOD = IonRoundMethod.DEFAULT.name();
public static final String P_SKIP_PEAK_WIDTH_CHECK = "skipPeakWidthCheck";
public static final boolean DEF_SKIP_PEAK_WIDTH_CHECK = false;
//
public static final String P_LIST_PATH_IMPORT = "listPathImport";
public static final String DEF_LIST_PATH_IMPORT = "";
Expand Down Expand Up @@ -100,6 +102,7 @@ public Map<String, String> getDefaultValues() {
defaultValues.put(P_USE_RETENTION_INDEX_QC, Boolean.toString(DEF_USE_RETENTION_INDEX_QC));
defaultValues.put(P_BEST_TARGET_LIBRARY_FIELD, DEF_BEST_TARGET_LIBRARY_FIELD);
defaultValues.put(P_ION_ROUND_METHOD, DEF_ION_ROUND_METHOD);
defaultValues.put(P_SKIP_PEAK_WIDTH_CHECK, Boolean.toString(DEF_SKIP_PEAK_WIDTH_CHECK));
defaultValues.put(P_LIST_PATH_IMPORT, DEF_LIST_PATH_IMPORT);
defaultValues.put(P_LIST_PATH_EXPORT, DEF_LIST_PATH_EXPORT);
defaultValues.put(P_SEPARATION_COLUMN_MAPPINGS, DEF_SEPARATION_COLUMN_MAPPINGS);
Expand Down Expand Up @@ -227,6 +230,11 @@ public static void setIonRoundMethod(IonRoundMethod ionRoundMethod) {
activeIonRoundMethod = ionRoundMethod;
}

public static boolean isSkipPeakWidthCheck() {

return getBoolean(P_SKIP_PEAK_WIDTH_CHECK, DEF_SKIP_PEAK_WIDTH_CHECK);
}

public static String getListPathImport() {

return getFilterPath(P_LIST_PATH_IMPORT, DEF_LIST_PATH_IMPORT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ protected void createFieldEditors() {
addField(new BooleanFieldEditor(PreferenceSupplier.P_USE_RETENTION_INDEX_QC, "QC: Use Retention Index", getFieldEditorParent()));
addField(new ComboFieldEditor(PreferenceSupplier.P_BEST_TARGET_LIBRARY_FIELD, "Best Target", LibraryField.getOptions(), getFieldEditorParent()));
addField(new ComboFieldEditor(PreferenceSupplier.P_ION_ROUND_METHOD, "Ion Round Method", IonRoundMethod.getOptions(), getFieldEditorParent()));
addField(new BooleanFieldEditor(PreferenceSupplier.P_SKIP_PEAK_WIDTH_CHECK, "Skip Peak Width Check (Only enable this in edge cases!)", getFieldEditorParent()));
//
addField(new SpacerFieldEditor(getFieldEditorParent()));
addField(new DirectoryFieldEditor(PreferenceSupplier.P_LIST_PATH_IMPORT, "Mappings Import Folder", getFieldEditorParent()));
Expand Down

0 comments on commit 29597d2

Please sign in to comment.