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

[REFACTOR] function to copy spectrum meta data / settings #3913

Merged
merged 14 commits into from
Dec 27, 2021

Conversation

hroest
Copy link
Contributor

@hroest hroest commented Jan 8, 2019

extract single function to copy spectral settings (but not data) from one spectrum to another

src/openms/include/OpenMS/KERNEL/SpectrumHelper.h Outdated Show resolved Hide resolved
output.setRT(input.getRT());
output.setMSLevel(input.getMSLevel());
output.setName(input.getName());
output.setType(SpectrumSettings::CENTROID);
Copy link
Contributor

Choose a reason for hiding this comment

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

output.setType(SpectrumSettings::CENTROID);
output.getFloatDataArrays().clear();

are effectively removed now. But it seems like they are needed.

output[scan_idx].setRT(input[scan_idx].getRT());
output[scan_idx].setMSLevel(input[scan_idx].getMSLevel());
output[scan_idx].setName(input[scan_idx].getName());
output[scan_idx].setType(SpectrumSettings::CENTROID);
Copy link
Contributor

Choose a reason for hiding this comment

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

information of type lost.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm I see, this is not just copying over the settings but over-writing it.

@timosachsenberg
Copy link
Contributor

otherwise +1

@cbielow
Copy link
Contributor

cbielow commented Jan 24, 2019

what about the MetaInfoInterface::operator=? That is not done here, right? (i.e. get"s lost)

@hroest
Copy link
Contributor Author

hroest commented Jan 26, 2019

what about the MetaInfoInterface::operator=? That is not done here, right? (i.e. get"s lost)

MSSpectrum does not inherit directly from MetaInfoInterface, so that should be covered by SpectrumSettings:

class OPENMS_DLLAPI MSSpectrum :
private std::vector<Peak1D>,
public RangeManager<1>,
public SpectrumSettings

@timosachsenberg timosachsenberg changed the title [FIX] extract function [REFACTOR] function to copy spectrum meta data / settings Dec 27, 2021
@timosachsenberg
Copy link
Contributor

tests passed according to cdash

@timosachsenberg timosachsenberg merged commit 3103eb8 into OpenMS:develop Dec 27, 2021
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.

None yet

3 participants