Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@SteffenHeu
Copy link
Member

No description provided.

robinschmid
robinschmid previously approved these changes Nov 8, 2024
Copy link
Member

@robinschmid robinschmid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one question if we could just rename the new class to PolarityTypeType.
Could be useful to have a single PolarityType data type that can be used in CompoundDBAnnotation, SpectralLibraryEntry, FeatureListRow

Can be merged like this or after rename

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class MsChromatogramPolarityType extends DataType<PolarityType> implements NullColumnType,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this be just PolarityType (which we also do not have yet but maybe useful in MS feature list if we ever get to merge polarities in one list)
Or is this required to be more specific by its name?
Also it could be a column that just shows + or - as text?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for feature lists we should rely on the feature.getRepresentativeSpectrum.getPolarity, because it is directly connected to the raw data. That's why the name is so specific. For libraries we usually know what adduct it is and can rely on that.

If we want to expand this, we should add setting of the polarity in the feature data utils.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could make sense. For the feature it could be a linked data type.
One issue is that sometimes we dont have a representative scan so this may be null.
So could be still valid to put a simple PolarityTypeType.
But we can do this once we merge across polarity

return unit;
}

public static ActivationMethod fromActivationType(ActivationType type) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could annotate argument as @nullable
And could then simplify the caller and remove the null check there. But optional.

final ActivationMethod method = activationInfo != null ? ActivationMethod.fromActivationType(
activationInfo.getActivationType()) : null;
final ActivationMethod method = ActivationMethod.fromActivationType(
activationInfo != null ? activationInfo.getActivationType() : null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true still required the null check, sorry thought it would make it easier but its only a little bit easier to call

@robinschmid robinschmid merged commit 7be27d2 into mzmine:master Nov 11, 2024
6 checks passed
@SteffenHeu SteffenHeu deleted the mrm branch November 11, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants