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

xtpcpp (0.1.9-1) jessie

parent 541869c6
No related branches found
Tags xtpcpp_0.1.9-1
No related merge requests found
......@@ -42,7 +42,7 @@ SET(SOFTWARE_NAME "XTPcpp")
SET(XTPCPP_VERSION_MAJOR "0")
SET(XTPCPP_VERSION_MINOR "1")
SET(XTPCPP_VERSION_PATCH "8")
SET(XTPCPP_VERSION_PATCH "9")
SET(XTPCPP_VERSION "${XTPCPP_VERSION_MAJOR}.${XTPCPP_VERSION_MINOR}.${XTPCPP_VERSION_PATCH}")
# Set the CMAKE_PREFIX_PATH for the find_library fonction when using non
......
xtpcpp (0.1.9-1) jessie; urgency=medium
* MGF peak sorting, waiting dialog, new ODS sheets (samples, groups)
-- Olivier Langella <Olivier.Langella@moulon.inra.fr> Tue, 09 May 2017 11:30:23 +0200
xtpcpp (0.1.8-1) jessie; urgency=medium
* better peptide viewer
......
......@@ -54,8 +54,7 @@ const QString & IdentificationDataSource::getResourceName () const {
}
const QString IdentificationDataSource::getSampleName () const {
QFileInfo file(_ms_run_sp.get()->getFilename());
return file.baseName();
return _ms_run_sp.get()->getSampleName();
}
void IdentificationDataSource::setMsRunSp (MsRunSp ms_run_sp) {
......@@ -68,6 +67,18 @@ MsRunSp IdentificationDataSource::getMsRunSp () const {
IdentificationEngine IdentificationDataSource::getIdentificationEngine() const {
return _engine;
}
const QString IdentificationDataSource::getIdentificationEngineName() const {
QString name = "unknown";
switch (_engine) {
case IdentificationEngine::XTandem :
name = "X!Tandem";
break;
case IdentificationEngine::peptider :
name = "peptider";
break;
}
return name;
}
const QString& IdentificationDataSource::getIdentificationEngineVersion() const {
return _version;
}
......@@ -78,6 +89,14 @@ void IdentificationDataSource::setIdentificationEngineParam(IdentificationEngine
_params.insert(std::pair<IdentificationEngineParam, QVariant>(param, value));
}
const QVariant IdentificationDataSource::getIdentificationEngineParam(IdentificationEngineParam param) const {
try {
return _params.at(param);
}
catch (std::out_of_range) {
return QVariant();
}
}
pappso::SpectrumSp IdentificationDataSource::getSpectrumSp(unsigned int scan_number) const {
pappso::SpectrumSp spectrum_sp = SpectrumStore::getSpectrumSpFromMsRunSp(_ms_run_sp, scan_number);
return spectrum_sp;
......
......@@ -44,7 +44,12 @@ public:
~IdentificationDataSource();
bool operator==(const IdentificationDataSource& other) const;
/** @brief URL or filename containing identification data
* */
const QString & getResourceName () const;
/** @brief get biological sample name
* */
const QString getSampleName () const;
void setMsRunSp (MsRunSp ms_run_sp);
MsRunSp getMsRunSp () const;
......@@ -60,6 +65,10 @@ public:
/** \brief identification engine
*/
virtual IdentificationEngine getIdentificationEngine() const;
/** \brief identification engine name
*/
const QString getIdentificationEngineName() const;
/** \brief identification engine version
*/
......@@ -72,6 +81,11 @@ public:
*/
virtual void setIdentificationEngineParam(IdentificationEngineParam param, const QVariant& value);
/** \brief get specific identification engine parameter value
*/
virtual const QVariant getIdentificationEngineParam(IdentificationEngineParam param) const;
/** \brief add Fastafile used by the identification engine
*/
void addFastaFile (FastaFileSp file);
......
......@@ -85,6 +85,9 @@ ProteinStore & Project::getProteinStore() {
IdentificationDataSourceStore & Project::getIdentificationDataSourceStore() {
return _identification_data_source_store;
}
const IdentificationDataSourceStore & Project::getIdentificationDataSourceStore() const{
return _identification_data_source_store;
}
const AutomaticFilterParameters & Project::getAutomaticFilterParameters() const {
return _automatic_filter_parameters;
}
......
......@@ -51,6 +51,7 @@ public:
const MsRunStore & getMsRunStore() const;
FastaFileStore & getFastaFileStore();
IdentificationDataSourceStore & getIdentificationDataSourceStore();
const IdentificationDataSourceStore & getIdentificationDataSourceStore() const;
void readXpipFile(QFileInfo xpip_source);
IdentificationGroup* newIdentificationGroup();
......
/**
* \file /output/groupingsheet.cpp
* \date 9/5/2017
* \author Olivier Langella
* \brief ODS grouping sheet
*/
/*******************************************************************************
* 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 "groupingsheet.h"
GroupingSheet::GroupingSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project): _p_project(p_project) {
_p_writer = p_writer;
_p_ods_export = p_ods_export;
p_writer->writeSheet("groups");
writeHeaders();
std::vector<IdentificationGroup *> identification_list = p_project->getIdentificationGroupList();
for (IdentificationGroup * p_ident:identification_list) {
//writeHeaders(p_ident);
writeIdentificationGroup(p_ident);
}
}
void GroupingSheet::writeIdentificationGroup(IdentificationGroup * p_ident) {
_p_writer->writeLine();
if (!_p_project->isCombineMode()) {
_p_writer->writeCell(p_ident->getMsRunSpList().at(0).get()->getSampleName());
}
_p_writer->writeCell((unsigned int) p_ident->countGroup());
_p_writer->writeCell((unsigned int) p_ident->countSubGroup());
_p_writer->writeCell(p_ident->countProteinMatch(ValidationState::grouped));
_p_writer->writeCell(p_ident->countPeptideMatch(ValidationState::grouped));
//_p_writer->writeCell(p_ident->countSequence(ValidationState::grouped));
_p_writer->writeCell(p_ident->countPeptideMassSample(ValidationState::grouped));
_p_writer->writeCell(p_ident->getProteinFdr(ValidationState::valid));
_p_writer->writeCell(p_ident->getPeptideMassFdr(ValidationState::valid));
}
void GroupingSheet::writeHeaders() {
// groups, subgroups, proteins, psm, sequence, peptide/mass, pep FDR, prot FDR
_p_writer->writeLine();
if (!_p_project->isCombineMode()) {
_p_writer->writeCell("sample");
}
_p_writer->setCellAnnotation("number of groups");
_p_writer->writeCell("groups");
_p_writer->setCellAnnotation("number of subgroups");
_p_writer->writeCell("subgroups");
_p_writer->setCellAnnotation("number of grouped proteins");
_p_writer->writeCell("proteins");
_p_writer->setCellAnnotation("number of peptide hits : each grouped peptide spectrum match given by the identification engine");
_p_writer->writeCell("psm");
//_p_writer->writeCell("sequences");
_p_writer->setCellAnnotation("number of unique combinations : grouped peptide sequence+modifications+sample name");
_p_writer->writeCell("peptide/mass/sample");
_p_writer->setCellAnnotation("FDR at the protein level (number of decoy valid proteins / totale number of valid proteins)");
_p_writer->writeCell("prot FDR");
_p_writer->setCellAnnotation("FDR at the peptide level (number of decoy valid peptides / totale number of valid peptides)");
_p_writer->writeCell("pep FDR");
}
/**
* \file /output/groupingsheet.h
* \date 9/5/2017
* \author Olivier Langella
* \brief ODS grouping sheet
*/
/*******************************************************************************
* 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 GROUPINGSHEET_H
#define GROUPINGSHEET_H
#include "../../core/project.h"
#include <odsstream/calcwriterinterface.h>
#include "odsexport.h"
class GroupingSheet
{
public :
GroupingSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project);
private:
void writeIdentificationGroup(IdentificationGroup * p_ident);
void writeHeaders();
private :
OdsExport * _p_ods_export;
const Project * _p_project;
CalcWriterInterface * _p_writer;
};
#endif // GROUPINGSHEET_H
......@@ -33,9 +33,51 @@ SampleSheet::SampleSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writ
_p_writer = p_writer;
_p_ods_export = p_ods_export;
p_writer->writeSheet("samples");
std::vector<MsRunSp> msrun_list = _p_project->getMsRunStore().getMsRunList();
for (MsRunSp msrun_sp: msrun_list) {
writeHeaders();
std::vector<IdentificationDataSourceSp> idrun_list = _p_project->getIdentificationDataSourceStore().getIdentificationDataSourceList();
for (IdentificationDataSourceSp idrun_sp: idrun_list) {
writeIdentificationDataSource(idrun_sp.get());
}
}
void SampleSheet::writeHeaders() {
// MS sample name X!tandem xml result file name X!Tandem version
//X!tandem xml model file name total spectra used total spectra assigned assigned/used percent
//total unique assigned database file names MS/MS data source file name MS/MS data source file path
//MS level 1 MS level 2 TIC mean in MS 1 TIC mean in MS 2 rt min rt max
_p_writer->writeLine();
_p_writer->writeCell("sample ID");
_p_writer->writeCell("sample");
_p_writer->writeCell("MS run file");
_p_writer->writeCell("Identification engine");
_p_writer->writeCell("Identification engine version");
_p_writer->writeCell("Identification result file");
_p_writer->writeCell("Identification fasta files");
_p_writer->writeCell("X!Tandem parameters");
}
void SampleSheet::writeIdentificationDataSource(IdentificationDataSource * p_ident_data_source) {
_p_writer->writeLine();
_p_writer->writeCell(p_ident_data_source->getMsRunSp().get()->getXmlId());
_p_writer->writeCell(p_ident_data_source->getMsRunSp().get()->getSampleName());
_p_writer->writeCell(p_ident_data_source->getMsRunSp().get()->getFilename());
_p_writer->writeCell(p_ident_data_source->getIdentificationEngineName());
_p_writer->writeCell(p_ident_data_source->getIdentificationEngineVersion());
_p_writer->writeCell(p_ident_data_source->getResourceName());
QStringList fasta_files;
for (FastaFileSp fasta_file:p_ident_data_source->getFastaFileList()) {
fasta_files << fasta_file.get()->getAbsoluteFilePath();
}
_p_writer->writeCell(fasta_files.join(" "));
_p_writer->writeCell(p_ident_data_source->getIdentificationEngineParam(IdentificationEngineParam::tandem_param).toString());
}
......@@ -39,6 +39,9 @@ class SampleSheet
public :
SampleSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project);
private:
void writeHeaders();
void writeIdentificationDataSource(IdentificationDataSource * p_ident_data_source);
private :
OdsExport * _p_ods_export;
const Project * _p_project;
......
......@@ -63,3 +63,12 @@ qDebug() << " " << _map_identification_data_sources.size();
}
throw pappso::PappsoException(QObject::tr("Identification resource %1 not recognized").arg(location));
}
std::vector<IdentificationDataSourceSp> IdentificationDataSourceStore::getIdentificationDataSourceList() const {
std::vector<IdentificationDataSourceSp> idsource_list;
for (auto & msrun_pair :_map_identification_data_sources) {
idsource_list.push_back(msrun_pair.second);
}
return idsource_list;
}
......@@ -42,6 +42,8 @@ public:
IdentificationDataSourceStore();
~IdentificationDataSourceStore();
IdentificationDataSourceSp getInstance(const QString & location);
std::vector<IdentificationDataSourceSp> getIdentificationDataSourceList() const;
private :
std::map<QString, IdentificationDataSourceSp> _map_identification_data_sources;
};
......
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