Skip to content
Snippets Groups Projects
Commit 36e80b5f authored by Olivier Langella's avatar Olivier Langella
Browse files

new protein xtp object and sequence database

parent 77693a1a
No related branches found
No related tags found
No related merge requests found
......@@ -58,6 +58,8 @@ SET(CPP_FILES
core/peptidematch.cpp
./core/project.cpp
core/proteinmatch.cpp
core/proteinxtp.cpp
core/sequencedatabase.cpp
core/identification_sources/identificationdatasource.cpp
core/identification_sources/identificationxtandemfile.cpp
files/xpipfile.cpp
......
/*******************************************************************************
* Copyright (c) 2017 Olivier Langella <olivier.langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp 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.
*
* XTPcpp 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 XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and implementation
******************************************************************************/
#include "automaticfilterparameters.h"
AutomaticFilterParameters::AutomaticFilterParameters()
{
}
AutomaticFilterParameters::AutomaticFilterParameters(const AutomaticFilterParameters& other)
{
}
AutomaticFilterParameters::~AutomaticFilterParameters()
{
}
void AutomaticFilterParameters::setFilterPeptideEvalue( pappso::pappso_double evalue) {
_filter_minimum_peptide_evalue = evalue;
}
void AutomaticFilterParameters::setFilterProteinEvalue( pappso::pappso_double evalue) {
_filter_minimum_protein_evalue = evalue;
}
void AutomaticFilterParameters::setFilterMinimumPeptidePerMatch(unsigned int number) {
_filter_minimum_peptide_per_match = number;
}
void AutomaticFilterParameters::setFilterCrossSamplePeptideNumber(bool cross) {
_filter_is_cross_sample_peptide_number = cross;
}
pappso::pappso_double AutomaticFilterParameters::getFilterPeptideEvalue() const {
return (_filter_minimum_peptide_evalue );
}
pappso::pappso_double AutomaticFilterParameters::getFilterProteinEvalue() const {
return ( _filter_minimum_protein_evalue );
}
unsigned int AutomaticFilterParameters::getFilterMinimumPeptidePerMatch()const {
return (_filter_minimum_peptide_per_match );
}
bool AutomaticFilterParameters::getFilterCrossSamplePeptideNumber()const {
return _filter_is_cross_sample_peptide_number ;
}
/*******************************************************************************
* Copyright (c) 2017 Olivier Langella <olivier.langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp 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.
*
* XTPcpp 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 XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and implementation
******************************************************************************/
#ifndef AUTOMATICFILTERPARAMETERS_H
#define AUTOMATICFILTERPARAMETERS_H
#include <pappsomspp/types.h>
class AutomaticFilterParameters
{
public:
AutomaticFilterParameters();
AutomaticFilterParameters(const AutomaticFilterParameters& other);
~AutomaticFilterParameters();
void setFilterPeptideEvalue( pappso::pappso_double evalue);
void setFilterProteinEvalue( pappso::pappso_double evalue);
void setFilterMinimumPeptidePerMatch(unsigned int number);
void setFilterCrossSamplePeptideNumber(bool cross);
pappso::pappso_double getFilterPeptideEvalue() const;
pappso::pappso_double getFilterProteinEvalue()const;
unsigned int getFilterMinimumPeptidePerMatch()const;
bool getFilterCrossSamplePeptideNumber()const;
private :
pappso::pappso_double _filter_minimum_peptide_evalue=1;
pappso::pappso_double _filter_minimum_protein_evalue=1;
unsigned int _filter_minimum_peptide_per_match=1;
bool _filter_is_cross_sample_peptide_number=false;
};
#endif // AUTOMATICFILTERPARAMETERS_H
......@@ -24,6 +24,7 @@
#include "identificationgroup.h"
#include "project.h"
IdentificationGroup::IdentificationGroup(Project * project)
{
_p_project = project;
......@@ -43,6 +44,7 @@ void IdentificationGroup::updateAutomaticFilters(const AutomaticFilterParameters
p_protein_match->updateAutomaticFilters(automatic_filter_parameters);
}
}
void IdentificationGroup::addProteinMatch(ProteinMatch * protein_match) {
_protein_match_list.push_back(protein_match);
......
......@@ -63,6 +63,9 @@ void ProteinMatch::updateAutomaticFilters(const AutomaticFilterParameters & auto
}
//update protein evalue ?
if (_number_of_valid_peptides >= automatic_filter_parameters.getFilterMinimumPeptidePerMatch()) {
if (_evalue <= automatic_filter_parameters.getFilterProteinEvalue()) {
_proxy_valid = true;
......@@ -70,7 +73,7 @@ void ProteinMatch::updateAutomaticFilters(const AutomaticFilterParameters & auto
}
}
const pappso::ProteinSp & ProteinMatch::getProteinSp() const {
const ProteinXtpSp & ProteinMatch::getProteinXtpSp() const {
return _protein_sp;
}
void ProteinMatch::setEvalue(pappso::pappso_double evalue) {
......@@ -80,7 +83,7 @@ void ProteinMatch::setEvalue(pappso::pappso_double evalue) {
pappso::pappso_double ProteinMatch::getEvalue() const {
return _evalue;
}
void ProteinMatch::setProteinSp(pappso::ProteinSp protein_sp) {
void ProteinMatch::setProteinXtpSp(ProteinXtpSp protein_sp) {
_protein_sp = protein_sp;
}
......@@ -92,7 +95,7 @@ bool ProteinMatch::isChecked() const {
return _checked;
}
bool ProteinMatch::isValidAndChecked() const{
bool ProteinMatch::isValidAndChecked() const {
return _proxy_valid && _checked;
}
......
......@@ -21,25 +21,25 @@
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and implementation
******************************************************************************/
#ifndef PROTEINMATCH_H
#define PROTEINMATCH_H
#include <vector>
#include <pappsomspp/types.h>
#include <pappsomspp/protein/protein.h>
#include "proteinxtp.h"
#include "peptidematch.h"
#include "automaticfilterparameters.h"
#ifndef PROTEINMATCH_H
#define PROTEINMATCH_H
class ProteinMatch
{
public:
ProteinMatch();
~ProteinMatch();
const pappso::ProteinSp & getProteinSp() const;
const ProteinXtpSp & getProteinXtpSp() const;
void setEvalue(pappso::pappso_double evalue);
pappso::pappso_double getEvalue() const;
void setProteinSp(pappso::ProteinSp protein_sp);
void setProteinXtpSp(ProteinXtpSp protein_sp);
void addPeptideMatch(PeptideMatch * peptide_match);
std::vector<PeptideMatch *> & getPeptideMatchList();
void setChecked(bool arg1);
......@@ -54,7 +54,7 @@ public:
private:
std::vector<PeptideMatch *> _peptide_match_list;
pappso::ProteinSp _protein_sp = nullptr;
ProteinXtpSp _protein_sp = nullptr;
pappso::pappso_double _evalue=0;
/** @brief manually checked by user (true by default)
*/
......
/*******************************************************************************
* Copyright (c) 2017 Olivier Langella <olivier.langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp 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.
*
* XTPcpp 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 XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and implementation
******************************************************************************/
#include "proteinxtp.h"
ProteinXtp::ProteinXtp():pappso::Protein()
{
}
ProteinXtp::ProteinXtp(const ProteinXtp& other):pappso::Protein(other)
{
_is_decoy=other._is_decoy;
_is_contaminant=other._is_contaminant;
}
ProteinXtp::~ProteinXtp()
{
}
bool ProteinXtp::operator==(const ProteinXtp& other) const
{
return pappso::Protein::operator==(other);
}
ProteinXtpSp ProteinXtp::makeProteinXtpSp() const {
return std::make_shared<ProteinXtp>(*this);
}
/*******************************************************************************
* Copyright (c) 2017 Olivier Langella <olivier.langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp 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.
*
* XTPcpp 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 XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and implementation
******************************************************************************/
#include <pappsomspp/protein/protein.h>
#include "sequencedatabase.h"
#ifndef PROTEIN_XTP_H
#define PROTEIN_XTP_H
class ProteinXtp;
/** \brief shared pointer on a Protein object
*/
typedef std::shared_ptr<const ProteinXtp> ProteinXtpSp;
class ProteinXtp : public pappso::Protein {
public:
ProteinXtp();
ProteinXtp(const ProteinXtp& other);
virtual ~ProteinXtp();
bool operator==(const ProteinXtp& other) const;
ProteinXtpSp makeProteinXtpSp() const;
private:
SequenceDatabase * _p_sequence_database;
bool _is_decoy=false;
bool _is_contaminant=false;
};
#endif // PROTEIN_XTP_H
/*******************************************************************************
* Copyright (c) 2017 Olivier Langella <olivier.langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp 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.
*
* XTPcpp 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 XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and implementation
******************************************************************************/
#include "sequencedatabase.h"
SequenceDatabase::SequenceDatabase()
{
}
SequenceDatabase::~SequenceDatabase()
{
}
/*******************************************************************************
* Copyright (c) 2017 Olivier Langella <olivier.langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp 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.
*
* XTPcpp 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 XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and implementation
******************************************************************************/
#ifndef SEQUENCEDATABASE_H
#define SEQUENCEDATABASE_H
#include <memory>
class SequenceDatabase;
/** \brief shared pointer on a SequenceDatabase object
*/
typedef std::shared_ptr<SequenceDatabase> SequenceDatabaseSp;
class SequenceDatabase
{
public:
SequenceDatabase();
virtual ~SequenceDatabase();
};
#endif // SEQUENCEDATABASE_H
......@@ -73,7 +73,7 @@ PeptideListWindow::~PeptideListWindow()
void PeptideListWindow::setProteinMatch(Project * p_project, ProteinMatch * p_protein_match) {
_peptide_table_model_p->setProteinMatch(p_project, p_protein_match);
_p_proxy_model->setSourceModel(_peptide_table_model_p);
ui->proteinLabel->setText(p_protein_match->getProteinSp().get()->getDescription());
ui->proteinLabel->setText(p_protein_match->getProteinXtpSp().get()->getDescription());
}
......@@ -167,12 +167,12 @@ QVariant ProteinTableModel::data(const QModelIndex &index, int role ) const {
}
if (col == 1) {
if (_p_identification_group != nullptr) {
return _p_identification_group->getProteinMatchList().at(row)->getProteinSp().get()->getAccession();
return _p_identification_group->getProteinMatchList().at(row)->getProteinXtpSp().get()->getAccession();
}
}
if (col == 2) {
if (_p_identification_group != nullptr) {
return _p_identification_group->getProteinMatchList().at(row)->getProteinSp().get()->getDescription();
return _p_identification_group->getProteinMatchList().at(row)->getProteinXtpSp().get()->getDescription();
}
}
if (col == 3) {
......@@ -219,7 +219,7 @@ void ProteinTableModel::onTableClicked(const QModelIndex &index)
bool ProteinTableModel::acceptRow(int source_row) {
ProteinMatch * protein_match = _p_identification_group->getProteinMatchList().at(source_row);
if (!_protein_search_string.isEmpty()) {
if (!protein_match->getProteinSp().get()->getDescription().contains(_protein_search_string)) {
if (!protein_match->getProteinXtpSp().get()->getDescription().contains(_protein_search_string)) {
return false;
}
}
......
......@@ -292,7 +292,7 @@ bool XpipSaxHandler::endElement_sequence() {
return true;
}
bool XpipSaxHandler::endElement_protein() {
_p_protein_match->setProteinSp(_current_protein.makeProteinSp());
_p_protein_match->setProteinXtpSp(_current_protein.makeProteinXtpSp());
return true;
}
......
......@@ -25,7 +25,7 @@
#include <QXmlDefaultHandler>
#include <pappsomspp/pappsoexception.h>
#include <pappsomspp/protein/protein.h>
#include "../core/proteinxtp.h"
#include <pappsomspp/peptide/peptide.h>
#include <pappsomspp/amino_acid/aamodification.h>
#include "../core/project.h"
......@@ -83,7 +83,7 @@ private:
Project * _p_project;
ProteinMatch * _p_protein_match;
PeptideMatch * _p_peptide_match;
pappso::Protein _current_protein;
ProteinXtp _current_protein;
pappso::NoConstPeptideSp _current_peptide_sp;
IdentificationGroup * _current_identification_group_p;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment