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
./qtquanti/choose_mz_precision_widget.h
)
SET(GUI_SRCS
./gui/mainwindow.cpp
./gui/masschroq_gui.cpp
./gui/xicSelectionWidget.cpp
./gui/filterBackgroundWidget.cpp
./gui/plotStyle.cpp
./gui/xicProfile.cpp
./gui/xicPlot.cpp
./gui/plot.cpp
./gui/mcqThread.cpp
./gui/msrunLoaderThread.cpp
./gui/runningBarr.cpp
)
# another list, this time it includes all header files that should be treated with moc
SET(GUI_MOC_HDRS
./gui/mainwindow.h
./gui/xicSelectionWidget.h
./gui/filterBackgroundWidget.h
./gui/xicProfile.h
./gui/plot.h
./gui/mcqThread.h
./gui/msrunLoaderThread.h
./gui/runningBarr.h
)
# SET(GUI_SRCS
# ./gui/mainwindow.cpp
# ./gui/masschroq_gui.cpp
# ./gui/xicSelectionWidget.cpp
# ./gui/filterBackgroundWidget.cpp
# ./gui/plotStyle.cpp
# ./gui/xicProfile.cpp
# ./gui/xicPlot.cpp
# ./gui/plot.cpp
# ./gui/mcqThread.cpp
# ./gui/msrunLoaderThread.cpp
# ./gui/runningBarr.cpp
# )
# # another list, this time it includes all header files that should be treated with moc
# SET(GUI_MOC_HDRS
# ./gui/mainwindow.h
# ./gui/xicSelectionWidget.h
# ./gui/filterBackgroundWidget.h
# ./gui/xicProfile.h
# ./gui/plot.h
# ./gui/mcqThread.h
# ./gui/msrunLoaderThread.h
# ./gui/runningBarr.h
# )
set(CMAKE_MODULE_PATH ${masschroq_SOURCE_DIR}/modules)
set(Qwt5_DIR ${masschroq_SOURCE_DIR}/Modules)
FIND_PACKAGE(Qwt5 REQUIRED)
# set(Qwt5_DIR ${masschroq_SOURCE_DIR}/Modules)
# FIND_PACKAGE(Qwt5 REQUIRED)
# this command will generate rules that will run rcc on all files from SAMPLE_RCS
......@@ -168,14 +168,13 @@ FIND_PACKAGE(Qwt5 REQUIRED)
# and finally this will run moc:
QT4_WRAP_CPP( VIEWXIC_MOC_SRCS ${VIEWXIC_MOC_HDRS} )
QT4_WRAP_CPP( GUI_MOC_SRCS ${GUI_MOC_HDRS} )
# QT4_WRAP_CPP( VIEWXIC_MOC_SRCS ${VIEWXIC_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
# (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)
......@@ -209,11 +208,11 @@ INSTALL(TARGETS ${MASSCHROQ_LIB_NAME} LIBRARY DESTINATION lib)
# if lib quanti is graphical
#TARGET_LINK_LIBRARIES(masschroq libmasschroq ${QT_LIBRARIES} ${Qwt5_Qt4_LIBRARY})
ADD_EXECUTABLE(viewxic qtquanti/viewxic.cpp ${VIEWXIC_SRCS} ${VIEWXIC_MOC_SRCS})
TARGET_LINK_LIBRARIES(viewxic ${MASSCHROQ_LIB_NAME} ${QT_LIBRARIES} ${Qwt5_Qt4_LIBRARY})
# ADD_EXECUTABLE(viewxic qtquanti/viewxic.cpp ${VIEWXIC_SRCS} ${VIEWXIC_MOC_SRCS})
# TARGET_LINK_LIBRARIES(viewxic ${MASSCHROQ_LIB_NAME} ${QT_LIBRARIES} ${Qwt5_Qt4_LIBRARY})
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})
# 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})
#ADD_EXECUTABLE(visualqms visualqms.cpp ${VIEWXIC_SRCS} ${VIEWXIC_MOC_SRCS} ${SAXLIB_SRCS} ${OBWARP_SRCS})
......
......@@ -14,7 +14,8 @@
#include <QStringList>
#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)
:
_xml_id(xml_id)
......@@ -31,19 +32,23 @@ Quantificator::~Quantificator() {
std::vector<QuantiItemBase *>::iterator it;
for (it = _quanti_items->begin();
it != _quanti_items->end();
++it) {
if (*it != 0) {
++it)
{
if (*it != 0)
{
delete (*it);
*it = 0;
}
}
if (_quanti_items != 0) {
if (_quanti_items != 0)
{
delete _quanti_items;
_quanti_items = 0;
}
if (_peak_matcher != 0) {
if (_peak_matcher != 0)
{
delete _peak_matcher;
_peak_matcher = 0;
}
......@@ -51,27 +56,32 @@ Quantificator::~Quantificator() {
}
void
Quantificator::set_quanti_group(const msRunHashGroup * quanti_group) {
Quantificator::set_quanti_group(const msRunHashGroup * quanti_group)
{
_group_to_quantify = quanti_group;
}
void
Quantificator::set_quanti_method(QuantificationMethod * quanti_method) {
Quantificator::set_quanti_method(QuantificationMethod * quanti_method)
{
_quanti_method = quanti_method;
}
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);
}
const QString &
Quantificator::get_quanti_group_id() const {
Quantificator::get_quanti_group_id() const
{
return (_group_to_quantify->getXmlId());
}
void
Quantificator::add_peptide_quanti_items(vector<const Peptide *> & isotope_peptides) {
Quantificator::add_peptide_quanti_items(vector<const Peptide *> & isotope_peptides)
{
XicExtractionMethodBase * extraction_method =
_quanti_method->getXicExtractionMethod();
......@@ -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 (itpep = isotope_peptides.begin();
itpep != isotope_peptides.end();
++itpep) {
++itpep)
{
/// get the set of charges z the peptide is observed in the current group,
/// and construct a quantification item for each peptide/z
......@@ -93,11 +104,13 @@ Quantificator::add_peptide_quanti_items(vector<const Peptide *> & isotope_peptid
std::set<unsigned int>::const_iterator itz;
for (itz = s_charges->begin();
itz != s_charges->end();
++itz) {
++itz)
{
/// calculate the mean bestRt for this peptide/z
mcq_double rt((*itpep)->getMeanBestRt(*_group_to_quantify));
/// this test is not necessary here
if (rt != -1) {
if (rt != -1)
{
extraction_method->setMz((*itpep)->getMz(*itz));
quanti_item = new QuantiItemPeptide(*extraction_method,
*itpep,
......@@ -112,7 +125,8 @@ Quantificator::add_peptide_quanti_items(vector<const Peptide *> & isotope_peptid
}
void
Quantificator::add_mz_quanti_items(const QStringList & mz_list) {
Quantificator::add_mz_quanti_items(const QStringList & mz_list)
{
XicExtractionMethodBase * extraction_method =
_quanti_method->getXicExtractionMethod();
......@@ -121,8 +135,8 @@ Quantificator::add_mz_quanti_items(const QStringList & mz_list) {
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());
quanti_item = new QuantiItemBase(*extraction_method);
_quanti_items->push_back(quanti_item);
......@@ -130,7 +144,8 @@ Quantificator::add_mz_quanti_items(const QStringList & mz_list) {
}
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 =
_quanti_method->getXicExtractionMethod();
......@@ -144,12 +159,15 @@ Quantificator::add_mzrt_quanti_item(const QString & mz, const QString & rt) {
}
void
Quantificator::setMonitor(MonitorBase * monitor) {
Quantificator::setMonitor(MonitorBase * monitor)
{
_monitor = monitor;
}
struct CmpQuantiItems {
bool operator() (const QuantiItemBase * l1, const QuantiItemBase * l2) {
struct CmpQuantiItems
{
bool operator() (const QuantiItemBase * l1, const QuantiItemBase * l2)
{
const mcq_double mz1 = l1->get_mz();
const mcq_double mz2 = l2->get_mz();
return (mz1 < mz2);
......@@ -158,12 +176,14 @@ struct CmpQuantiItems {
void
Quantificator::sortQuantiItems() {
Quantificator::sortQuantiItems()
{
sort(_quanti_items->begin(), _quanti_items->end(), QuantiItemsCmp);
}
void
Quantificator::quantify() {
Quantificator::quantify()
{
sortQuantiItems();
......@@ -220,9 +240,8 @@ Quantificator::quantify() {
current_xic = current_msrun->extractXic(xic_type, current_mz);
if (current_xic == 0) {
if (current_xic == 0)
qDebug() << "detectAndQuantify null xic ";
}
current_xic->setMonitor(*_monitor);
_monitor->setXic(current_xic);
......@@ -245,7 +264,8 @@ Quantificator::quantify() {
_monitor->setEndCurrentSearchItem();
// clean up
if (matched_peak_list != 0) {
if (matched_peak_list != 0)
{
delete matched_peak_list;
matched_peak_list = 0;
}
......@@ -260,19 +280,21 @@ Quantificator::quantify() {
<< "': quantification method '" << quanti_method_id.toStdString()
<< "': quantification finished" << endl;
cout << "MS run group '" << group_id.toStdString()
<< "': post matching begin" << endl;
performPostMatching();
_monitor->setEndCurrentGroup();
}
void
Quantificator::performPostMatching() {
if (_peak_matcher->isPostMatchingRequired()) {
_monitor->setPostMatchingOn();
Quantificator::performPostMatching()
{
if (_peak_matcher->isPostMatchingRequired())
{
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;
Msrun * current_msrun;
unsigned int count_msruns(1);
......@@ -291,7 +313,8 @@ Quantificator::performPostMatching() {
_monitor->setCurrentMsrun(current_msrun);
for (itmz = _quanti_items->begin();
itmz != _quanti_items->end();
++itmz) {
++itmz)
{
vector<xicPeak *> * post_matched_peaks =
_peak_matcher->newPostMatchedPeaks(*itmz, current_msrun);
_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