Commit 57e1b627 authored by Edlira Nano's avatar Edlira Nano
Browse files

cleaning up for new relese

git-svn-id: https://subversion.renater.fr/masschroq/trunk@2257 e4b6dbb4-9209-464b-83f7-6257456c460c
parent 541c8b6f
...@@ -127,36 +127,36 @@ SET(VIEWXIC_MOC_HDRS ...@@ -127,36 +127,36 @@ SET(VIEWXIC_MOC_HDRS
./qtquanti/choose_mz_precision_widget.h ./qtquanti/choose_mz_precision_widget.h
) )
SET(GUI_SRCS # SET(GUI_SRCS
./gui/mainwindow.cpp # ./gui/mainwindow.cpp
./gui/masschroq_gui.cpp # ./gui/masschroq_gui.cpp
./gui/xicSelectionWidget.cpp # ./gui/xicSelectionWidget.cpp
./gui/filterBackgroundWidget.cpp # ./gui/filterBackgroundWidget.cpp
./gui/plotStyle.cpp # ./gui/plotStyle.cpp
./gui/xicProfile.cpp # ./gui/xicProfile.cpp
./gui/xicPlot.cpp # ./gui/xicPlot.cpp
./gui/plot.cpp # ./gui/plot.cpp
./gui/mcqThread.cpp # ./gui/mcqThread.cpp
./gui/msrunLoaderThread.cpp # ./gui/msrunLoaderThread.cpp
./gui/runningBarr.cpp # ./gui/runningBarr.cpp
) # )
# another list, this time it includes all header files that should be treated with moc # # another list, this time it includes all header files that should be treated with moc
SET(GUI_MOC_HDRS # SET(GUI_MOC_HDRS
./gui/mainwindow.h # ./gui/mainwindow.h
./gui/xicSelectionWidget.h # ./gui/xicSelectionWidget.h
./gui/filterBackgroundWidget.h # ./gui/filterBackgroundWidget.h
./gui/xicProfile.h # ./gui/xicProfile.h
./gui/plot.h # ./gui/plot.h
./gui/mcqThread.h # ./gui/mcqThread.h
./gui/msrunLoaderThread.h # ./gui/msrunLoaderThread.h
./gui/runningBarr.h # ./gui/runningBarr.h
) # )
set(CMAKE_MODULE_PATH ${masschroq_SOURCE_DIR}/modules) set(CMAKE_MODULE_PATH ${masschroq_SOURCE_DIR}/modules)
set(Qwt5_DIR ${masschroq_SOURCE_DIR}/Modules) # set(Qwt5_DIR ${masschroq_SOURCE_DIR}/Modules)
FIND_PACKAGE(Qwt5 REQUIRED) # FIND_PACKAGE(Qwt5 REQUIRED)
# this command will generate rules that will run rcc on all files from SAMPLE_RCS # this command will generate rules that will run rcc on all files from SAMPLE_RCS
...@@ -168,14 +168,13 @@ FIND_PACKAGE(Qwt5 REQUIRED) ...@@ -168,14 +168,13 @@ FIND_PACKAGE(Qwt5 REQUIRED)
# and finally this will run moc: # and finally this will run moc:
QT4_WRAP_CPP( VIEWXIC_MOC_SRCS ${VIEWXIC_MOC_HDRS} ) # QT4_WRAP_CPP( VIEWXIC_MOC_SRCS ${VIEWXIC_MOC_HDRS} )
# QT4_WRAP_CPP( GUI_MOC_SRCS ${GUI_MOC_HDRS} )
QT4_WRAP_CPP( GUI_MOC_SRCS ${GUI_MOC_HDRS} )
# we need this to be able to include headers produced by uic in our code # we need this to be able to include headers produced by uic in our code
# (CMAKE_BINARY_DIR holds a path to the build directory, while INCLUDE_DIRECTORIES() works just like INCLUDEPATH from qmake) # (CMAKE_BINARY_DIR holds a path to the build directory, while INCLUDE_DIRECTORIES() works just like INCLUDEPATH from qmake)
INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} ${Qwt5_INCLUDE_DIR}) # INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} ${Qwt5_INCLUDE_DIR})
IF (WIN32) IF (WIN32)
...@@ -209,11 +208,11 @@ INSTALL(TARGETS ${MASSCHROQ_LIB_NAME} LIBRARY DESTINATION lib) ...@@ -209,11 +208,11 @@ INSTALL(TARGETS ${MASSCHROQ_LIB_NAME} LIBRARY DESTINATION lib)
# if lib quanti is graphical # if lib quanti is graphical
#TARGET_LINK_LIBRARIES(masschroq libmasschroq ${QT_LIBRARIES} ${Qwt5_Qt4_LIBRARY}) #TARGET_LINK_LIBRARIES(masschroq libmasschroq ${QT_LIBRARIES} ${Qwt5_Qt4_LIBRARY})
ADD_EXECUTABLE(viewxic qtquanti/viewxic.cpp ${VIEWXIC_SRCS} ${VIEWXIC_MOC_SRCS}) # ADD_EXECUTABLE(viewxic qtquanti/viewxic.cpp ${VIEWXIC_SRCS} ${VIEWXIC_MOC_SRCS})
TARGET_LINK_LIBRARIES(viewxic ${MASSCHROQ_LIB_NAME} ${QT_LIBRARIES} ${Qwt5_Qt4_LIBRARY}) # TARGET_LINK_LIBRARIES(viewxic ${MASSCHROQ_LIB_NAME} ${QT_LIBRARIES} ${Qwt5_Qt4_LIBRARY})
ADD_EXECUTABLE(mcq_gui gui/gui.cpp ${GUI_SRCS} ${GUI_MOC_SRCS}) # ADD_EXECUTABLE(mcq_gui gui/gui.cpp ${GUI_SRCS} ${GUI_MOC_SRCS})
TARGET_LINK_LIBRARIES(mcq_gui ${MASSCHROQ_LIB_NAME} ${QT_LIBRARIES} ${Qwt5_Qt4_LIBRARY}) # TARGET_LINK_LIBRARIES(mcq_gui ${MASSCHROQ_LIB_NAME} ${QT_LIBRARIES} ${Qwt5_Qt4_LIBRARY})
#ADD_EXECUTABLE(visualqms visualqms.cpp ${VIEWXIC_SRCS} ${VIEWXIC_MOC_SRCS} ${SAXLIB_SRCS} ${OBWARP_SRCS}) #ADD_EXECUTABLE(visualqms visualqms.cpp ${VIEWXIC_SRCS} ${VIEWXIC_MOC_SRCS} ${SAXLIB_SRCS} ${OBWARP_SRCS})
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
#include <QStringList> #include <QStringList>
#include <algorithm> #include <algorithm>
Quantificator::Quantificator(const QString & xml_id, const msRunHashGroup * quanti_group, Quantificator::Quantificator(const QString & xml_id,
const msRunHashGroup * quanti_group,
QuantificationMethod * quanti_method) QuantificationMethod * quanti_method)
: :
_xml_id(xml_id) _xml_id(xml_id)
...@@ -31,19 +32,23 @@ Quantificator::~Quantificator() { ...@@ -31,19 +32,23 @@ Quantificator::~Quantificator() {
std::vector<QuantiItemBase *>::iterator it; std::vector<QuantiItemBase *>::iterator it;
for (it = _quanti_items->begin(); for (it = _quanti_items->begin();
it != _quanti_items->end(); it != _quanti_items->end();
++it) { ++it)
if (*it != 0) { {
if (*it != 0)
{
delete (*it); delete (*it);
*it = 0; *it = 0;
} }
} }
if (_quanti_items != 0) { if (_quanti_items != 0)
{
delete _quanti_items; delete _quanti_items;
_quanti_items = 0; _quanti_items = 0;
} }
if (_peak_matcher != 0) { if (_peak_matcher != 0)
{
delete _peak_matcher; delete _peak_matcher;
_peak_matcher = 0; _peak_matcher = 0;
} }
...@@ -51,27 +56,32 @@ Quantificator::~Quantificator() { ...@@ -51,27 +56,32 @@ Quantificator::~Quantificator() {
} }
void void
Quantificator::set_quanti_group(const msRunHashGroup * quanti_group) { Quantificator::set_quanti_group(const msRunHashGroup * quanti_group)
{
_group_to_quantify = quanti_group; _group_to_quantify = quanti_group;
} }
void void
Quantificator::set_quanti_method(QuantificationMethod * quanti_method) { Quantificator::set_quanti_method(QuantificationMethod * quanti_method)
{
_quanti_method = quanti_method; _quanti_method = quanti_method;
} }
void void
Quantificator::set_matching_mode(const mcq_matching_mode & match_mode) { Quantificator::set_matching_mode(const mcq_matching_mode & match_mode)
{
_peak_matcher->set_matching_mode(match_mode); _peak_matcher->set_matching_mode(match_mode);
} }
const QString & const QString &
Quantificator::get_quanti_group_id() const { Quantificator::get_quanti_group_id() const
{
return (_group_to_quantify->getXmlId()); return (_group_to_quantify->getXmlId());
} }
void void
Quantificator::add_peptide_quanti_items(vector<const Peptide *> & isotope_peptides) { Quantificator::add_peptide_quanti_items(vector<const Peptide *> & isotope_peptides)
{
XicExtractionMethodBase * extraction_method = XicExtractionMethodBase * extraction_method =
_quanti_method->getXicExtractionMethod(); _quanti_method->getXicExtractionMethod();
...@@ -81,7 +91,8 @@ Quantificator::add_peptide_quanti_items(vector<const Peptide *> & isotope_peptid ...@@ -81,7 +91,8 @@ Quantificator::add_peptide_quanti_items(vector<const Peptide *> & isotope_peptid
/// for each peptide (or isotope in the vector), we will create a peptide quanti item /// for each peptide (or isotope in the vector), we will create a peptide quanti item
for (itpep = isotope_peptides.begin(); for (itpep = isotope_peptides.begin();
itpep != isotope_peptides.end(); itpep != isotope_peptides.end();
++itpep) { ++itpep)
{
/// get the set of charges z the peptide is observed in the current group, /// get the set of charges z the peptide is observed in the current group,
/// and construct a quantification item for each peptide/z /// and construct a quantification item for each peptide/z
...@@ -93,11 +104,13 @@ Quantificator::add_peptide_quanti_items(vector<const Peptide *> & isotope_peptid ...@@ -93,11 +104,13 @@ Quantificator::add_peptide_quanti_items(vector<const Peptide *> & isotope_peptid
std::set<unsigned int>::const_iterator itz; std::set<unsigned int>::const_iterator itz;
for (itz = s_charges->begin(); for (itz = s_charges->begin();
itz != s_charges->end(); itz != s_charges->end();
++itz) { ++itz)
{
/// calculate the mean bestRt for this peptide/z /// calculate the mean bestRt for this peptide/z
mcq_double rt((*itpep)->getMeanBestRt(*_group_to_quantify)); mcq_double rt((*itpep)->getMeanBestRt(*_group_to_quantify));
/// this test is not necessary here /// this test is not necessary here
if (rt != -1) { if (rt != -1)
{
extraction_method->setMz((*itpep)->getMz(*itz)); extraction_method->setMz((*itpep)->getMz(*itz));
quanti_item = new QuantiItemPeptide(*extraction_method, quanti_item = new QuantiItemPeptide(*extraction_method,
*itpep, *itpep,
...@@ -112,7 +125,8 @@ Quantificator::add_peptide_quanti_items(vector<const Peptide *> & isotope_peptid ...@@ -112,7 +125,8 @@ Quantificator::add_peptide_quanti_items(vector<const Peptide *> & isotope_peptid
} }
void void
Quantificator::add_mz_quanti_items(const QStringList & mz_list) { Quantificator::add_mz_quanti_items(const QStringList & mz_list)
{
XicExtractionMethodBase * extraction_method = XicExtractionMethodBase * extraction_method =
_quanti_method->getXicExtractionMethod(); _quanti_method->getXicExtractionMethod();
...@@ -121,8 +135,8 @@ Quantificator::add_mz_quanti_items(const QStringList & mz_list) { ...@@ -121,8 +135,8 @@ Quantificator::add_mz_quanti_items(const QStringList & mz_list) {
QStringList::const_iterator it; QStringList::const_iterator it;
for (it = mz_list.begin(); it != mz_list.end(); ++it) { for (it = mz_list.begin(); it != mz_list.end(); ++it)
{
extraction_method->setMz(it->toDouble()); extraction_method->setMz(it->toDouble());
quanti_item = new QuantiItemBase(*extraction_method); quanti_item = new QuantiItemBase(*extraction_method);
_quanti_items->push_back(quanti_item); _quanti_items->push_back(quanti_item);
...@@ -130,7 +144,8 @@ Quantificator::add_mz_quanti_items(const QStringList & mz_list) { ...@@ -130,7 +144,8 @@ Quantificator::add_mz_quanti_items(const QStringList & mz_list) {
} }
void void
Quantificator::add_mzrt_quanti_item(const QString & mz, const QString & rt) { Quantificator::add_mzrt_quanti_item(const QString & mz, const QString & rt)
{
XicExtractionMethodBase * extraction_method = XicExtractionMethodBase * extraction_method =
_quanti_method->getXicExtractionMethod(); _quanti_method->getXicExtractionMethod();
...@@ -144,12 +159,15 @@ Quantificator::add_mzrt_quanti_item(const QString & mz, const QString & rt) { ...@@ -144,12 +159,15 @@ Quantificator::add_mzrt_quanti_item(const QString & mz, const QString & rt) {
} }
void void
Quantificator::setMonitor(MonitorBase * monitor) { Quantificator::setMonitor(MonitorBase * monitor)
{
_monitor = monitor; _monitor = monitor;
} }
struct CmpQuantiItems { struct CmpQuantiItems
bool operator() (const QuantiItemBase * l1, const QuantiItemBase * l2) { {
bool operator() (const QuantiItemBase * l1, const QuantiItemBase * l2)
{
const mcq_double mz1 = l1->get_mz(); const mcq_double mz1 = l1->get_mz();
const mcq_double mz2 = l2->get_mz(); const mcq_double mz2 = l2->get_mz();
return (mz1 < mz2); return (mz1 < mz2);
...@@ -158,12 +176,14 @@ struct CmpQuantiItems { ...@@ -158,12 +176,14 @@ struct CmpQuantiItems {
void void
Quantificator::sortQuantiItems() { Quantificator::sortQuantiItems()
{
sort(_quanti_items->begin(), _quanti_items->end(), QuantiItemsCmp); sort(_quanti_items->begin(), _quanti_items->end(), QuantiItemsCmp);
} }
void void
Quantificator::quantify() { Quantificator::quantify()
{
sortQuantiItems(); sortQuantiItems();
...@@ -220,9 +240,8 @@ Quantificator::quantify() { ...@@ -220,9 +240,8 @@ Quantificator::quantify() {
current_xic = current_msrun->extractXic(xic_type, current_mz); current_xic = current_msrun->extractXic(xic_type, current_mz);
if (current_xic == 0) { if (current_xic == 0)
qDebug() << "detectAndQuantify null xic "; qDebug() << "detectAndQuantify null xic ";
}
current_xic->setMonitor(*_monitor); current_xic->setMonitor(*_monitor);
_monitor->setXic(current_xic); _monitor->setXic(current_xic);
...@@ -245,7 +264,8 @@ Quantificator::quantify() { ...@@ -245,7 +264,8 @@ Quantificator::quantify() {
_monitor->setEndCurrentSearchItem(); _monitor->setEndCurrentSearchItem();
// clean up // clean up
if (matched_peak_list != 0) { if (matched_peak_list != 0)
{
delete matched_peak_list; delete matched_peak_list;
matched_peak_list = 0; matched_peak_list = 0;
} }
...@@ -260,19 +280,21 @@ Quantificator::quantify() { ...@@ -260,19 +280,21 @@ Quantificator::quantify() {
<< "': quantification method '" << quanti_method_id.toStdString() << "': quantification method '" << quanti_method_id.toStdString()
<< "': quantification finished" << endl; << "': quantification finished" << endl;
cout << "MS run group '" << group_id.toStdString()
<< "': post matching begin" << endl;
performPostMatching(); performPostMatching();
_monitor->setEndCurrentGroup(); _monitor->setEndCurrentGroup();
} }
void void
Quantificator::performPostMatching() { Quantificator::performPostMatching()
if (_peak_matcher->isPostMatchingRequired()) { {
_monitor->setPostMatchingOn(); if (_peak_matcher->isPostMatchingRequired())
{
QString group_id = _group_to_quantify->getXmlId(); QString group_id = _group_to_quantify->getXmlId();
cout << "MS run group '" << group_id.toStdString()
<< "': post matching begin" << endl;
_monitor->setPostMatchingOn();
vector<QuantiItemBase *>::const_iterator itmz; vector<QuantiItemBase *>::const_iterator itmz;
Msrun * current_msrun; Msrun * current_msrun;
unsigned int count_msruns(1); unsigned int count_msruns(1);
...@@ -291,7 +313,8 @@ Quantificator::performPostMatching() { ...@@ -291,7 +313,8 @@ Quantificator::performPostMatching() {
_monitor->setCurrentMsrun(current_msrun); _monitor->setCurrentMsrun(current_msrun);
for (itmz = _quanti_items->begin(); for (itmz = _quanti_items->begin();
itmz != _quanti_items->end(); itmz != _quanti_items->end();
++itmz) { ++itmz)
{
vector<xicPeak *> * post_matched_peaks = vector<xicPeak *> * post_matched_peaks =
_peak_matcher->newPostMatchedPeaks(*itmz, current_msrun); _peak_matcher->newPostMatchedPeaks(*itmz, current_msrun);
_monitor->setPostMatchedPeaks(*itmz, post_matched_peaks); _monitor->setPostMatchedPeaks(*itmz, post_matched_peaks);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment