libpappsomspp
Library for mass spectrometry
|
Go to the documentation of this file.
33 #include <QStringList>
36 #include "../../config.h"
45 char *
const p =
reinterpret_cast<char *
>(&in);
46 for(
size_t i = 0; i <
sizeof(T) / 2; ++i)
47 std::swap(p[i], p[
sizeof(T) - i - 1]);
64 mp_output->writeQualifiedMassSpectrum(spectrum);
115 mpa_outputStream->writeNamespace(
"http://www.w3.org/2001/XMLSchema-instance",
131 "xmlns",
"http://sashimi.sourceforge.net/schema_revision/mzXML_3.2");
133 "xsi:schemaLocation",
134 "http://sashimi.sourceforge.net/schema_revision/mzXML_3.2 "
135 "http://sashimi.sourceforge.net/schema_revision/mzXML_3.2/"
136 "mzXML_idx_3.2.xsd");
224 QStringList native_id_list = native_id.split(
"=");
225 if(native_id_list.size() < 2)
230 return native_id_list.back().toULong();
232 return std::numeric_limits<std::size_t>::max();
238 std::size_t scan_number =
240 if(scan_number == std::numeric_limits<std::size_t>::max())
251 std::size_t scan_number =
253 if(scan_number == std::numeric_limits<std::size_t>::max())
291 QString(
"%1").arg(spectrum.
size()));
293 if(spectrum.
size() > 0)
314 QString(
"PT%1S").arg(QString::number(spectrum.
getRtInSeconds(),
'f', 2)));
327 "precursorIntensity",
351 QByteArray byte_array;
352 if(QSysInfo::ByteOrder == QSysInfo::LittleEndian)
358 byte_array.append((
char *)&swap, 8);
360 byte_array.append((
char *)&swap, 8);
368 byte_array.append((
char *)&peak.x, 8);
369 byte_array.append((
char *)&peak.y, 8);
uint getMsLevel() const
Get the mass spectrum level.
base class to read MSrun the only way to build a MsRunReader object is to use the MsRunReaderFactory
std::size_t getScanNumberFromNativeId(const QString &native_id) const
std::size_t getScanNumber(const QualifiedMassSpectrum &spectrum) const
tries to keep as much as possible monoisotopes, removing any possible C13 peaks
const QString & getNativeId() const
void writeHeader(MsRunReader *p_msrunreader)
virtual void setQualifiedMassSpectrum(const QualifiedMassSpectrum &spectrum) override
pappso_double getPrecursorIntensity(bool *ok=nullptr) const
Get the intensity of the precursor ion.
#define PAPPSOMSPP_VERSION
virtual std::size_t spectrumListSize() const =0
get the totat number of spectrum conained in the MSrun data file
void write(MsRunReader *p_msrunreader)
write msrun peaks into mzxml output stream
const MsRunIdCstSPtr & getMsRunId() const
std::size_t getPrecursorScanNumber(const QualifiedMassSpectrum &spectrum) const
virtual void readSpectrumCollection(SpectrumCollectionHandlerInterface &handler)=0
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler
Class representing a fully specified mass spectrum.
uint getPrecursorCharge(bool *ok=nullptr) const
Get the precursor charge.
virtual void setNeedMsLevelPeakList(unsigned int ms_level, bool want_peak_list) final
tells if we need the peak list given
const QString & getPrecursorNativeId() const
std::size_t getSpectrumIndex() const
virtual void setReadAhead(bool is_read_ahead) final
use threads to read a spectrum by batch of batch_size
Translater(MzxmlOutput *p_mzxml_output)
const MassSpectrumId & getMassSpectrumId() const
Get the MassSpectrumId.
MassSpectrumCstSPtr getMassSpectrumCstSPtr() const
Get the MassSpectrumCstSPtr.
MzxmlOutput(QIODevice *p_output_device)
void writeQualifiedMassSpectrum(const QualifiedMassSpectrum &spectrum)
void setReadAhead(bool read_ahead)
void maskMs1(bool mask_ms1)
virtual bool needPeakList() const override
tells if we need the peak list (if we want the binary data) for each spectrum
std::size_t getPrecursorSpectrumIndex() const
Get the scan number of the precursor ion.
QXmlStreamWriter * mpa_outputStream
pappso_double getPrecursorMz(bool *ok=nullptr) const
Get the precursor m/z ratio.
pappso_double getRtInSeconds() const
Get the retention time in seconds.