def _save_bunch(self, precursor, products): self.serializer.save(ScanBunch(precursor, products)) try: precursor.clear() for product in products: product.clear() except AttributeError: pass
def save_bunch(self, precursor, products): self.serializer.save_scan_bunch(ScanBunch(precursor, products))
def run(self): writer = AnnotatedMGFSerializer(self.outstream) for spectrum_match in self.spectrum_match_iterable: scan = self.prepare_scan(spectrum_match) writer.save(ScanBunch(None, [scan])) writer.complete()