Source code for MSQuant: XICwindow.vb, MSQuant/msquant/src/main/massbase/XICwindow.vb.

Table of contents page.

Home page for MSQuant.

'****************************************************************************
'* Copyright (C) 2005 Peter Mortensen and Matthias Mann                     *
'* This file is part of MSQuant.                                            *
'*                                                                          *
'* MSQuant is distributed under the terms of                                *
'* the GNU General Public License. See src/COPYING.TXT or                   *
'* <http://www.gnu.org/licenses/gpl.txt> for details.                       *
'*                                                                          *
'* MSQuant is free software; you can redistribute it                        *
'* and/or modify it under the terms of the GNU                              *
'* General Public License as published by the Free                          *
'* Software Foundation; either version 2 of the                             *
'* License, or (at your option) any later version.                          *
'*                                                                          *
'* MSQuant is distributed in the hope that it will be                       *
'* useful, but WITHOUT ANY WARRANTY; without even the                       *
'* implied warranty of MERCHANTABILITY or FITNESS FOR                       *
'* A PARTICULAR PURPOSE.  See the GNU General Public                        *
'* License for more details.                                                *
'*                                                                          *
'* You should have received a copy of the GNU General                       *
'* Public License along with MSQuant; if not, write to                      *
'* the Free Software Foundation, Inc., 59 Temple                            *
'* Place, Suite 330, Boston, MA  02111-1307  USA                            *
'*                                                                          *
'* Purpose: Encapsulates computation of the width of the window for         *
'*          quantitation.                                                   *
'*          Holds Class XICwindow, see below for                            *
'*          documentation.                                                  *
'*                                                                          *
'****************************************************************************

'****************************************************************************
'*                               CEBI                                       *
'*                    Software Development Group                            *
'*                         Peter Mortensen                                  *
'*                E-mail: NUKESPAMMERSdrmortensen@get2netZZZZZZ.dk          *
'*                 WWW: http://www.cebi.sdu.dk/                             *
'*                                                                          *
'*  Program for post-processing of result from search in mass               *
'*    spectrometric data.                                                   *
'*                                                                          *
'*    FILENAME:   XICwindow.vb                                              *
'*    TYPE:  VISUAL_BASIC                                                   *
'*                                                                          *
'* CREATED: PM 2005-07-12   Vrs 1.0.                                        *
'* UPDATED: PM 2005-xx-xx                                                   *
'*                                                                          *
'****************************************************************************

Option Strict On
Option Explicit On 



'Changed PM_FINNIGAN_QUANTWINDOW_RELATIVE 2005-07-12
Public Enum massWindowFunctionEnum
    enumConstantMass = 277
    'enumConstantRelativeMass
    enum_SquareMass

    'Perhaps later: natural for QSTAR - (square root law?)
End Enum 'massWindowFunctionEnum


Public Structure XICwindowStructure
    Dim massWindowForXIC2 As Double
    Dim massForMassWindow As Double
    Dim massWindowFunction As massWindowFunctionEnum

    Dim quantThreshold As Double 'Unspecified whether it is sum of intentities
    '  or MS peak area.
End Structure 'XICwindowStruct


'Why is it defined in this file ??????
Public Structure miscSettingsStructure2Struct

    'Superceded by the 3 massWindowFunction values...
    'Dim useAbsoluteMassWindowForXIC As Boolean

    'Dim massWindowForXIC As Double
    Dim currentXICwindowSetings As XICwindowStructure 'Needed?

    Dim MSpeakThresholdPercentageForXIC As Double 'Note: currently not used anywhere...

    'Changed PM_VARIABLE_XIC_WINDOW_INSTRUMENTSPECIFIC 2004-06-29
    'Disabled to make a clean break with the old way....
    'Dim absoluteMassWindowForXIC_QSTAR As Double 'Analyst
    'Dim absoluteMassWindowForXIC_LTQFT As Double 'Finnigan
    'Dim absoluteMassWindowForXIC_Qtof As Double 'Micromass

    'Analyst
    Dim QSTARsettingsXIC As XICwindowStructure
    'Dim massWindowForXIC_QSTAR As Double
    'Dim massForMassWindow_QSTAR As Double
    'Dim massWindowFunction_QSTAR As massWindowFunctionEnum

    'Finnigan
    Dim LTQFTsettingsXIC As XICwindowStructure
    'Dim massWindowForXIC_LTQFT As Double
    'Dim massForMassWindow_LTQFT As Double
    'Dim massWindowFunction_LTQFT As massWindowFunctionEnum

    'Micromass
    Dim QtofsettingsXIC As XICwindowStructure
    'Dim massWindowForXIC_Qtof As Double
    'Dim massForMassWindow_Qtof As Double
    'Dim massWindowFunction_Qtof As massWindowFunctionEnum

    Dim option1b As Integer 'Read-only...


    'Put these 4 into a structure??

    'Changed PM_PHOSPHO_SCORING 2006-01-09
    Dim maxDisplayedPTMcombinations2 As Integer
    Dim PTMminimumScore3 As Double
    Dim minimumPTMdeltaScore As Double
    'Changed PM_LIMIT_PTMCOMBINATIONS 2008-01-15
    Dim maxCombinations As Double


    'Changed PM_EXTERNAL_SMARTPICKING_PARAMETERS 2008-10-08
    Dim smartPickingParameters As reductionParametersStructure


    'Changed PM_TITLELINEPARSING 2007-06-08
    Dim TITLElineDefs2 As massSpectrometryBase.TITLElineDefinitions


    'Changed PM_PERSIST_IONSERIES 2008-10-09
    Dim ionDefs As massSpectrometryBase.ionDefinitionsStructure

End Structure 'miscSettingsStructure2


'****************************************************************************
'*    <placeholder for header>                                              *
'****************************************************************************

Public Class XICwindow

    Dim mCurrentSettings As XICwindowStructure


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Public Sub setParameters(ByVal anInSettings As XICwindowStructure)
        mCurrentSettings = anInSettings
    End Sub 'setParameters


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Public Function XICwindowSize(ByVal aMass As Double) _
      As Double

        Dim toReturn As Double = -30000.0

        Trace.Assert(mCurrentSettings.massWindowForXIC2 > 0.0, _
          "PIL ASSERT. massWindowForXIC is negative, ." & _
          mCurrentSettings.massWindowForXIC2)
        Trace.Assert( _
          mCurrentSettings.massWindowForXIC2 < -0.0000001 Or _
          mCurrentSettings.massWindowForXIC2 > 0.0000001, _
          "PIL ASSERT. massWindowForXIC is zero....")

        Select Case mCurrentSettings.massWindowFunction
            Case massWindowFunctionEnum.enumConstantMass
                'Very simple.....
                toReturn = mCurrentSettings.massWindowForXIC2

            Case massWindowFunctionEnum.enum_SquareMass
                Dim multFactor As Double = _
                  aMass / mCurrentSettings.massForMassWindow
                Dim multFactorPower2 As Double = multFactor * multFactor

                toReturn = multFactorPower2 * mCurrentSettings.massWindowForXIC2

            Case Else
                Trace.Assert(False, "PIL ASSERT. Select Case never fall-through")
                toReturn = 0.0
        End Select

        Return toReturn
    End Function 'XICwindowSize()


End Class 'class XICwindow


    

    

Generated by script codePublish.pl at 2009-01-05T15:20:59.