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

trying to update valid protein status

parent 4af832a3
No related branches found
No related tags found
No related merge requests found
......@@ -48,7 +48,9 @@ PeptideStore & Project::getPeptideStore() {
ProteinStore & Project::getProteinStore() {
return _protein_store;
}
const AutomaticFilterParameters & Project::getAutomaticFilterParameters() const {
return _automatic_filter_parameters;
}
void Project::updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters) {
_automatic_filter_parameters = automatic_filter_parameters;
for (auto & p_id_group : _identification_goup_list) {
......
......@@ -52,6 +52,7 @@ public:
/** @brief validate or invalidate peptides and proteins based automatic filters and manual checks
* */
void updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters);
const AutomaticFilterParameters & getAutomaticFilterParameters() const;
void startGrouping();
const GroupingType getGroupingType() const;
......
......@@ -42,7 +42,7 @@ ProteinMatch::~ProteinMatch()
}
void ProteinMatch::updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters) {
qDebug() <<"ProteinMatch::updateAutomaticFilters begin " ;
qDebug() <<"ProteinMatch::updateAutomaticFilters begin " ;
_proxy_valid = false;
unsigned int number_of_valid_peptides =0;
bool cross_sample = automatic_filter_parameters.getFilterCrossSamplePeptideNumber();
......@@ -69,12 +69,14 @@ void ProteinMatch::updateAutomaticFilters(const AutomaticFilterParameters & auto
}
}
if (number_of_valid_peptides > 0) {
if (number_of_valid_peptides < automatic_filter_parameters.getFilterMinimumPeptidePerMatch()) {
}
else {
if (_evalue <= automatic_filter_parameters.getFilterProteinEvalue()) {
_proxy_valid = true;
if (number_of_valid_peptides < automatic_filter_parameters.getFilterMinimumPeptidePerMatch()) {
}
else {
if (getEvalue() <= automatic_filter_parameters.getFilterProteinEvalue()) {
_proxy_valid = true;
}
}
}
qDebug() <<"ProteinMatch::updateAutomaticFilters end " << number_of_valid_peptides ;
......@@ -270,7 +272,7 @@ pappso::pappso_double ProteinMatch::getPAI(const pappso::MsRunIdSp & sp_msrun_id
const QString ProteinMatch::getHtmlSequence() const
{
size_t prot_size = _protein_sp.get()->size();
size_t prot_size = _protein_sp.get()->size();
//qDebug() << "ProteinMatch::getCoverage begin prot_size=" << prot_size << " " << _protein_sp.get()-//>getSequence();
if (prot_size == 0) return 0;
bool cover_bool[prot_size] = {false};
......@@ -287,21 +289,21 @@ const QString ProteinMatch::getHtmlSequence() const
}
QString sequence = getProteinXtpSp().get()->getSequence();
QString sequence_html;
for (unsigned int i=0; i < prot_size; i++) {
if(cover_bool[i]) {
sequence_html.append(QString("<span style=\"background-color:yellow;\">%1").arg(sequence[i]));
i++;
for (;i < prot_size; i++) {
if(cover_bool[i]) {
sequence_html.append(sequence[i]);
}
else {
sequence_html.append(QString("</span>%1").arg(sequence[i]));
break;
}
for (unsigned int i=0; i < prot_size; i++) {
if(cover_bool[i]) {
sequence_html.append(QString("<span style=\"background-color:yellow;\">%1").arg(sequence[i]));
i++;
for (; i < prot_size; i++) {
if(cover_bool[i]) {
sequence_html.append(sequence[i]);
}
sequence_html.append(QString("</span>"));
else {
sequence_html.append(QString("</span>%1").arg(sequence[i]));
break;
}
}
sequence_html.append(QString("</span>"));
}
else {
sequence_html.append(sequence[i]);
......
......@@ -98,12 +98,12 @@ public:
const pappso::GrpProteinSp & getGrpProteinSp() const;
const GroupingGroupSp & getGroupingGroupSp() const;
protected :
/** @brief validate or invalidate peptides and proteins based automatic filters and manual checks
* */
void updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters);
protected :
void setGroupingExperiment(GroupingExperiment * p_grp_experiment);
void setGroupInstance(GroupStore & group_store);
......
......@@ -99,6 +99,8 @@ void PeptideListWindow::setProteinMatch(IdentificationGroup * p_identification_g
void PeptideListWindow::edited() {
qDebug() << "PeptideListWindow::edited begin";
//emit dataChanged(index, index);
_p_protein_match->updateAutomaticFilters(_project_window->getProjectP()->getAutomaticFilterParameters());
_project_window->doIdentificationGroupEdited(_p_identification_group);
//updateStatusBar();
......
......@@ -65,6 +65,7 @@ bool PeptideTableProxyModel::filterAcceptsRow(int source_row,
}
}
return true;
}
catch (pappso::PappsoException exception_pappso) {
......
......@@ -65,6 +65,10 @@ ProjectWindow::~ProjectWindow()
delete ui;
}
Project * ProjectWindow::getProjectP() {
return _project_sp.get();
}
void ProjectWindow::setDefaultProteinListWindow(ProteinListWindow* p_protein_list_window) {
qDebug() << "ProjectWindow::setDefaultProteinListWindow begin";
_p_current_protein_list_window = p_protein_list_window;
......
......@@ -45,6 +45,7 @@ class ProjectWindow: public QMainWindow {
public:
explicit ProjectWindow(MainWindow * parent = 0);
Project * getProjectP();
void setProjectSp(ProjectSp project_sp);
~ProjectWindow();
......
......@@ -18,29 +18,53 @@
<item row="1" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="descriptionLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>167</height>
</size>
</property>
<property name="text">
<string>TextLabel</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="descriptionLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>167</height>
</size>
</property>
<property name="text">
<string>TextLabel</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="validCheckBox">
<property name="text">
<string>valid</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTextEdit" name="sequenceTextEdit">
......
......@@ -63,6 +63,7 @@ void ProteinWindow::doIdentificationGroupGrouped(IdentificationGroup * p_identif
void ProteinWindow::updateDisplay() {
try {
if (_p_protein_match->isValid()) ui->validCheckBox->setCheckState(Qt::Checked);
ui->descriptionLabel->setText(_p_protein_match->getProteinXtpSp().get()->getAccession());
//ui->sequenceLabel->setText(_p_protein_match->getProteinXtpSp().get()->getSequence());
ui->sequenceTextEdit->setText(_p_protein_match->getHtmlSequence());
......
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