Example #1
0
    def _activation(self, scan):
        filter_string = self._filter_string(scan)
        tandem_sequence = filter_string.get("tandem_sequence")
        # If the tandem sequence exists, the last entry is the most recent tandem acquisition.
        # It will list contain one or more activation types. Alternatively, multiple activations
        # of the same precursor may exist in the list as separate events in the tandem sequence.
        if tandem_sequence is not None:
            activation_event = tandem_sequence[-1]
            activation_type = list(activation_event.get("activation_type"))
            has_supplemental_activation = filter_string.get("supplemental_activation")

            if activation_type is not None:
                energy = list(activation_event.get("activation_energy"))
                if len(tandem_sequence) > 1:
                    prev_event = tandem_sequence[-2]
                    # Merge previous tandem sequences of the same precursor
                    if abs(prev_event['isolation_mz'] - activation_event['isolation_mz']) < 1e-3:
                        activation_type = list(prev_event.get("activation_type")) + activation_type
                        energy = list(prev_event.get("activation_energy")) + energy
                        has_supplemental_activation = True

                if has_supplemental_activation and len(activation_type) > 1:
                    activation_type.append(supplemental_term_map[
                        dissociation_methods_map[activation_type[-1]]])
                if len(activation_type) == 1:
                    return ActivationInformation(activation_type[0], energy[0])
                else:
                    return MultipleActivationInformation(activation_type, energy)
        return None
Example #2
0
 def _activation(self, scan):
     energy_str = self.info_reader.GetScanItem(
         scan.function, scan.block if scan.block >= 0 else scan.scan,
         MassLynxRawDefs.MassLynxScanItem.COLLISION_ENERGY)
     if energy_str:
         energy = float(energy_str)
         return ActivationInformation(HCD, energy)
Example #3
0
 def _activation(self, scan):
     filter_line = self._filter_line(scan)
     activation_type = filter_line.get("activation_type")
     if activation_type is not None:
         energy = filter_line.get("activation_energy")
         return ActivationInformation(activation_type, energy)
     return None
 def __init__(self,
              scan_time=None,
              neutral_mass=None,
              mz=None,
              intensity=None,
              charge=None,
              precursor_scan_id=None,
              product_scan_id=None,
              defaulted=None,
              orphan=None,
              drift_time=None,
              coisolation=None,
              activation=None,
              **kwargs):
     super(MSnRecord, self).__init__(scan_time, drift_time, **kwargs)
     self.neutral_mass = neutral_mass
     self.mz = mz
     self.intensity = intensity
     self.charge = charge
     self.precursor_scan_id = precursor_scan_id
     self.product_scan_id = product_scan_id
     self.defaulted = defaulted
     self.orphan = orphan
     self.coisolation = [
         CoIsolation(*c) if c else c for c in (coisolation or [])
     ]
     self.activation = ActivationInformation.from_dict(
         activation) if isinstance(activation, dict) else activation
Example #5
0
 def __init__(self, scan_time=None, neutral_mass=None, mz=None, intensity=None, charge=None,
              precursor_scan_id=None, product_scan_id=None, defaulted=None, orphan=None,
              drift_time=None, coisolation=None, activation=None, **kwargs):
     super(MSnRecord, self).__init__(scan_time, drift_time, **kwargs)
     self.neutral_mass = neutral_mass
     self.mz = mz
     self.intensity = intensity
     self.charge = charge
     self.precursor_scan_id = precursor_scan_id
     self.product_scan_id = product_scan_id
     self.defaulted = defaulted
     self.orphan = orphan
     self.coisolation = [CoIsolation(*c) if c else c for c in (coisolation or [])]
     self.activation = ActivationInformation.from_dict(
         activation) if isinstance(activation, dict) else activation
Example #6
0
 def _activation(self, scan):
     record = self._get_scan_record(scan)
     return ActivationInformation('cid', record.CollisionEnergy)