Source code for MSQuant: PILperiodicTable.cs, MSQlib1/src/massspec/PILperiodicTable.cs.

Table of contents page.

Home page for MSQuant.

/****************************************************************************
 * Copyright (C) 2008 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: <to be filled in>. Represent elements for a particular 
 *          place or particular properties. E.g. Earth biosphere, 
 *          Jupiter's moon Europa, unusual isotope distributions (e.g. 99% SILAC, 98% N15)                           *
 *                                                                          *
 ****************************************************************************/

/****************************************************************************
 *                               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:   PILperiodicTable.cs                                       *
 *    TYPE:       CSHARP                                                    *
 *                                                                          *
 * CREATED: PM 2008-01-28   Vrs 1.0. Translated from Visual Basic           *
 *                          to C# and transfered from DTASC to              *
 *                          the application                                 *
 * UPDATED: PM 2008-xx-xx                                                   *
 *                                                                          *
 *                                                                          *
 ****************************************************************************/



using System;
using System.Collections.Generic;
using System.Text;

//Autogenerated.
//namespace FastSerialisation2.src
//{
//    class PILperiodicTable
//    {
//    }
//}



//****************************************************************************
//d$ <summary>
//d$   Purpose: Namespace for lower layers of mass spectrometric
//d$            applications: raw data file handling, descriptive statistics,
//d$            fragment masses, digestion, file associations, etc.
//d$   <see cref="T:VBXMLDoc.CVBXMLDoc" />.
//d$   <isUnitTest></isUnitTest>
//d$   <applicationname>test_rawDataFileHandling</applicationname>
//d$   <author>Peter Mortensen</author>
//d$   <seealso>http://msdn.microsoft.com</seealso>
//d$   <codetype>PLATFORM independent</codetype>
//d$ </summary>
namespace massSpectrometryBase
{


    //Or use standard elemental symbols?
    //Periodoc table at: <http://en.wikipedia.org/wiki/Periodic_table_(standard)>
    //
    //Other possible one letter codes:
    //  K, F, 
    //
    //Possible two letter codes :
    //  Na, Cl, Mg, Cu, Zn, Ca, Fe, Co, Mn, Se.
    //


    //Add proton mass as a convenience?
    public enum elementCodeEnum
    {
        enumCarbon = 283,
        //C
        enumHydrogen,
        //H
        enumNitrogen,
        //N
        enumOxygen,
        //O
        enumSulphur,
        //S

        enumPhosphor,
        //P
        enumElectron,
        //<none>

        enumDarkMatter1,
        enumDarkMatter2,
        enumDarkEnergy1,
        enumMACHO1,
        enumWIMPS1,
        enumNeutrino,

        enumQuarkUp,
        enumQuarkDown
    }
    //elementCodeEnum



    //****************************************************************************
    //*    <placeholder for header>                                              *
    //****************************************************************************
    public class PILperiodicTable
    {

        //Should elementCodeEnum be here?

        //private Hashtable mMonoMasses
        Dictionary<elementCodeEnum, double> mMonoMasses2;


        //****************************************************************************
        //*  SUBROUTINE NAME:   New                                                  *
        //d$ <summary>Constructor</summary>
        public PILperiodicTable(int aSomeParameter)
            : base()
        {
            //Is this necessary? Yes!


            //From "Methods in enzymology, vol. 193"
            //       Mass [Da]     Natural
            //                     abundance [%]
            //H1      1.007825035   99.985
            //H2      2.014101779    0.015
            //C12    12.000000000   98.900
            //C13    13.003354826    1.100
            //N14    14.003074002   99.630
            //N15    15.000108970    0.370
            //O16    15.994914630   99.760
            //O17    16.999131200    0.040
            //O18    17.999160300    0.200
            //F19    18.998403220  100.000
            //Na23   22.989767700  100.000
            //Si28   27.976927100   92.230
            //Si29   28.976494900    4.670
            //Si30   29.973770100    3.100
            //P31    30.973762000  100.000
            //S32    31.972070698   95.020
            //S33    32.971458428    0.750
            //S34    33.967866650    4.210
            //S36    35.967080620    0.020
            //Cl35   34.968852728   75.770
            //Cl37   36.965902619   24.230
            //K39    38.963707400   93.258
            //K40    39.963999200    0.012
            //K41    40.961825400    6.730
            //Br79   78.918336100   50.690
            //Br81   80.916289000   49.310
            //I127  126.904473000  100.000


            //Electron to proton ratio	1836.152668
            double electronToProtonRatio = 1836.152668;


            //Hard-coded for now
            if (true)
            {
                mMonoMasses2 = new Dictionary<elementCodeEnum, double>(10);

                mMonoMasses2.Add(elementCodeEnum.enumCarbon,   12.0);
                mMonoMasses2.Add(elementCodeEnum.enumHydrogen,  1.007825035);
                mMonoMasses2.Add(elementCodeEnum.enumNitrogen, 14.003074002);
                mMonoMasses2.Add(elementCodeEnum.enumOxygen,   15.99491463);
                mMonoMasses2.Add(elementCodeEnum.enumSulphur,  31.972070698);
                mMonoMasses2.Add(elementCodeEnum.enumPhosphor, 30.973762);
            }

            //Derived
            if (true)
            {
                double hydrogenMass = mMonoMasses2[elementCodeEnum.enumHydrogen];

                double protonMass = hydrogenMass / (1 + 1 / electronToProtonRatio);

                //We could go from hydrogen mass directly to electro mass, but
                //we want to check up on the proton mass.
                double electronMass = protonMass / electronToProtonRatio;

                //Check
                double Hmass = protonMass + electronMass;

                mMonoMasses2.Add(elementCodeEnum.enumElectron, electronMass);
            }
        } //New()


        //****************************************************************************
        //*    <placeholder for header>                                              *
        //****************************************************************************
        public double elementMonoMass(elementCodeEnum anElementCode)
        {

            //Return 

            //For debugging
            double toReturn = mMonoMasses2[anElementCode];
            return toReturn;
        } //elementMonoMass


    }
    //PILperiodicTable

} //namespace massSpectrometryBase








    

    

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