@tests: SpectrumAlignment SpectrumAlignment.__init__ SpectrumAlignment.getSpectrumAlignment
()
| 116 | |
| 117 | @report |
| 118 | def testSpectrumAlignment(): |
| 119 | """ |
| 120 | @tests: SpectrumAlignment |
| 121 | SpectrumAlignment.__init__ |
| 122 | SpectrumAlignment.getSpectrumAlignment |
| 123 | """ |
| 124 | # test existence of some methods |
| 125 | pyopenms.SpectrumAlignment |
| 126 | pyopenms.SpectrumAlignment.__init__ |
| 127 | pyopenms.SpectrumAlignment.getDefaults |
| 128 | pyopenms.SpectrumAlignment.getParameters |
| 129 | pyopenms.SpectrumAlignment.setParameters |
| 130 | |
| 131 | spec = pyopenms.MSSpectrum() |
| 132 | p = pyopenms.Peak1D() |
| 133 | p.setMZ(1000.0) |
| 134 | p.setIntensity(200.0) |
| 135 | spec.push_back(p) |
| 136 | p.setMZ(2000.0) |
| 137 | p.setIntensity(200.0) |
| 138 | spec.push_back(p) |
| 139 | |
| 140 | rich_spec = pyopenms.MSSpectrum() |
| 141 | p = pyopenms.Peak1D() |
| 142 | p.setMZ(1000.001) |
| 143 | p.setIntensity(200.0) |
| 144 | rich_spec.push_back(p) |
| 145 | p.setMZ(2000.001) |
| 146 | p.setIntensity(200.0) |
| 147 | rich_spec.push_back(p) |
| 148 | p.setMZ(3000.001) |
| 149 | p.setIntensity(200.0) |
| 150 | rich_spec.push_back(p) |
| 151 | |
| 152 | aligner = pyopenms.SpectrumAlignment() |
| 153 | result = [] |
| 154 | |
| 155 | aligner.getSpectrumAlignment(result, spec, spec) |
| 156 | assert result == [ (0,0), (1,1) ], result |
| 157 | aligner.getSpectrumAlignment(result, rich_spec, spec) |
| 158 | assert result == [ (0,0), (1,1) ], result |
| 159 | aligner.getSpectrumAlignment(result, spec, rich_spec) |
| 160 | assert result == [ (0,0), (1,1) ], result |
| 161 | aligner.getSpectrumAlignment(result, rich_spec, rich_spec) |
| 162 | assert result == [ (0,0), (1,1), (2,2) ], result |
| 163 | |
| 164 | aligner = pyopenms.SpectrumAlignmentScore() |
| 165 | assert isinstance(aligner(spec), float) |
| 166 | assert isinstance(aligner(rich_spec), float) |
| 167 | |
| 168 | assert isinstance(aligner(spec, rich_spec), float) |
| 169 | assert isinstance(aligner(rich_spec, spec), float) |
| 170 | |
| 171 | assert isinstance(aligner(spec, spec), float) |
| 172 | assert isinstance(aligner(rich_spec, rich_spec), float) |
| 173 | |
| 174 | @report |
| 175 | def testAASequence(): |
nothing calls this directly
no test coverage detected