|
1 | 1 | ## AbstractMassObject |
2 | | -if (is.null(getGeneric("plotMsiSlice"))) { |
3 | | - setGeneric("plotMsiSlice", function(x, ...) standardGeneric("plotMsiSlice")) |
4 | | -} |
5 | | -if (is.null(getGeneric(".prepareShow"))) { |
6 | | - setGeneric(".prepareShow", function(object) standardGeneric(".prepareShow")) |
7 | | -} |
8 | | -if (is.null(getGeneric("transformIntensity"))) { |
9 | | - setGeneric("transformIntensity", |
10 | | - function(object, ...) standardGeneric("transformIntensity")) |
11 | | -} |
12 | | -if (is.null(getGeneric(".transformIntensity"))) { |
13 | | - setGeneric(".transformIntensity", |
14 | | - function(object, ...) standardGeneric(".transformIntensity")) |
15 | | -} |
16 | | -if (is.null(getGeneric("trim"))) { |
17 | | - setGeneric("trim", function(object, range, ...) standardGeneric("trim")) |
18 | | -} |
| 2 | +setGeneric("plotMsiSlice", function(x, ...) standardGeneric("plotMsiSlice")) |
| 3 | +setGeneric(".prepareShow", function(object) standardGeneric(".prepareShow")) |
| 4 | +setGeneric( |
| 5 | + "transformIntensity", |
| 6 | + function(object, ...) standardGeneric("transformIntensity") |
| 7 | +) |
| 8 | +setGeneric( |
| 9 | + ".transformIntensity", |
| 10 | + function(object, ...) standardGeneric(".transformIntensity") |
| 11 | +) |
| 12 | +setGeneric("trim", function(object, range, ...) standardGeneric("trim")) |
19 | 13 |
|
20 | 14 | ## get/set slots |
21 | | -if (is.null(getGeneric("mass"))) { |
22 | | - setGeneric("mass", function(object, ...) standardGeneric("mass")) |
23 | | -} |
24 | | -if (is.null(getGeneric("mass<-"))) { |
25 | | - setGeneric("mass<-", function(object, value) standardGeneric("mass<-")) |
26 | | -} |
| 15 | +setGeneric("mass", function(object, ...) standardGeneric("mass")) |
| 16 | +setGeneric("mass<-", function(object, value) standardGeneric("mass<-")) |
| 17 | + |
27 | 18 | # from ProtGenerics (same as mass) |
28 | | -if (is.null(getGeneric("mz"))) { |
29 | | - setGeneric("mz", function(object, ...) standardGeneric("mz")) |
30 | | -} |
31 | | -if (is.null(getGeneric("mz<-"))) { |
32 | | - setGeneric("mz<-", function(object, value) standardGeneric("mz<-")) |
33 | | -} |
34 | | -if (is.null(getGeneric("intensity"))) { |
35 | | - setGeneric("intensity", function(object, ...) standardGeneric("intensity")) |
36 | | -} |
37 | | -if (is.null(getGeneric("intensity<-"))) { |
38 | | - setGeneric("intensity<-", |
39 | | - function(object, value) standardGeneric("intensity<-")) |
40 | | -} |
41 | | -if (is.null(getGeneric("isEmpty"))) { |
42 | | - setGeneric("isEmpty", function(x) standardGeneric("isEmpty")) |
43 | | -} |
44 | | -if (is.null(getGeneric(".isEmptyWarning"))) { |
45 | | - setGeneric(".isEmptyWarning", function(x) standardGeneric(".isEmptyWarning")) |
46 | | -} |
47 | | -if (is.null(getGeneric("metaData"))) { |
48 | | - setGeneric("metaData", function(object) standardGeneric("metaData")) |
49 | | -} |
50 | | -if (is.null(getGeneric("metaData<-"))) { |
51 | | - setGeneric("metaData<-", |
52 | | - function(object, value) standardGeneric("metaData<-")) |
53 | | -} |
54 | | -if (is.null(getGeneric("coordinates"))) { |
55 | | - setGeneric("coordinates", |
56 | | - function(object, ...) standardGeneric("coordinates")) |
57 | | -} |
58 | | -if (is.null(getGeneric("coordinates<-"))) { |
59 | | - setGeneric("coordinates<-", |
60 | | - function(object, value) standardGeneric("coordinates<-")) |
61 | | -} |
| 19 | +setGeneric("mz", function(object, ...) standardGeneric("mz")) |
| 20 | +setGeneric("mz<-", function(object, value) standardGeneric("mz<-")) |
62 | 21 |
|
| 22 | +setGeneric("intensity", function(object, ...) standardGeneric("intensity")) |
| 23 | +setGeneric( |
| 24 | + "intensity<-", |
| 25 | + function(object, value) standardGeneric("intensity<-") |
| 26 | +) |
| 27 | +setGeneric("isEmpty", function(x) standardGeneric("isEmpty")) |
| 28 | +setGeneric(".isEmptyWarning", function(x) standardGeneric(".isEmptyWarning")) |
| 29 | +setGeneric("metaData", function(object) standardGeneric("metaData")) |
| 30 | +setGeneric("metaData<-", function(object, value) standardGeneric("metaData<-")) |
| 31 | +setGeneric("coordinates", function(object, ...) standardGeneric("coordinates")) |
| 32 | +setGeneric( |
| 33 | + "coordinates<-", |
| 34 | + function(object, value) standardGeneric("coordinates<-") |
| 35 | +) |
63 | 36 | ## end of AbstractMassObject |
64 | 37 |
|
65 | 38 | ## MassSpectrum |
66 | | -if (is.null(getGeneric("calibrateIntensity"))) { |
67 | | - setGeneric("calibrateIntensity", |
68 | | - function(object, ...) standardGeneric("calibrateIntensity")) |
69 | | -} |
70 | | -if (is.null(getGeneric("detectPeaks"))) { |
71 | | - setGeneric("detectPeaks", |
72 | | - function(object, ...) standardGeneric("detectPeaks")) |
73 | | -} |
74 | | -if (is.null(getGeneric("estimateBaseline"))) { |
75 | | - setGeneric("estimateBaseline", |
76 | | - function(object, method=c("SNIP", "ConvexHull", "Median"), ...) |
77 | | - standardGeneric("estimateBaseline")) |
78 | | -} |
79 | | -if (is.null(getGeneric("estimateNoise"))) { |
80 | | - setGeneric("estimateNoise", |
81 | | - function(object, ...) standardGeneric("estimateNoise")) |
82 | | -} |
83 | | -if (is.null(getGeneric(".findLocalMaxima"))) { |
84 | | - setGeneric(".findLocalMaxima", |
85 | | - function(object, halfWindowSize=20L) |
86 | | - standardGeneric(".findLocalMaxima")) |
87 | | -} |
88 | | -if (is.null(getGeneric(".findLocalMaximaLogical"))) { |
89 | | - setGeneric(".findLocalMaximaLogical", |
90 | | - function(object, halfWindowSize=20L) |
91 | | - standardGeneric(".findLocalMaximaLogical")) |
92 | | -} |
93 | | -if (is.null(getGeneric("isRegular"))) { |
94 | | - setGeneric("isRegular", |
95 | | - function(object, ...) standardGeneric("isRegular")) |
96 | | -} |
97 | | -if (is.null(getGeneric("removeBaseline"))) { |
98 | | - setGeneric("removeBaseline", |
99 | | - function(object, ...) standardGeneric("removeBaseline")) |
100 | | -} |
101 | | -if (is.null(getGeneric("smoothIntensity"))) { |
102 | | - setGeneric("smoothIntensity", |
103 | | - function(object, ...) |
104 | | - standardGeneric("smoothIntensity")) |
105 | | -} |
106 | | -if (is.null(getGeneric("totalIonCurrent"))) { |
107 | | - setGeneric("totalIonCurrent", |
108 | | - function(object) standardGeneric("totalIonCurrent")) |
109 | | -} |
| 39 | +setGeneric( |
| 40 | + "calibrateIntensity", |
| 41 | + function(object, ...) standardGeneric("calibrateIntensity") |
| 42 | +) |
| 43 | +setGeneric("detectPeaks", function(object, ...) standardGeneric("detectPeaks")) |
| 44 | +setGeneric( |
| 45 | + "estimateBaseline", |
| 46 | + function(object, method=c("SNIP", "ConvexHull", "Median"), ...) |
| 47 | + standardGeneric("estimateBaseline")) |
| 48 | +setGeneric( |
| 49 | + "estimateNoise", function(object, ...) standardGeneric("estimateNoise") |
| 50 | +) |
| 51 | +setGeneric( |
| 52 | + ".findLocalMaxima", |
| 53 | + function(object, halfWindowSize=20L) standardGeneric(".findLocalMaxima") |
| 54 | +) |
| 55 | +setGeneric( |
| 56 | + ".findLocalMaximaLogical", |
| 57 | + function(object, halfWindowSize=20L) |
| 58 | + standardGeneric(".findLocalMaximaLogical") |
| 59 | +) |
| 60 | +setGeneric("isRegular", function(object, ...) standardGeneric("isRegular")) |
| 61 | +setGeneric( |
| 62 | + "removeBaseline", function(object, ...) standardGeneric("removeBaseline") |
| 63 | +) |
| 64 | +setGeneric( |
| 65 | + "smoothIntensity", function(object, ...) standardGeneric("smoothIntensity") |
| 66 | +) |
| 67 | +setGeneric( |
| 68 | + "totalIonCurrent", function(object) standardGeneric("totalIonCurrent") |
| 69 | +) |
110 | 70 | ## end of MassSpectrum |
111 | 71 |
|
112 | 72 | ## MassPeaks |
113 | | -if (is.null(getGeneric("labelPeaks"))) { |
114 | | - setGeneric("labelPeaks", function(object, ...) standardGeneric("labelPeaks")) |
115 | | -} |
116 | | -if (is.null(getGeneric("monoisotopicPeaks"))) { |
117 | | - setGeneric("monoisotopicPeaks", |
118 | | - function(object, ...) standardGeneric("monoisotopicPeaks")) |
119 | | -} |
120 | | -if (is.null(getGeneric("snr"))) { |
121 | | - setGeneric("snr", function(object) standardGeneric("snr")) |
122 | | -} |
| 73 | +setGeneric("labelPeaks", function(object, ...) standardGeneric("labelPeaks")) |
| 74 | +setGeneric( |
| 75 | + "monoisotopicPeaks", |
| 76 | + function(object, ...) standardGeneric("monoisotopicPeaks") |
| 77 | +) |
| 78 | +setGeneric("snr", function(object) standardGeneric("snr")) |
123 | 79 | ## end of MassPeaks |
0 commit comments