Skip to content
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

Fix Scan Identifier: Unknown Marker requiring a library file #1986

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Contributors:
* Philip Wenig - initial API and implementation
* Alexander Kerner - Generics
* Christoph Läubrich - add method to check if target is valid, ad generics
* Christoph Läubrich - add method to check if target is valid, add generics
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.xxd.calculator.supplier.amdiscalri.impl;

Expand All @@ -24,7 +24,7 @@
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.core.MassSpectrumIdentifierFile;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.core.PeakIdentifierFile;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.IFileIdentifierSettings;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.MassSpectrumIdentifierSettings;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.MassSpectrumLibraryIdentifierSettings;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.PeakIdentifierSettings;
import org.eclipse.chemclipse.model.identifier.IIdentificationTarget;
import org.eclipse.chemclipse.model.identifier.IPeakIdentificationResults;
Expand Down Expand Up @@ -75,7 +75,7 @@ public IProcessingInfo<IMassSpectra> runIdentification(List<IScanMSD> massSpectr
/*
* Create the file identifier settings.
*/
MassSpectrumIdentifierSettings fileIdentifierSettings = new MassSpectrumIdentifierSettings();
MassSpectrumLibraryIdentifierSettings fileIdentifierSettings = new MassSpectrumLibraryIdentifierSettings();
initializeSettings(fileIdentifierSettings);
transferAlkaneSettings(fileIdentifierSettings, alkaneSettings);
/*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*******************************************************************************
* Copyright (c) 2024 Lablicate GmbH.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Philip Wenig - initial API and implementation
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.xxd.calculator.supplier.amdiscalri.settings;

import org.eclipse.chemclipse.model.identifier.AbstractIdentifierSettings;

import com.fasterxml.jackson.annotation.JsonProperty;

public class AbstractAlkaneSettings extends AbstractIdentifierSettings implements IAlkaneSettings {

@JsonProperty(value = "Number of Targets", defaultValue = "15")
private int numberOfTargets = 15;
@JsonProperty(value = "Min Match Factor", defaultValue = "80.0")
private float minMatchFactor = 80.0f;
@JsonProperty(value = "Min Reverse Match Factor", defaultValue = "80.0")
private float minReverseMatchFactor = 80.0f;

@Override
public int getNumberOfTargets() {

return numberOfTargets;
}

@Override
public void setNumberOfTargets(int numberOfTargets) {

this.numberOfTargets = numberOfTargets;
}

@Override
public float getMinMatchFactor() {

return minMatchFactor;
}

@Override
public void setMinMatchFactor(float minMatchFactor) {

this.minMatchFactor = minMatchFactor;
}

@Override
public float getMinReverseMatchFactor() {

return minReverseMatchFactor;
}

@Override
public void setMinReverseMatchFactor(float minReverseMatchFactor) {

this.minReverseMatchFactor = minReverseMatchFactor;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*******************************************************************************
* Copyright (c) 2024 Lablicate GmbH.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Philip Wenig - initial API and implementation
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.xxd.calculator.supplier.amdiscalri.settings;

public interface IAlkaneSettings {

int getNumberOfTargets();

void setNumberOfTargets(int numberOfTargets);

float getMinMatchFactor();

void setMinMatchFactor(float minMatchFactor);

float getMinReverseMatchFactor();

void setMinReverseMatchFactor(float minReverseMatchFactor);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,52 +11,7 @@
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.xxd.calculator.supplier.amdiscalri.settings;

import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.MassSpectrumIdentifierSettings;
import org.eclipse.chemclipse.chromatogram.msd.identifier.settings.IMassSpectrumIdentifierSettings;

import com.fasterxml.jackson.annotation.JsonProperty;

public class MassSpectrumIdentifierAlkaneSettings extends MassSpectrumIdentifierSettings {

@JsonProperty(value = "Number of Targets", defaultValue = "15")
private int numberOfTargets = 15;
@JsonProperty(value = "Min Match Factor", defaultValue = "80.0")
private float minMatchFactor = 80.0f;
@JsonProperty(value = "Min Reverse Match Factor", defaultValue = "80.0")
private float minReverseMatchFactor = 80.0f;

@Override
public int getNumberOfTargets() {

return numberOfTargets;
}

@Override
public void setNumberOfTargets(int numberOfTargets) {

this.numberOfTargets = numberOfTargets;
}

@Override
public float getMinMatchFactor() {

return minMatchFactor;
}

@Override
public void setMinMatchFactor(float minMatchFactor) {

this.minMatchFactor = minMatchFactor;
}

@Override
public float getMinReverseMatchFactor() {

return minReverseMatchFactor;
}

@Override
public void setMinReverseMatchFactor(float minReverseMatchFactor) {

this.minReverseMatchFactor = minReverseMatchFactor;
}
public class MassSpectrumIdentifierAlkaneSettings extends AbstractAlkaneSettings implements IMassSpectrumIdentifierSettings {
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,6 @@
package org.eclipse.chemclipse.chromatogram.xxd.calculator.supplier.amdiscalri.settings;

import org.eclipse.chemclipse.chromatogram.msd.identifier.settings.IPeakIdentifierSettingsMSD;
import org.eclipse.chemclipse.model.identifier.AbstractIdentifierSettings;

import com.fasterxml.jackson.annotation.JsonProperty;

public class PeakIdentifierAlkaneSettings extends AbstractIdentifierSettings implements IPeakIdentifierSettingsMSD {

@JsonProperty(value = "Number of Targets", defaultValue = "15")
private int numberOfTargets = 15;
@JsonProperty(value = "Min Match Factor", defaultValue = "80.0")
private float minMatchFactor = 80.0f;
@JsonProperty(value = "Min Reverse Match Factor", defaultValue = "80.0")
private float minReverseMatchFactor = 80.0f;

public int getNumberOfTargets() {

return numberOfTargets;
}

public void setNumberOfTargets(int numberOfTargets) {

this.numberOfTargets = numberOfTargets;
}

public float getMinMatchFactor() {

return minMatchFactor;
}

public void setMinMatchFactor(float minMatchFactor) {

this.minMatchFactor = minMatchFactor;
}

public float getMinReverseMatchFactor() {

return minReverseMatchFactor;
}

public void setMinReverseMatchFactor(float minReverseMatchFactor) {

this.minReverseMatchFactor = minReverseMatchFactor;
}
public class PeakIdentifierAlkaneSettings extends AbstractAlkaneSettings implements IPeakIdentifierSettingsMSD {
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
id="org.eclipse.chemclipse.chromatogram.msd.identifier.supplier.file.massSpectrum"
identifier="org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.core.MassSpectrumIdentifierFile"
identifierName="Library File (MS)"
identifierSettings="org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.MassSpectrumIdentifierSettings">
identifierSettings="org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.MassSpectrumLibraryIdentifierSettings">
</MassSpectrumIdentificationSupplier>
<MassSpectrumIdentificationSupplier
description="This plugin sets a mass spectrum identification using the highest intensity m/z values."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2014, 2023 Lablicate GmbH.
* Copyright (c) 2014, 2024 Lablicate GmbH.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand All @@ -19,7 +19,7 @@
import org.eclipse.chemclipse.chromatogram.msd.identifier.settings.IMassSpectrumIdentifierSettings;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.internal.identifier.FileIdentifier;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.preferences.PreferenceSupplier;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.MassSpectrumIdentifierSettings;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.MassSpectrumLibraryIdentifierSettings;
import org.eclipse.chemclipse.msd.model.core.IMassSpectra;
import org.eclipse.chemclipse.msd.model.core.IScanMSD;
import org.eclipse.chemclipse.processing.core.IProcessingInfo;
Expand All @@ -34,8 +34,8 @@ public IProcessingInfo<IMassSpectra> identify(List<IScanMSD> massSpectraList, IM
IProcessingInfo<IMassSpectra> processingInfo = new ProcessingInfo<>();
//
try {
MassSpectrumIdentifierSettings massSpectrumIdentifierSettings;
if(identifierSettings instanceof MassSpectrumIdentifierSettings settings) {
MassSpectrumLibraryIdentifierSettings massSpectrumIdentifierSettings;
if(identifierSettings instanceof MassSpectrumLibraryIdentifierSettings settings) {
massSpectrumIdentifierSettings = settings;
} else {
massSpectrumIdentifierSettings = PreferenceSupplier.getMassSpectrumIdentifierSettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.IUnknownSettingsMSD;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.IUnknownSettingsWSD;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.IdentifierSettings;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.MassSpectrumIdentifierSettings;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.MassSpectrumLibraryIdentifierSettings;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.MassSpectrumUnknownSettings;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.PeakIdentifierSettings;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.PeakUnknownSettingsCSD;
Expand Down Expand Up @@ -182,9 +182,9 @@ private void setUnknownValues(String postfix) {
putDefault(P_INCLUDE_RETENTION_INDEX_UNKNOWN + postfix, Boolean.toString(DEF_INCLUDE_RETENTION_INDEX_UNKNOWN));
}

public static MassSpectrumIdentifierSettings getMassSpectrumIdentifierSettings() {
public static MassSpectrumLibraryIdentifierSettings getMassSpectrumIdentifierSettings() {

MassSpectrumIdentifierSettings settings = new MassSpectrumIdentifierSettings();
MassSpectrumLibraryIdentifierSettings settings = new MassSpectrumLibraryIdentifierSettings();
initialize(settings);
//
return settings;
Expand Down Expand Up @@ -244,7 +244,6 @@ public static MassSpectrumUnknownSettings getMassSpectrumUnknownSettings() {

String postfix = POSTFIX_MSD;
MassSpectrumUnknownSettings settings = new MassSpectrumUnknownSettings();
settings.setMassSpectrumComparatorId("");
initalizeUnknownSettings(settings, postfix);
settings.setNumberOfMZ(INSTANCE().getInteger(P_NUMBER_OF_MZ_UNKNOWN + postfix, DEF_NUMBER_OF_MZ_UNKNOWN));
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;

public class MassSpectrumIdentifierSettings extends AbstractMassSpectrumIdentifierSettings implements ILibraryIdentifierSettings {
public class MassSpectrumLibraryIdentifierSettings extends AbstractMassSpectrumIdentifierSettings implements ILibraryIdentifierSettings {

@JsonProperty(value = "Library File", defaultValue = "")
@JsonPropertyDescription("Select the library file.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,17 @@
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings;

import org.eclipse.chemclipse.chromatogram.msd.identifier.settings.IMassSpectrumIdentifierSettings;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.preferences.PreferenceSupplier;
import org.eclipse.chemclipse.model.identifier.IIdentifierSettings;
import org.eclipse.chemclipse.model.identifier.AbstractIdentifierSettings;
import org.eclipse.chemclipse.support.settings.FloatSettingsProperty;
import org.eclipse.chemclipse.support.settings.IntSettingsProperty;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;

public class MassSpectrumUnknownSettings extends MassSpectrumIdentifierSettings implements IUnknownSettingsMSD {
public class MassSpectrumUnknownSettings extends AbstractIdentifierSettings implements IUnknownSettingsMSD, IMassSpectrumIdentifierSettings {

@JsonProperty(value = "Limit Match Factor", defaultValue = "80.0")
@JsonPropertyDescription(value = "Run an identification if no target exists with a Match Factor >= the given limit.")
@FloatSettingsProperty(minValue = IIdentifierSettings.MIN_LIMIT_MATCH_FACTOR, maxValue = IIdentifierSettings.MAX_LIMIT_MATCH_FACTOR)
private float limitMatchFactor = 80.0f;
@JsonProperty(value = "Target Name", defaultValue = PreferenceSupplier.DEF_TARGET_NAME_UNKNOWN)
private String targetName = "Unknown";
@JsonProperty(value = "Match Quality", defaultValue = "80.0")
Expand All @@ -48,18 +45,6 @@ public class MassSpectrumUnknownSettings extends MassSpectrumIdentifierSettings
@JsonProperty(value = "Include Retention Index", defaultValue = "false")
private boolean includeRetentionIndex = false;

@Override
public float getLimitMatchFactor() {

return limitMatchFactor;
}

@Override
public void setLimitMatchFactor(float limitMatchFactor) {

this.limitMatchFactor = limitMatchFactor;
}

@Override
public String getTargetName() {

Expand All @@ -84,11 +69,6 @@ public void setMatchQuality(float matchQuality) {
this.matchQuality = matchQuality;
}

public int getNumberOfMZ() {

return numberOfMZ;
}

@Override
public int getNumberOfTraces() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.core.MassSpectrumIdentifierFile;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.core.PeakIdentifierFile;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.IFileIdentifierSettings;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.MassSpectrumIdentifierSettings;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.MassSpectrumLibraryIdentifierSettings;
import org.eclipse.chemclipse.chromatogram.xxd.identifier.supplier.file.settings.PeakIdentifierSettings;
import org.eclipse.chemclipse.model.identifier.ComparisonResult;
import org.eclipse.chemclipse.model.identifier.IComparisonResult;
Expand Down Expand Up @@ -189,7 +189,7 @@ public void identifyMassSpectra(List<IScanMSD> massSpectrumList, IBasePeakSettin
/*
* Post identify NOTFOUND peaks.
*/
MassSpectrumIdentifierSettings massSpectrumIdentifierSettings = new MassSpectrumIdentifierSettings();
MassSpectrumLibraryIdentifierSettings massSpectrumIdentifierSettings = new MassSpectrumLibraryIdentifierSettings();
setIdentifierSettings(massSpectrumIdentifierSettings);
setFileIdentifierSettings(massSpectrumIdentifierSettings);
MassSpectrumIdentifierFile massSpectrumIdentifier = new MassSpectrumIdentifierFile();
Expand Down
Loading