IfIsNumeric(comp.Precursor)Then'get the precursor mass. This checks to make sure the compound has an assigned precursor. (A bug in DA 4.4 means this can be missing)
mPrec=Round(comp.precursor,4)
Else
mPrec=GetPrecMassFromName(comp)'if the precursor mass is missing then extract the information from the compound name
EndIf
fory=1tomSpec.MSPeakList.Count'As the charge state for the precursor is not included search through the MS spectrum to find the precursor mass and get the charge state from there
SetmPeak=mSpec.MSPeakList(y)
IfRound(mPeak.m_over_z,4)=mPrecThen
mChargeState=mPeak.ChargeState
ExitFor
EndIf
Next
GetChargeState=mChargeState'return the chrage state (if for some reason the charge state can not be determined (SNAP was not able to deconvolute peak) then return "1" as charge state