/****************************************************************************
* 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: Holds CEBIdimension, 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: CEBIdimension.cs *
* TYPE: CSHARP *
* *
* CREATED: PM 2008-07-08 Vrs 1.0. *
* UPDATED: PM 2008-xx-xx *
* *
* *
****************************************************************************/
//Future:
// 1.
//
// 2.
//using System;
//using System.Collections.Generic;
//using System.Text;
using System.Diagnostics; //For Trace. And its Assert.
using SimmoTech.Utils.Serialization; //For SerializationReader
// and SerializationWriter.
//Is that the right namespace?s
/****************************************************************************
* <placeholder for header> *
****************************************************************************/
namespace SDUPutility
{
//****************************************************************************
//* class CEBIdimension *
//* *
//* Purpose: defintion of a single dimension. *
//* *
//* Note: it is only a definition and can only describe limits. *
//* Unless names can automatically be derived. *
//* *
//* *
//* *
//* The intended purpose in the application is higher *
//* level computations. E.g. let the program have *
//* knowledge/be aware of an experiment where the *
//* sample has been separated into 6 by a sucrose *
//* gradient and then each fraction into 10 gel *
//* slices (60 samples and 60 raw files in total). *
//* A vector/hiarchy of instances of this class *
//* then represent that knowledge. *
//* *
//****************************************************************************
public class CEBIdimension
{
private string mBaseName; //E.g "sucrose fraction".
//This name is used if simple numbering is used.
//If each
private string mBaseShortName; //E.g "su" for sucrose. Or "fr" for
//sucrose gradient fraction).
//
//This name is used if simple numbering
//is used.
//
//To be used in the user interface and in
//export.
private int mSize2; //E.g. 6 for a sucrose fraction dimension. Is it
//always a constant?
//Changed PM_HIGHER_LEVEL_PROCESSING 2008-09-26
private int mStartNumber; //The first in a dimension starts at this
//number. This offset is mostly for
//convenience/naming sake for some users.
//****************************************************************************
//* SUBROUTINE NAME: New *
//d$ <summary>Constructor</summary>
public CEBIdimension(
string anInBaseName,
string anInBaseShortName,
int aSize2,
int aStartNumber
)
: base()
{
mBaseName = anInBaseName;
mBaseShortName = anInBaseShortName;
mSize2 = aSize2;
mStartNumber = aStartNumber;
} //Constructor.
//****************************************************************************
//* For ProteinHitStructure. *
//****************************************************************************
public static CEBIdimension readFromStream2(
ref SerializationReader anInReader, int aMBfileVersion)
{
string baseName = anInReader.ReadString();
string shortBaseName = anInReader.ReadString();
int size2 = anInReader.ReadInt32();
int startNumber = anInReader.ReadInt32();
CEBIdimension toReturn =
new CEBIdimension(
baseName, shortBaseName, size2, startNumber);
return toReturn;
} //readFromStream2(). For CEBIdimension.
//Changed PM_SAVE_RAWFILE_MAPPING_MB4 2008-11-17
//****************************************************************************
//* For experimentSettingsStruct. *
//****************************************************************************
public void addToStream2(
ref SerializationWriter anInOutWriter, int aMBfileVersion)
{
//aVersion: e.g. 300 for MB3, 400 for MB4.
//SERMARK20. A marker. Keep it.
//Assume it has been checked by the caller.
Trace.Assert(aMBfileVersion >= AppConstants.SAVEDFILEVERSION_MB4,
"PIL ASSERT. <message>.");
anInOutWriter.Write( this.getBaseName());
anInOutWriter.Write( this.getBaseShortName());
anInOutWriter.Write( this.getSize2());
anInOutWriter.Write( this.startNumber());
} //addToStream2(). For CEBIdimension.
//****************************************************************************
//* SUBROUTINE NAME: getBaseName *
//d$ <summary></summary>
public string getBaseName()
{
return mBaseName;
} //getBaseName().
//****************************************************************************
//* SUBROUTINE NAME: getBaseShortName *
//d$ <summary></summary>
public string getBaseShortName()
{
return mBaseShortName;
} //getBaseShortName().
//****************************************************************************
//* SUBROUTINE NAME: getSize2 *
//d$ <summary></summary>
public int getSize2()
{
return mSize2;
} //getSize2().
//****************************************************************************
//* SUBROUTINE NAME: startNumber *
//d$ <summary></summary>
public int startNumber()
{
return mStartNumber;
} //startNumber().
} //class CEBIdimension
} //namespace SDUPutility
Generated by script codePublish.pl at 2009-01-05T15:20:59.