Source code for MSQuant: frmRetrieveProteinsParameters.vb, MSQuant/msquant/src/GUI/forms/frmRetrieveProteinsParameters.vb.

Table of contents page.

Home page for MSQuant.

'****************************************************************************
'* Copyright (C) 2007 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: get parameters for retrieving protein sequence from the Mascot server, in particular the URL from the search log.                       *
'*                                                                          *
'****************************************************************************

'****************************************************************************
'*                               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:   frmPeptideFilters.vb                                      *
'*    TYPE:  VISUAL_BASIC                                                   *
'*                                                                          *
'* CREATED: PM 2007-09-02   Vrs 1.0.                                        *
'* UPDATED: PM 2007-xx-xx                                                   *
'*                                                                          *
'****************************************************************************

Option Strict On
Option Explicit On



Imports massSpectrometryBase 'For peptideFilterStructure.

Imports MSQuant 'For class quantApplication


Public Structure retrieveProteinStructure

    Dim searchLogURL As String 'E.g.
    '  http://mascot4.bmb.sdu.dk/mascot/cgi/master_results.pl?file=../data/20070716/F037366.dat

    'Changed PM_RETRIEVE_PROTEIN_SEQUENCES_FASTER 2008-04-22
    Dim peptideFilter2 As peptideFilterStructure
End Structure 'retrieveProteinStructure


'****************************************************************************
'*    <placeholder for header>                                              *
'****************************************************************************
Public Class frmRetrieveProteinsParameters


    Private mParams As retrieveProteinStructure

    Public Event proteinParametersDialogDismissed( _
      ByVal aSender As Object, _
      ByVal anEvent As proteinParametersEventArgs)

    'Changed PM_RETRIEVE_PROTEIN_SEQUENCES_FASTER 2008-04-22
    Private WithEvents mFilterForm As frmPeptideFilters
    'Private mPeptideFilter As peptideFilterStructure
    Private mApplication As quantApplication 'This for access to
    '  modifications set.
    Private mRawFiles() As fileSpecStructure


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Public Sub New( _
      ByVal aParams As retrieveProteinStructure, _
      ByRef anApp As quantApplication, _
      ByRef anInRawFiles() As fileSpecStructure)

        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

        'Changed PM_RETRIEVE_PROTEIN_SEQUENCES_FASTER 2008-04-22
        'mParams = aParams
        mParams.searchLogURL = aParams.searchLogURL
        mParams.peptideFilter2 = aParams.peptideFilter2.deepCopy2()

        mApplication = anApp
        mRawFiles = anInRawFiles

        Me.fillInDialog(mParams) 'Note: not aParams...
    End Sub 'Constructor.


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Private Sub fillInDialog( _
      ByVal aParams As retrieveProteinStructure)

        txtSearchLogURL.Text = aParams.searchLogURL

        updatePeptideFilterSummary(aParams.peptideFilter2)
    End Sub 'fillInDialog


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Private Sub btnOK_Click( _
      ByVal aSender As System.Object, ByVal anEvent As System.EventArgs) _
      Handles btnOK.Click


        'No validation for now....
        Try
            Dim newValues As retrieveProteinStructure
            newValues.searchLogURL = txtSearchLogURL.Text

            'Do we need to use deepCopy2() here??? (the modifications
            'filter is a list - not a value type)
            newValues.peptideFilter2 = mParams.peptideFilter2

            RaiseEvent proteinParametersDialogDismissed( _
              aSender, New proteinParametersEventArgs(newValues))

            Me.Close()

        Catch exceptionObject As Exception
            MSQuantCommon2.displayStandardExceptionInfo( _
              exceptionObject, _
              "Could not read values dialog in dialog. Some numeric fields may hold letters, etc.")
            Exit Sub
        End Try
    End Sub 'btnOK_Click


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Private Sub btnCancel_Click( _
      ByVal aSender As System.Object, ByVal anEvent As System.EventArgs) _
      Handles btnCancel.Click

        Me.Close()
    End Sub 'btnCancel_Click


    'Changed PM_RETRIEVE_PROTEIN_SEQUENCES_FASTER 2008-04-22
    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Private Sub btnPeptideFilter_Click( _
      ByVal aSender As System.Object, ByVal anEvent As System.EventArgs) _
      Handles btnPeptideFilter.Click

        'Note: implicitly we are using global settings for the export filter.
        '      Is that what we want?

        Dim key As peptideFilterEnum = _
          peptideFilterEnum.enumRetrieveProteinSequences
        Dim programDefaults As peptideFilterStructure = _
          quantApplication.defaultPeptideFilters2()(key)

        'Second parameter: for call-back - when OK is pressed...
        mFilterForm = New frmPeptideFilters( _
          mParams.peptideFilter2, mApplication, True, True, programDefaults, _
          "retrieve protein sequence - protein must contain at least one peptide", _
          mRawFiles)
        mFilterForm.Show()
    End Sub 'btnPeptideFilter_Click


    'Changed PM_RETRIEVE_PROTEIN_SEQUENCES_FASTER 2008-04-22
    '
    'Refactor this? It appears in several places: e.g. here and
    'in frmExportFilters.vb
    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Public Sub updatePeptideFilterSummary( _
      ByVal anInPeptideFilterSpecification As peptideFilterStructure)

        Dim summaryStr As String = _
          someStatic.pepFilterShortSummary( _
            anInPeptideFilterSpecification, mApplication)
        lblPeptideFilterSummary.Text = summaryStr
    End Sub 'updatePeptideFilterSummary


    'Changed PM_RETRIEVE_PROTEIN_SEQUENCES_FASTER 2008-04-22
    'From sub-dialog, peptide filter.
    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Private Sub mFilterForm_dialogDismissed2( _
      ByVal aSender As Object, _
      ByVal anEvent As pepFilterEventArgs) _
      Handles mFilterForm.pepFilterDismissed

        mParams.peptideFilter2 = anEvent.getFilter()
        updatePeptideFilterSummary(mParams.peptideFilter2)
    End Sub 'mFilterForm_dialogDismissed2


End Class 'frmRetrieveProteinsParameters


'Helper class for proteinParametersDialogDismissed event.
'****************************************************************************
'*    <placeholder for header>                                              *
'****************************************************************************
Public Class proteinParametersEventArgs
    Inherits System.EventArgs

    Private mParams As retrieveProteinStructure

    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Public Sub New(ByVal aSomeValue As retrieveProteinStructure)
        mParams = aSomeValue
    End Sub 'Constructor.


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Public Function getParams() _
    As retrieveProteinStructure

        Return mParams
    End Function 'getFilter


End Class 'proteinParametersEventArgs


    

    

Generated by script codePublish.pl at 2008-09-23T11:59:18.