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

direct output for tsv spectral count

parent 96cb5f1c
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,7 @@
<addaction name="actionMassChroQ"/>
<addaction name="actionSpreadsheet"/>
<addaction name="actionProticDb"/>
<addaction name="action_spectral_counting_mcq"/>
</widget>
<addaction name="actionLoad_results"/>
<addaction name="actionLoad"/>
......@@ -108,6 +109,11 @@
<string>PROTICdb</string>
</property>
</action>
<action name="action_spectral_counting_mcq">
<property name="text">
<string>Spectral Counting mcq</string>
</property>
</action>
</widget>
<resources>
<include location="../xtpcpp.qrc"/>
......@@ -257,6 +263,22 @@
</hint>
</hints>
</connection>
<connection>
<sender>action_spectral_counting_mcq</sender>
<signal>triggered()</signal>
<receiver>Main</receiver>
<slot>doActionSpectralCountingMcq()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>231</x>
<y>191</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>selectXpipFile()</slot>
......@@ -268,5 +290,6 @@
<slot>doActionModifications()</slot>
<slot>doActionLabelingMethods()</slot>
<slot>doActionFasta()</slot>
<slot>doActionSpectralCountingMcq()</slot>
</slots>
</ui>
......@@ -31,9 +31,21 @@
#include "ui_main.h"
#include <pappsomspp/pappsoexception.h>
#include <pappsomspp/fasta/fastaoutputstream.h>
#include <odsstream/tsvoutputstream.h>
#include "../utils/utils.h"
#include "workerthread.h"
#include "output/ods/comparspectrasheet.h"
class TsvNoSheetOutput: public TsvOutputStream {
public :
TsvNoSheetOutput(QTextStream & otxtstream):TsvOutputStream(otxtstream) {
}
~TsvNoSheetOutput() {
}
virtual void writeSheet(const QString & sheetName) override {
}
};
MainWindow::MainWindow(QWidget *parent):
QMainWindow(parent),
......@@ -60,11 +72,11 @@ MainWindow::MainWindow(QWidget *parent):
//QDockWidget *dock = new QDockWidget(tr("Protein List"), this);
//dock->setWidget(_protein_list_window);
//addDockWidget(Qt::RightDockWidgetArea, dock);
qRegisterMetaType<ProjectSp>("ProjectSp");
qRegisterMetaType<AutomaticFilterParameters>("AutomaticFilterParameters");
qRegisterMetaType<GroupingType>("GroupingType");
#if QT_VERSION >= 0x050000
// Qt5 code
/*
......@@ -263,6 +275,40 @@ void MainWindow::doActionSpreadsheet() {
qDebug() << "MainWindow::doActionSpreadsheet end";
}
void MainWindow::doActionSpectralCountingMcq()
{
qDebug() << "MainWindow::doActionSpectralCountingMcq begin";
QSettings settings;
QString default_location = settings.value("path/scmcqfile", "").toString();
QString filename = QFileDialog::getSaveFileName(this, tr("Save spectral count TSV text file"),
QString("%1/untitled.tsv").arg(default_location),
tr("TSV (*.tsv)"));
if (filename.isEmpty()) {
return;
}
settings.setValue("path/scmcqfile", QFileInfo(filename).absolutePath());
QFile outFile;
outFile.setFileName(filename);
outFile.open(QIODevice::WriteOnly);
QTextStream * p_outputStream = new QTextStream(&outFile);
TsvNoSheetOutput* p_writer = new TsvNoSheetOutput(*p_outputStream);
ComparSpectraSheet spectra_sheet(nullptr, p_writer, _project_sp.get());
spectra_sheet.writeSheet();
p_writer->close();
delete p_writer;
delete p_outputStream;
outFile.close();
qDebug() << "MainWindow::doActionSpectralCountingMcq end";
}
void MainWindow::doActionFasta() {
try {
......@@ -324,7 +370,7 @@ void MainWindow::doActionMassChroQ() {
}
settings.setValue("path/mcqfile", QFileInfo(filename).absolutePath());
showWaitingMessage(tr("Writing %1 XPIP file").arg(QFileInfo(filename).fileName()));
emit operateWritingMassChroqFile(filename, _project_sp);
//emit operateXpipFile(filename);
......@@ -352,7 +398,7 @@ void MainWindow::doActionProticDb() {
}
settings.setValue("path/proticfile", QFileInfo(filename).absolutePath());
showWaitingMessage(tr("Writing %1 PROTICdbML file").arg(QFileInfo(filename).fileName()));
emit operateWritingProticFile(filename, _project_sp);
//emit operateXpipFile(filename);
......
......@@ -71,6 +71,7 @@ public slots:
void doOperationFailed(QString);
void doOperationFinished();
void doGroupingFinished();
void doActionSpectralCountingMcq();
//void peptideEdited(QString peptideStr);
// void setColor(const QColor &color);
// void setShape(Shape shape);
......
......@@ -70,7 +70,7 @@ void ComparBaseSheet::writeHeaders(IdentificationGroup * p_ident) {
});
_p_writer->writeLine();
//_p_writer->writeLine();
_p_writer->writeCell("Group ID");
_p_writer->writeCell("Subgroup ID");
//_p_writer->setCellAnnotation("MS sample name (MS run)");
......@@ -95,9 +95,13 @@ void ComparBaseSheet::writeProteinMatch(const ProteinMatch * p_protein_match) {
unsigned int subgroup_number = p_protein_match->getGrpProteinSp().get()->getSubGroupNumber();
unsigned int rank_number = p_protein_match->getGrpProteinSp().get()->getRank();
_p_ods_export->setEvenOrOddStyle(group_number, _p_writer);
if (_p_ods_export != nullptr) {
_p_ods_export->setEvenOrOddStyle(group_number, _p_writer);
}
_p_writer->writeCell(pappso::Utils::getLexicalOrderedString(group_number));
if (_p_ods_export != nullptr) {
_p_ods_export->setEvenOrOddStyle(subgroup_number, _p_writer);
}
_p_writer->writeCell(pappso::Utils::getLexicalOrderedString(subgroup_number));
_p_writer->clearTableCellStyleRef();
_p_writer->writeCell(p_protein_match->getGrpProteinSp().get()->getGroupingId());
......
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