Loading...
Searching...
No Matches
massspectrumid.cpp
Go to the documentation of this file.
/*******************************************************************************
* Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
*
* This file is part of the PAPPSOms++ library.
*
* PAPPSOms++ 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 3 of the License, or
* (at your option) any later version.
*
* PAPPSOms++ 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 PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
*implementation
******************************************************************************/
#include <limits>
#include "massspectrumid.h"
namespace pappso
{
MassSpectrumId::MassSpectrumId()
{
}
MassSpectrumId::MassSpectrumId(const MsRunIdCstSPtr &msRunId)
: mcsp_msRunId(msRunId)
{
}
MassSpectrumId::MassSpectrumId(const MsRunIdCstSPtr &msRunId,
std::size_t spectrum_index)
: mcsp_msRunId(msRunId), m_nativeId(""), m_spectrumIndex(spectrum_index)
{
}
MassSpectrumId::MassSpectrumId(const MassSpectrumId &other)
: mcsp_msRunId(other.mcsp_msRunId),
m_nativeId(other.m_nativeId),
m_spectrumIndex(other.m_spectrumIndex)
{
}
MassSpectrumId::~MassSpectrumId()
{
}
MassSpectrumId &
MassSpectrumId::operator=(const MassSpectrumId &other)
{
mcsp_msRunId = other.mcsp_msRunId;
m_spectrumIndex = other.m_spectrumIndex;
m_nativeId = other.m_nativeId;
return *this;
}
void
MassSpectrumId::setMsRunId(MsRunIdCstSPtr other)
{
mcsp_msRunId = other;
};
const MsRunIdCstSPtr &
MassSpectrumId::getMsRunIdCstSPtr() const
{
return mcsp_msRunId;
};
void
MassSpectrumId::setNativeId(const QString &native_id)
{
m_nativeId = native_id;
}
const QString &
MassSpectrumId::getNativeId() const
{
return m_nativeId;
}
void
MassSpectrumId::setSpectrumIndex(std::size_t index)
{
m_spectrumIndex = index;
}
std::size_t
MassSpectrumId::getSpectrumIndex() const
{
return m_spectrumIndex;
}
bool
MassSpectrumId::operator==(const MassSpectrumId &other) const
{
return (mcsp_msRunId == other.mcsp_msRunId &&
m_spectrumIndex == other.m_spectrumIndex);
}
bool
MassSpectrumId::isValid() const
{
return mcsp_msRunId->isValid() &&
m_spectrumIndex != std::numeric_limits<std::size_t>::max();
}
QString
MassSpectrumId::toString() const
{
return QString(
"ms run id: %1 \n"
"native id: %2 \n"
"m_spectrumIndex: %3\n")
.arg(mcsp_msRunId != nullptr ? mcsp_msRunId->toString() : "nullptr")
.arg(m_nativeId)
.arg(m_spectrumIndex);
}
} // namespace pappso
pappso::MassSpectrumId
Definition massspectrumid.h:40
pappso::MassSpectrumId::setNativeId
void setNativeId(const QString &native_id)
Definition massspectrumid.cpp:92
pappso::MassSpectrumId::setMsRunId
void setMsRunId(MsRunIdCstSPtr other)
Definition massspectrumid.cpp:77
pappso::MassSpectrumId::operator=
MassSpectrumId & operator=(const MassSpectrumId &other)
Definition massspectrumid.cpp:66
pappso::MassSpectrumId::MassSpectrumId
MassSpectrumId()
Definition massspectrumid.cpp:34
pappso::MassSpectrumId::toString
QString toString() const
Definition massspectrumid.cpp:135
pappso::MassSpectrumId::getSpectrumIndex
std::size_t getSpectrumIndex() const
Definition massspectrumid.cpp:113
pappso::MassSpectrumId::setSpectrumIndex
void setSpectrumIndex(std::size_t index)
Definition massspectrumid.cpp:106
pappso::MassSpectrumId::getNativeId
const QString & getNativeId() const
Definition massspectrumid.cpp:99
pappso::MassSpectrumId::~MassSpectrumId
~MassSpectrumId()
Definition massspectrumid.cpp:60
pappso::MassSpectrumId::m_spectrumIndex
std::size_t m_spectrumIndex
Definition massspectrumid.h:56
pappso::MassSpectrumId::isValid
bool isValid() const
Definition massspectrumid.cpp:127
pappso::MassSpectrumId::operator==
bool operator==(const MassSpectrumId &other) const
Definition massspectrumid.cpp:120
pappso::MassSpectrumId::mcsp_msRunId
MsRunIdCstSPtr mcsp_msRunId
Definition massspectrumid.h:42
pappso::MassSpectrumId::m_nativeId
QString m_nativeId
Definition massspectrumid.h:51
pappso::MassSpectrumId::getMsRunIdCstSPtr
const MsRunIdCstSPtr & getMsRunIdCstSPtr() const
Definition massspectrumid.cpp:85
massspectrumid.h
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::MsRunIdCstSPtr
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
Definition msrunid.h:46