Loading...
Searching...
No Matches
pappso::MsRunId Class Reference

MS run identity MsRunId identifies an MS run with a unique ID (XmlId) and contains eventually informations on its location (local disk path or URL) More...

`#include <msrunid.h>`

## Public Member Functions

| MsRunId ()
| MsRunId (const QString &file_name)
| MsRunId (const QString &file_name, const QString &run_id)
| MsRunId (const MsRunId &other)
virtual | ~MsRunId ()
bool | operator== (const MsRunId &other) const
MsRunId & | operator= (const MsRunId &other)
void | setFileName (const QString &file_name)
const QString & | getFileName () const
void | setRunId (const QString &run_id)
const QString & | getRunId () const
void | setXmlId (const QString &xml_id)
| set an XML unique identifier for this MsRunId
const QString & | getXmlId () const
void | setSampleName (const QString &name)
| set a sample name for this MsRunId
const QString & | getSampleName () const
void | setMzFormat (MzFormat format)
MzFormat | getMzFormat () const
QString | toString () const
bool | isValid () const

## Private Attributes

QString | m_fileName = "NOT_SET"
QString | m_runId
QString | m_xmlId
QString | m_sampleName
MzFormat | m_mzFormat = MzFormat::mzXML

## Detailed Description

MS run identity MsRunId identifies an MS run with a unique ID (XmlId) and contains eventually informations on its location (local disk path or URL)

Definition at line 53 of file msrunid.h.

## Constructor & Destructor Documentation

## MsRunId() [1/4]

pappso::MsRunId::MsRunId | ( |  | ) |

Definition at line 39 of file msrunid.cpp.

{
}

## MsRunId() [2/4]

pappso::MsRunId::MsRunId | ( | const QString & | file_name | ) |

Definition at line 44 of file msrunid.cpp.

: m_fileName(file_name)
{
// by default, the sample name is given by the file name
QFileInfo fileinfo(m_fileName);
if(fileinfo.fileName() == "analysis.tdf")
{
m_fileName = fileinfo.absoluteDir().absolutePath();
}
m_sampleName = QFileInfo(m_fileName).baseName();
}
pappso::MsRunId::m_sampleName
QString m_sampleName
Definition msrunid.h:93
pappso::MsRunId::m_fileName
QString m_fileName
Definition msrunid.h:90

References m_fileName, and m_sampleName.

## MsRunId() [3/4]

pappso::MsRunId::MsRunId | ( | const QString & | file_name,
|  | const QString & | run_id
| ) |  |

Definition at line 56 of file msrunid.cpp.

: MsRunId(file_name)
{
m_runId = run_id;
}
pappso::MsRunId::m_runId
QString m_runId
Definition msrunid.h:91
pappso::MsRunId::MsRunId
MsRunId()
Definition msrunid.cpp:39

References m_runId.

## MsRunId() [4/4]

pappso::MsRunId::MsRunId | ( | const MsRunId & | other | ) |

Definition at line 63 of file msrunid.cpp.

: m_fileName(other.m_fileName),
m_runId(other.m_runId),
m_xmlId(other.m_xmlId),
m_sampleName(other.m_sampleName),
m_mzFormat(other.m_mzFormat)
{
}
pappso::MsRunId::m_mzFormat
MzFormat m_mzFormat
Definition msrunid.h:94
pappso::MsRunId::m_xmlId
QString m_xmlId
Definition msrunid.h:92

## ~MsRunId()

pappso::MsRunId::~MsRunId | ( |  | ) |

virtual

Definition at line 73 of file msrunid.cpp.

{
}

## Member Function Documentation

## getFileName()

const QString & pappso::MsRunId::getFileName | ( |  | ) | const

Definition at line 151 of file msrunid.cpp.

{
return m_fileName;
}

References m_fileName.

## getMzFormat()

MzFormat pappso::MsRunId::getMzFormat | ( |  | ) | const

Definition at line 165 of file msrunid.cpp.

{
return m_mzFormat;
}

References m_mzFormat.

## getRunId()

const QString & pappso::MsRunId::getRunId | ( |  | ) | const

Definition at line 130 of file msrunid.cpp.

{
return m_runId;
}

References m_runId.

Referenced by pappso::XyMsFileReader::getMsRunIds().

## getSampleName()

const QString & pappso::MsRunId::getSampleName | ( |  | ) | const

Definition at line 86 of file msrunid.cpp.

{
return m_sampleName;
}

References m_sampleName.

## getXmlId()

const QString & pappso::MsRunId::getXmlId | ( |  | ) | const

Definition at line 144 of file msrunid.cpp.

{
return m_xmlId;
}

References m_xmlId.

Referenced by pappso::IonMobilityGrid::storeObservedIdentityBetween(), and pappso::IonMobilityGrid::translateXicCoordFromTo().

## isValid()

bool pappso::MsRunId::isValid | ( |  | ) | const

Definition at line 210 of file msrunid.cpp.

{
return !m_fileName.isEmpty() && !m_runId.isEmpty() && !m_xmlId.isEmpty() &&
m_mzFormat != MzFormat::unknown;
}
pappso::MzFormat::unknown
@ unknown
unknown format

References m_fileName, m_mzFormat, m_runId, m_xmlId, and pappso::unknown.

## operator=()

