Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [chemclipse-dev] Performance problem of AbstractScanMSD.addIon(boolean, IIon)

This is another tricky part of the core platform. Generally, you have the options:

A) to add the same ion (m/z + abundance) twice - this causes serious problems when exporting to e.g. CDF with other software tools

B) add the ion and replace the intensity of an existing ion

C) add the ion and select the higher intensity of both if they have the same m/z value

D) merge both intensities


Best,
Philip


Am 20.10.2016 um 10:44 schrieb Trig Chen:
In method org.eclipse.chemclipse.msd.model.core.AbstractScanMSD.addIon(boolean, IIon),
there is a loop to check duplicated ion:
for(IIon actualIon : ionsList) {
if(checkIon(ion, actualIon)) {
/*
* Check whether the intensity should be added or only the
* higher intensity should be taken.<br/> Replace the abundance
* only, if the abundance is higher than the older one otherwise
* do nothing
*/
if(addIntensity) {
addIntensities(actualIon, ion);
addNew = false;
break;
} else {
if(ion.getAbundance() >= actualIon.getAbundance()) {
addHigherIntensity(actualIon, ion);
addNew = false;
break;
} else {
addNew = false;
break;
}
}
}
}

This loop will break if checkIon() return true. If I have a large amounts of ions to add to scan, it will cost more time in addIon() method.
The ions to be added are increasing generally, so there might be two aspects to improve this procedure.
1) iterate the ionsList reversely. It will meet the same ion earlierly and break earlierly.
2) if the ion to be added is greater the last ion in ionsList, it is no necessary to loop the ionsList to check duplication.

How about it?

Best regards,

Trig


_______________________________________________
chemclipse-dev mailing list
chemclipse-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/chemclipse-dev

-- 
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder » philip.wenig@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~

Back to the top