Ejemplo n.º 1
0
    def deisotope_scan(self,
                       scan,
                       tolerance_da=0.0025,
                       tolerance_ppm=7,
                       max_charge=None,
                       require_peptide_profile=False):
        """
        The Agilent MassHunter DAC has the neat feature of including its own
        deisotoping algorithm!  This function uses that to return the specified
        scan in deisotoped form.
        
        tolerance_da (Daltons) and tolerance_ppm (Parts-per-million) are
        ADDED TOGETHER to obtain the total tolerance value for each peak.
        
        max_charge can be set to an integer to only consider isotopic envelopes of
        charge equal to or less; 'None' performs no charge filtering.
        
        require_peptide_profile filters based on isotopic sequences having
        the relative intensity profile caused by standard relative isotopic
        abundances.
        """
        scanObj = self.source.GetSpectrum_6(scan)

        deisoFilter = CreateObject(
            r'Agilent.MassSpectrometry.DataAnalysis.MsdrChargeStateAssignmentFilter'
        )
        if not (tolerance_da == 0.0025 and tolerance_ppm == 7
                and not (max_charge or require_peptide_profile)):

            deisoFilter.AbsoluteTolerance = tolerance_da
            if max_charge:
                deisoFilter.LimitMaxChargeState = max_charge
            deisoFilter.RelativeTolerance = tolerance_ppm
            deisoFilter.RequirePeptideLikeAbundanceProfile = require_peptide_profile

        self.source.Deisotope(
            scanObj,
            deisoFilter)  # Void type, not even a success return value.

        return list(zip(scanObj.XArray, scanObj.YArray))