def make_scan(self):
        peaks = []
        tids, ions = self.make_tids()
        list(map(peaks.extend, tids))
        peaks.sort(key=lambda x: x.mz)

        mz = np.array([0])
        intensity = np.array([0])

        fpeaks = []
        for p in peaks:
            fpeaks.append(FittedPeak(
                mz=p.mz, intensity=p.intensity, signal_to_noise=p.intensity, peak_count=-1, index=-1,
                full_width_at_half_max=fwhm, area=p.intensity))
        mz, intensity = reprofile(fpeaks)
        scan = common.Scan(
            {
                "id": "test-scan",
                "index": 0,
                "m/z array": mz,
                "intensity array": intensity,
                "ms level": 1,
                "scan time": 0.0,
                "profile spectrum": "",
                "negative scan": "",
            },
            mzml.MzMLDataInterface())
        return scan
Beispiel #2
0
    def make_broken_vendor_scan(self):
        base = self.make_scan()

        class BrokenVendorPeakPickingMzMLDataInterface(mzml.MzMLDataInterface):
            def _pick_peaks_vendor(self, scan, *args, **kwargs):
                raise ValueError("This was a horrible idea.")

        scan = common.Scan(base._data,
                           BrokenVendorPeakPickingMzMLDataInterface())
        return scan
Beispiel #3
0
 def make_scan(self):
     mz, intensity = make_profile(points, fwhm)
     scan = common.Scan(
         {
             "id": "test-scan",
             "index": 0,
             "m/z array": mz,
             "ms level": 1,
             "scan time": 0.0,
             "intensity array": intensity,
             "profile spectrum": "",
             "positive scan": "",
         }, mzml.MzMLDataInterface())
     return scan
Beispiel #4
0
 def make_scan(self):
     mz, intensity = make_profile(points, fwhm)
     scan = common.Scan(
         {
             "id": "test-scan",
             "index": 0,
             "m/z array": mz,
             "ms level": 1,
             "scan time": 0.0,
             "intensity array": intensity,
             "profile spectrum": "",
             "positive scan": "",
         }, mzml.MzMLDataInterface())
     scan.pick_peaks()
     for point in points:
         self.assertIsNotNone(scan.peak_set.has_peak(point[0]))
     return scan
Beispiel #5
0
 def make_scan(self):
     mz, intensity = make_profile(points, fwhm)
     scan = common.Scan(
         {
             "id": "spam",
             "index": 0,
             "ms level": 1,
             "m/z array": mz,
             "intensity array": intensity,
             "profile spectrum": "",
             "positive scan": "",
             "scanList": {
                 "scan": [{
                     "scan start time": 0
                 }]
             }
         }, mzml.MzMLDataInterface())
     return scan
 def get_scan(self):
     scan_data = gzload(datafile("test_scan.pkl.gz"))
     scan = common.Scan(scan_data, mzml.MzMLDataInterface())
     return scan