Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [chemclipse-dev] Build a dummy Chromatogram

Have a look here:

org.eclipse.chemclipse.msd.model.fragment.test
org.eclipse.chemclipse.msd.model.implementation.ChromatogramPeak_5_Test


Am 06.09.2016 um 17:13 schrieb Alexander Kerner:

Hi Philip,

that seems to work! I forgot to add a scan to the chromatogram.

But the question now is how are PeakIntensityValues and a Scan's ions connected? They seem to be two different things..

Best,

Alex

~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Alexander Kerner » Software developer » alexander.kerner@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~
On 09/06/2016 02:52 PM, Philip Wenig wrote:
Hi Alex,

you can only set peaks within a valid range of the chromatogram. This is necessary, cause the purity is calculated when setting the peak.

To create a demo chromatogram, have a look here:

org.eclipse.chemclipse.msd.model.fragment.test
org.eclipse.chemclipse.msd.model.implementation.Chromatogram_11_Test


Best,
Philip

Am 06.09.2016 um 11:52 schrieb Alexander Kerner:

Hi Philip,

how to properly initialize ChromatogramMSD?

 org.eclipse.chemclipse.model.exceptions.PeakException: The start and stop retention times of the peak must be within the chromatogram retention time borders.
    at org.eclipse.chemclipse.model.core.AbstractPeak.validateRetentionTimes(AbstractPeak.java:246)
Best,

Alex

~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Alexander Kerner » Software developer » alexander.kerner@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~
On 09/06/2016 11:46 AM, Alexander Kerner wrote:

Hi Philip,

thanks, that seems to work. Now I need an instance of IChromatogram to build the peak.

Im trying to use ChromatogramMSD, which relies on an available PreferenceSupplier.

Im refactoring the constructor to not fail if the PreferenceSupplier is not available.

What would be a reasonable default value for

PreferenceSupplier.getSelectedSegmentWidth()
?

Best,

Alex

~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Alexander Kerner » Software developer » alexander.kerner@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~
On 09/06/2016 10:55 AM, Philip Wenig wrote:
Hi Alex,

that's from the peak model.

The peak intensity model stores relative values. A peak consists of the peak intensity values and a peak maximum (e.g. a mass spectrum). The peak maximum has a total intensity, though each intensity along the retention time scale of the peak can be calculated by using the total intensity of the peak maximum multiplied by the relative intensity value at the given retention time.

Normally, the MAX_INTENSITY is 100.0f, see:
org.eclipse.chemclipse.model.core.IPeakIntensityValues

To calculate percentage values, the max values needs to be known. If other max values than 100.0f are used, you can run the normalize() method after putting your values to the model.

void normalize();


Best,
Philip

Am 06.09.2016 um 10:44 schrieb Alexander Kerner:

Hi all,

Anyone can help me out with this one?

Exception in thread "pool-1-thread-3" org.eclipse.chemclipse.model.exceptions.PeakException: There must be at least one intensity value stored with a relative intensity of IPeakIntensityValues.MAX_INTENSITY.
    at org.eclipse.chemclipse.model.core.AbstractPeakModel.checkModelConditions(AbstractPeakModel.java:403)
    at org.eclipse.chemclipse.model.core.AbstractPeakModel.calculatePeakModel(AbstractPeakModel.java:482)
    at org.eclipse.chemclipse.model.core.AbstractPeakModel.<init>(AbstractPeakModel.java:91)
    at org.eclipse.chemclipse.msd.model.core.AbstractPeakModelMSD.<init>(AbstractPeakModelMSD.java:28)
    at org.eclipse.chemclipse.msd.model.implementation.PeakModelMSD.<init>(PeakModelMSD.java:28)


Im tying to build a dummy peak for JUnit and feeding the model like this:

PeakIntensityValues result = new PeakIntensityValues();
    for (int i = 1; i < 10; i++) {
        result.addIntensityValue(i, i);
    }
    return result;

Best,

Alex

~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Alexander Kerner » Software developer » alexander.kerner@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~
On 09/06/2016 05:03 AM, Trig Chen wrote:
HDF5 concurrent read & write test code snippet:

package hdf5;

import java.io.PrintStream;
import java.util.Arrays;
import java.util.Random;

import ch.systemsx.cisd.hdf5.HDF5Factory;
import ch.systemsx.cisd.hdf5.IHDF5SimpleReader;
import ch.systemsx.cisd.hdf5.IHDF5SimpleWriter;

public class Hdf5Test {
static final String hdf5FileName = "myfile.h5";
static final String tag = "mydata";

public static void main(final String[] args) {

// write thread
new Thread(new Runnable() {
@Override
public void run() {
final IHDF5SimpleWriter writer = HDF5Factory.open(hdf5FileName);
final Random r = new Random();
for (int i = 0; i < 10; i++) {
pause(500);
final float[] data = "" float[1000];
for (int n = 0; n < data.length; n++) {
data[n] = r.nextFloat() * 10000f;
}
writer.writeFloatArray(tag + i, data);
printData(data, 5, System.out);
}
writer.close();
}
}).start();

pause(1000);
// read thread
new Thread(new Runnable() {
@Override
public void run() {
final IHDF5SimpleReader reader = HDF5Factory.open(hdf5FileName);
for (int i = 0; i < 10; i++) {
pause(600);
float[] mydata = new float[1000];
mydata = reader.readFloatArray(tag + i);
printData(mydata, 5, System.err);
}
reader.close();
}
}).start();

}

private static void pause(final int millisecond) {
try {
Thread.sleep(millisecond);
} catch (final InterruptedException e) {
e.printStackTrace();
}
}

private static void printData(final float[] data, final int size, final PrintStream out) {
if ((data == null) || (data.length < size)) {
return;
}
final float[] temp = new float[size];
System.arraycopy(data, 0, temp, 0, size);
out.println(Arrays.toString(temp));
}
}



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



_______________________________________________
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
~~~~~~~~~~~~~~~~~~~~~~~~


_______________________________________________
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



_______________________________________________
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



_______________________________________________
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
~~~~~~~~~~~~~~~~~~~~~~~~


_______________________________________________
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



_______________________________________________
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