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);
112 std::vector<size_t> ms_levels;
113 for(std::size_t i = 1; i < 9; i++)
115 ms_levels.push_back(i);
149 mpa_outputStream->writeNamespace(
"http://www.w3.org/2001/XMLSchema-instance",
"xsi");
164 "http://sashimi.sourceforge.net/schema_revision/mzXML_3.2");
166 "http://sashimi.sourceforge.net/schema_revision/mzXML_3.2 "
167 "http://sashimi.sourceforge.net/schema_revision/mzXML_3.2/"
168 "mzXML_idx_3.2.xsd");
255 QStringList native_id_list = native_id.split(
"=");
256 if(native_id_list.size() < 2)
261 return native_id_list.back().toULong();
263 return std::numeric_limits<std::size_t>::max();
270 if(scan_number == std::numeric_limits<std::size_t>::max())
282 if(scan_number == std::numeric_limits<std::size_t>::max())
318 if(spectrum.
size() > 0)
334 "retentionTime", QString(
"PT%1S").arg(QString::number(spectrum.
getRtInSeconds(),
'f', 2)));
350 QString::number(precursor_intensity,
'f', 4));
355 mpa_outputStream->writeAttribute(
"precursorCharge", QString(
"%1").arg(charge));
380 QByteArray byte_array;
381 if(QSysInfo::ByteOrder == QSysInfo::LittleEndian)
386 byte_array.append((
char *)&swap, 8);
388 byte_array.append((
char *)&swap, 8);
395 byte_array.append((
char *)&peak.x, 8);
396 byte_array.append((
char *)&peak.y, 8);
std::size_t getSpectrumIndex() const
const QString & getNativeId() const
const QString & getFileName() const
void setNeedPeakList(bool need_peak_list)
void setMsLevels(std::vector< std::size_t > ms_levels)
base class to read MSrun the only way to build a MsRunReader object is to use the MsRunReaderFactory
virtual std::size_t spectrumListSize() const =0
get the totat number of spectrum conained in the MSrun data file
virtual void readSpectrumCollection2(const MsRunReadConfig &config, SpectrumCollectionHandlerInterface &handler)=0
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler
const MsRunIdCstSPtr & getMsRunId() const
Translater(MzxmlOutput *p_mzxml_output)
virtual bool needPeakList() const override
tells if we need the peak list (if we want the binary data) for each spectrum
virtual void setQualifiedMassSpectrum(const QualifiedMassSpectrum &spectrum) override
void setReadAhead(bool read_ahead)
std::size_t getScanNumberFromNativeId(const QString &native_id) const
MzxmlOutput(UiMonitorInterface &monitor, QIODevice *p_output_device)
void write(MsRunReader *p_msrunreader)
UiMonitorInterface & m_monitor
std::size_t getScanNumber(const QualifiedMassSpectrum &spectrum) const
QXmlStreamWriter * mpa_outputStream
void writeQualifiedMassSpectrum(const QualifiedMassSpectrum &spectrum)
void maskMs1(bool mask_ms1)
std::size_t getPrecursorScanNumber(const QualifiedMassSpectrum &spectrum) const
void writeHeader(MsRunReader *p_msrunreader)
Class representing a fully specified mass spectrum.
uint getMsLevel() const
Get the mass spectrum level.
MassSpectrumCstSPtr getMassSpectrumCstSPtr() const
Get the MassSpectrumCstSPtr.
uint getPrecursorCharge(bool *ok=nullptr) const
get precursor charge
const QString & getPrecursorNativeId() const
pappso_double getPrecursorIntensity(bool *ok=nullptr) const
get precursor intensity
const MassSpectrumId & getMassSpectrumId() const
Get the MassSpectrumId.
bool isEmptyMassSpectrum() const
pappso_double getPrecursorMz(bool *ok=nullptr) const
get precursor mz
std::size_t getPrecursorSpectrumIndex() const
Get the scan number of the precursor ion.
pappso_double getRtInSeconds() const
Get the retention time in seconds.
virtual void setReadAhead(bool is_read_ahead) final
use threads to read a spectrum by batch of batch_size
virtual void setNeedMsLevelPeakList(unsigned int ms_level, bool want_peak_list) final
tells if we need the peak list given
#define PAPPSOMSPP_VERSION
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...