MsRunId & pappso::MsRunId::operator= | ( | const MsRunId & | other | ) |

Definition at line 181 of file msrunid.cpp.

{
m_xmlId = other.m_xmlId;
m_fileName = other.m_fileName;
m_sampleName = other.m_sampleName;
m_mzFormat = other.m_mzFormat;
return *this;
}

References m_fileName, m_mzFormat, m_sampleName, and m_xmlId.

## operator==()

bool pappso::MsRunId::operator== | ( | const MsRunId & | other | ) | const

Definition at line 172 of file msrunid.cpp.

{
if(m_xmlId == other.m_xmlId)
return true;
return false;
}

References m_xmlId.

## setFileName()

void pappso::MsRunId::setFileName | ( | const QString & | file_name | ) |

Definition at line 93 of file msrunid.cpp.

{
m_fileName = file_name;
QFileInfo file_info(file_name);
QString extension = file_info.suffix();
if(m_sampleName.isEmpty())
{
// set sample name by default :
m_sampleName = file_info.baseName();
}
m_mzFormat = MzFormat::unknown;
if(extension.toLower() == "mzxml")
{
m_mzFormat = MzFormat::mzXML;
}
else if(extension.toLower() == "mgf")
{
m_mzFormat = MzFormat::MGF;
}
else if(extension.toLower() == "mzml")
{
m_mzFormat = MzFormat::mzML;
}
}
pappso::MzFormat::mzXML
@ mzXML
mzXML
pappso::MzFormat::mzML
@ mzML
mzML
pappso::MzFormat::MGF
@ MGF
Mascot format.

References m_fileName, m_mzFormat, m_sampleName, pappso::MGF, pappso::mzML, pappso::mzXML, and pappso::unknown.

## setMzFormat()

void pappso::MsRunId::setMzFormat | ( | MzFormat | format | ) |

Definition at line 158 of file msrunid.cpp.

{
m_mzFormat = format;
}

References m_mzFormat.

Referenced by pappso::PwizMsFileReader::getMsRunIds(), pappso::TimsMsFileReader::getMsRunIds(), and pappso::XyMsFileReader::getMsRunIds().

## setRunId()

void pappso::MsRunId::setRunId | ( | const QString & | run_id | ) |

Definition at line 123 of file msrunid.cpp.

{
m_runId = run_id;
}

References m_runId.

Referenced by pappso::TimsMsFileReader::getMsRunIds(), and pappso::XyMsFileReader::getMsRunIds().

## setSampleName()

void pappso::MsRunId::setSampleName | ( | const QString & | name | ) |

set a sample name for this MsRunId

Definition at line 79 of file msrunid.cpp.

{
m_sampleName = name;
}

References m_sampleName.

Referenced by pappso::PwizMsFileReader::getMsRunIds(), pappso::TimsMsFileReader::getMsRunIds(), and pappso::XyMsFileReader::getMsRunIds().

## setXmlId()

void pappso::MsRunId::setXmlId | ( | const QString & | xml_id | ) |

set an XML unique identifier for this MsRunId

Parameters

  xml_id | this id must respect XML constraints (no space characters)

Definition at line 137 of file msrunid.cpp.

{
m_xmlId = xml_id;
}

References m_xmlId.

Referenced by pappso::PwizMsFileReader::getMsRunIds(), pappso::TimsMsFileReader::getMsRunIds(), pappso::XyMsFileReader::getMsRunIds(), and pappso::MsFileAccessor::getMsRunReaderSPtrByRunId().

## toString()

QString pappso::MsRunId::toString | ( |  | ) | const

Definition at line 193 of file msrunid.cpp.

{
QString text = QString(
"file name: '%1'\n"
"run id: '%2'\n"
"xml id: '%3'\n"
"sample name: '%4'\n")
.arg(m_fileName)
.arg(m_runId)
.arg(m_xmlId)
.arg(m_sampleName);
return text;
}

References m_fileName, m_runId, m_sampleName, and m_xmlId.

Referenced by pappso::TimsMsFileReader::getMsRunIds().

## Member Data Documentation

## m_fileName

QString pappso::MsRunId::m_fileName = "NOT_SET"

private

Definition at line 90 of file msrunid.h.

Referenced by MsRunId(), getFileName(), isValid(), operator=(), setFileName(), and toString().

## m_mzFormat

MzFormat pappso::MsRunId::m_mzFormat = MzFormat::mzXML

private

Definition at line 94 of file msrunid.h.

Referenced by getMzFormat(), isValid(), operator=(), setFileName(), and setMzFormat().

## m_runId

QString pappso::MsRunId::m_runId

private

Definition at line 91 of file msrunid.h.

Referenced by MsRunId(), getRunId(), isValid(), setRunId(), and toString().

## m_sampleName

QString pappso::MsRunId::m_sampleName

private

Definition at line 93 of file msrunid.h.

Referenced by MsRunId(), getSampleName(), operator=(), setFileName(), setSampleName(), and toString().

## m_xmlId

QString pappso::MsRunId::m_xmlId

private

Definition at line 92 of file msrunid.h.

Referenced by getXmlId(), isValid(), operator=(), operator==(), setXmlId(), and toString().

The documentation for this class was generated from the following files:

- pappsomspp/msrun/msrunid.h
- pappsomspp/msrun/msrunid.cpp