(allmz, allint, allim, imCenterIdx, imWidth, base_int, baseFragmentMz = 100, nr_peaks = NR_PEAKS, im_bins=IM_BINS, imWinLim=None)
| 60 | # nr_peaks = number of fragment peaks to create |
| 61 | # imWinLim = window limits of IM, do not plot anything outside of this window |
| 62 | def createMS2Precursor(allmz, allint, allim, imCenterIdx, imWidth, base_int, baseFragmentMz = 100, nr_peaks = NR_PEAKS, im_bins=IM_BINS, imWinLim=None): |
| 63 | if imWinLim is None: |
| 64 | for im_idx in range(*im_bins): |
| 65 | for i in range(nr_peaks): |
| 66 | if (imCenterIdx - imWidth) < im_idx < (imCenterIdx + imWidth): |
| 67 | apex_dist = abs( imCenterIdx - im_idx) |
| 68 | p = Peak1D() |
| 69 | p.setMZ(baseFragmentMz+i) |
| 70 | p.setIntensity(base_int * (i + 1) - base_int * (i + 1) * apex_dist / imWidth) |
| 71 | allmz.append(p.getMZ()) |
| 72 | allint.append(p.getIntensity()) |
| 73 | allim.append( im_idx / 500.0) |
| 74 | else: # have to check if in range of IM upper limit |
| 75 | for im_idx in range(*im_bins): |
| 76 | for i in range(nr_peaks): |
| 77 | if (imCenterIdx - imWidth) < im_idx < (imCenterIdx + imWidth) and (imWinLim[0] < im_idx < imWinLim[1] ): |
| 78 | apex_dist = abs( imCenterIdx - im_idx) |
| 79 | p = Peak1D() |
| 80 | p.setMZ(baseFragmentMz+i) |
| 81 | p.setIntensity(base_int * (i + 1) - base_int * (i + 1) * apex_dist / imWidth) |
| 82 | allmz.append(p.getMZ()) |
| 83 | allint.append(p.getIntensity()) |
| 84 | allim.append( im_idx / 500.0) |
| 85 | |
| 86 | |
| 87 | # add values to spectrum across IM corresponding with a precursor |
no test coverage detected