Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Maintenance - Mise à jour mensuelle Lundi 6 Février entre 7h00 et 9h00
Open sidebar
PAPPSO
xtpcpp
Commits
e265ea84
Commit
e265ea84
authored
Oct 11, 2019
by
Renne Thomas
Browse files
Add columns and export menu in ms id list
parent
63a0b97a
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/gui/lists/ms_identification_run_list_view/ms_identification_run_view.ui
View file @
e265ea84
...
...
@@ -72,16 +72,31 @@
<height>
24
</height>
</rect>
</property>
<widget
class=
"QMenu"
name=
"menuCompare"
>
<property
name=
"enabled"
>
<bool>
false
</bool>
</property>
<property
name=
"title"
>
<string>
&
Compare
</string>
</property>
<addaction
name=
"actionAlignement"
/>
</widget>
<widget
class=
"QMenu"
name=
"menuExport"
>
<property
name=
"title"
>
<string>
e
&
xport
</string>
</property>
<addaction
name=
"action
A
s_ODS_file"
/>
<addaction
name=
"action
_a
s_ODS_file"
/>
</widget>
<addaction
name=
"menuExport"
/>
<addaction
name=
"menuCompare"
/>
</widget>
<widget
class=
"QStatusBar"
name=
"statusbar"
/>
<action
name=
"actionAs_ODS_file"
>
<action
name=
"actionAlignement"
>
<property
name=
"text"
>
<string>
&
Alignement
</string>
</property>
</action>
<action
name=
"action_as_ODS_file"
>
<property
name=
"text"
>
<string>
&
as ODS file
</string>
</property>
...
...
@@ -90,7 +105,7 @@
<resources/>
<connections>
<connection>
<sender>
action
A
s_ODS_file
</sender>
<sender>
action
_a
s_ODS_file
</sender>
<signal>
triggered()
</signal>
<receiver>
MsIdentificationView
</receiver>
<slot>
doExportAsOdsFile()
</slot>
...
...
src/gui/lists/ms_identification_run_list_view/msidentificationlistwindow.cpp
View file @
e265ea84
...
...
@@ -30,46 +30,6 @@
#include
<odsstream/odsdocwriter.h>
#include
<odsstream/qtablewriter.h>
MsIdentificationListQactionColumn
::
MsIdentificationListQactionColumn
(
MsIdentificationListWindow
*
parent
,
msIdentificationListColumn
column
)
:
QAction
(
parent
)
{
this
->
setText
(
MsIdentificationTableModel
::
getTitle
(
column
));
// this->setCheckable(true);
m_column
=
column
;
m_msid_list_window
=
parent
;
#if QT_VERSION >= 0x050000
// Qt5 code
connect
(
this
,
&
MsIdentificationListQactionColumn
::
toggled
,
this
,
&
MsIdentificationListQactionColumn
::
doToggled
);
#else
// Qt4 code
connect
(
this
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
doToggled
(
bool
)));
#endif
}
MsIdentificationListQactionColumn
::~
MsIdentificationListQactionColumn
()
{
qDebug
()
<<
"MsIdentificationListQactionColumn::~"
"MsIdentificationListQactionColumn begin "
;
}
void
MsIdentificationListQactionColumn
::
doToggled
(
bool
toggled
)
{
qDebug
()
<<
"MsIdentificationListQactionColumn::doToggled begin "
<<
toggled
;
setChecked
(
toggled
);
m_msid_list_window
->
setMsIdentificationListColumnDisplay
(
m_column
,
toggled
);
qDebug
()
<<
"MsIdentificationListQactionColumn::doToggled end"
;
}
MsIdentificationListWindow
::
MsIdentificationListWindow
(
ProjectWindow
*
parent
)
:
QMainWindow
(
parent
),
ui
(
new
Ui
::
MsIdentificationView
)
{
...
...
@@ -89,6 +49,8 @@ MsIdentificationListWindow::MsIdentificationListWindow(ProjectWindow *parent)
ui
->
tableView
->
setSortingEnabled
(
true
);
ui
->
tableView
->
setAlternatingRowColors
(
true
);
m_proxy_model
->
resteItemDelegates
();
connect
(
this
,
&
MsIdentificationListWindow
::
MsIdentificationDataChanged
,
m_msid_table_model_p
,
...
...
@@ -97,6 +59,10 @@ MsIdentificationListWindow::MsIdentificationListWindow(ProjectWindow *parent)
&
MsIdentificationTableModel
::
layoutChanged
,
this
,
&
MsIdentificationListWindow
::
updateStatusBar
);
connect
(
ui
->
tableView
,
&
QTableView
::
clicked
,
m_proxy_model
,
&
MsIdentificationTableProxyModel
::
onTableClicked
);
}
void
...
...
@@ -149,10 +115,32 @@ MsIdentificationListWindow::setIdentificationDataSourceSpList(
qDebug
()
<<
"MsIdentificationListWindow::setIdentificationGroup end"
;
}
void
MsIdentificationListWindow
::
setMsIdentificationListColumnDisplay
(
msIdentificationListColumn
column
,
bool
toggled
)
MsIdentificationListWindow
::
doExportAsOdsFile
()
{
m_proxy_model
->
setMsIdentificationListColumnDisplay
(
column
,
toggled
);
QSettings
settings
;
QString
default_location
=
settings
.
value
(
"path/export_ods"
,
""
).
toString
();
QString
filename
;
filename
=
QFileDialog
::
getSaveFileName
(
this
,
tr
(
"Save ODS file"
),
QString
(
"%1/untitled.ods"
).
arg
(
default_location
),
tr
(
"Open Document Spreadsheet (*.ods)"
));
if
(
!
filename
.
isEmpty
())
{
CalcWriterInterface
*
p_writer
=
new
OdsDocWriter
(
filename
);
const
QAbstractProxyModel
*
p_table_model
=
m_proxy_model
;
QtableWriter
table_writer
(
p_writer
,
p_table_model
);
table_writer
.
setFormatPercentForColumn
(
m_msid_table_model_p
->
index
(
0
,
(
int
)
msIdentificationListColumn
::
percent_assign
));
table_writer
.
writeSheet
(
"Ms Identification list"
);
p_writer
->
close
();
delete
p_writer
;
}
}
src/gui/lists/ms_identification_run_list_view/msidentificationlistwindow.h
View file @
e265ea84
...
...
@@ -39,23 +39,6 @@ namespace Ui
class
MsIdentificationView
;
}
class
MsIdentificationListWindow
;
class
MsIdentificationListQactionColumn
:
public
QAction
{
Q_OBJECT
public:
explicit
MsIdentificationListQactionColumn
(
MsIdentificationListWindow
*
parent
,
msIdentificationListColumn
column
);
~
MsIdentificationListQactionColumn
();
public
slots
:
void
doToggled
(
bool
toggled
);
private:
MsIdentificationListWindow
*
m_msid_list_window
;
msIdentificationListColumn
m_column
;
};
class
MsIdentificationListWindow
:
public
QMainWindow
{
friend
class
MsIdentificationTableModel
;
...
...
@@ -68,10 +51,12 @@ class MsIdentificationListWindow : public QMainWindow
~
MsIdentificationListWindow
();
void
setIdentificationDataSourceSpList
(
std
::
vector
<
IdentificationDataSourceSp
>
&
identificationDataSourceSpList
);
void
setMsIdentificationListColumnDisplay
(
msIdentificationListColumn
column
,
bool
toggled
);
void
resizeColumnsToContents
();
public
slots
:
void
doExportAsOdsFile
();
signals:
void
MsIdentificationDataChanged
();
...
...
src/gui/lists/ms_identification_run_list_view/msidentificationtablemodel.cpp
View file @
e265ea84
...
...
@@ -97,13 +97,30 @@ MsIdentificationTableModel::getTitle(std::int8_t column)
case
(
std
::
int8_t
)
msIdentificationListColumn
::
run_id
:
return
"Identification RunID"
;
break
;
case
(
std
::
int8_t
)
msIdentificationListColumn
::
id_file
:
return
"Identification File"
;
break
;
case
(
std
::
int8_t
)
msIdentificationListColumn
::
mzML
:
return
"Peak-list file"
;
break
;
case
(
std
::
int8_t
)
msIdentificationListColumn
::
engine_name
:
return
"Engine Name"
;
break
;
case
(
std
::
int8_t
)
msIdentificationListColumn
::
nbr_spectrum
:
return
"Number of Spectrum"
;
break
;
case
(
std
::
int8_t
)
msIdentificationListColumn
::
nbr_peptide
:
return
"Number of peptide"
;
break
;
case
(
std
::
int8_t
)
msIdentificationListColumn
::
nbr_unique
:
return
"Number of unique"
;
break
;
case
(
std
::
int8_t
)
msIdentificationListColumn
::
percent_assign
:
return
"% Assignation"
;
break
;
case
(
std
::
int8_t
)
msIdentificationListColumn
::
id_msrun_id
:
return
"MsRunID"
;
break
;
}
return
""
;
}
...
...
@@ -119,13 +136,30 @@ MsIdentificationTableModel::getDescription(std::int8_t column)
case
(
std
::
int8_t
)
msIdentificationListColumn
::
run_id
:
return
"Identification of RunID"
;
break
;
case
(
std
::
int8_t
)
msIdentificationListColumn
::
id_file
:
return
"Identification File pathway"
;
break
;
case
(
std
::
int8_t
)
msIdentificationListColumn
::
mzML
:
return
"peak-list data file pathway"
;
break
;
case
(
std
::
int8_t
)
msIdentificationListColumn
::
engine_name
:
return
"Engine Name"
;
break
;
case
(
std
::
int8_t
)
msIdentificationListColumn
::
nbr_spectrum
:
return
"Number of Spectrum"
;
break
;
case
(
std
::
int8_t
)
msIdentificationListColumn
::
nbr_peptide
:
return
"Number of peptide identified"
;
break
;
case
(
std
::
int8_t
)
msIdentificationListColumn
::
nbr_unique
:
return
"Number of unique peptide"
;
break
;
case
(
std
::
int8_t
)
msIdentificationListColumn
::
percent_assign
:
return
"Percentage of Assignation"
;
break
;
case
(
std
::
int8_t
)
msIdentificationListColumn
::
id_msrun_id
:
return
"Identification of MsRunID"
;
break
;
}
return
""
;
}
...
...
@@ -158,20 +192,28 @@ MsIdentificationTableModel::headerData(int section,
int
MsIdentificationTableModel
::
getColumnWidth
(
int
column
)
{
qDebug
()
<<
"Test "
<<
column
;
switch
(
column
)
{
case
(
int
)
msIdentificationListColumn
::
run_id
:
return
200
;
break
;
case
(
int
)
msIdentificationListColumn
::
id_file
:
return
5
00
;
return
4
00
;
break
;
case
(
int
)
msIdentificationListColumn
::
mzML
:
return
500
;
return
400
;
break
;
case
(
int
)
msIdentificationListColumn
::
nbr_spectrum
:
return
160
;
break
;
case
(
int
)
msIdentificationListColumn
::
nbr_peptide
:
return
160
;
break
;
case
(
int
)
msIdentificationListColumn
::
nbr_unique
:
return
160
;
break
;
}
return
30
0
;
return
12
0
;
}
msIdentificationListColumn
...
...
@@ -200,6 +242,66 @@ MsIdentificationTableModel::data(const QModelIndex &index, int role) const
return
QVariant
(
m_identificationDataSourceSpList
.
at
(
row
)
->
getXmlId
());
}
if
(
col
==
(
std
::
int8_t
)
msIdentificationListColumn
::
id_file
)
{
QFileInfo
fi
(
m_identificationDataSourceSpList
.
at
(
row
)
->
getResourceName
());
return
QVariant
(
fi
.
fileName
());
}
if
(
col
==
(
std
::
int8_t
)
msIdentificationListColumn
::
mzML
)
{
QFileInfo
fi
(
m_identificationDataSourceSpList
.
at
(
row
)
->
getMsRunSp
()
.
get
()
->
getFileName
());
return
QVariant
(
fi
.
fileName
());
}
if
(
col
==
(
std
::
int8_t
)
msIdentificationListColumn
::
engine_name
)
{
return
QVariant
(
m_identificationDataSourceSpList
.
at
(
row
)
->
getIdentificationEngineName
());
}
if
(
col
==
(
std
::
int8_t
)
msIdentificationListColumn
::
id_msrun_id
)
{
return
QVariant
(
m_identificationDataSourceSpList
.
at
(
row
)
->
getMsRunSp
()
->
getXmlId
());
}
if
(
col
==
(
std
::
int8_t
)
msIdentificationListColumn
::
nbr_peptide
)
{
return
QVariant
(
m_identificationDataSourceSpList
.
at
(
row
)
->
getIdentificationEngineStatistics
(
IdentificationEngineStatistics
::
total_spectra_assigned
));
}
if
(
col
==
(
std
::
int8_t
)
msIdentificationListColumn
::
nbr_unique
)
{
return
QVariant
(
m_identificationDataSourceSpList
.
at
(
row
)
->
getIdentificationEngineStatistics
(
IdentificationEngineStatistics
::
total_unique_assigned
));
}
if
(
col
==
(
std
::
int8_t
)
msIdentificationListColumn
::
nbr_spectrum
)
{
return
QVariant
(
m_identificationDataSourceSpList
.
at
(
row
)
->
getIdentificationEngineStatistics
(
IdentificationEngineStatistics
::
total_spectra_used
));
}
if
(
col
==
(
std
::
int8_t
)
msIdentificationListColumn
::
percent_assign
)
{
return
QVariant
(
m_identificationDataSourceSpList
.
at
(
row
)
->
getIdentificationEngineStatistics
(
IdentificationEngineStatistics
::
total_spectra_assigned
)
.
toDouble
()
/
m_identificationDataSourceSpList
.
at
(
row
)
->
getIdentificationEngineStatistics
(
IdentificationEngineStatistics
::
total_spectra_used
)
.
toDouble
());
}
case
Qt
::
ToolTipRole
:
if
(
col
==
(
std
::
int8_t
)
msIdentificationListColumn
::
id_file
)
{
return
QVariant
(
...
...
src/gui/lists/ms_identification_run_list_view/msidentificationtablemodel.h
View file @
e265ea84
...
...
@@ -35,10 +35,16 @@
enum
class
msIdentificationListColumn
:
std
::
int8_t
{
run_id
=
0
,
///< msRun ID
id_file
=
1
,
///< file ID
mzML
=
2
,
///< accession
last
=
3
,
///< get list size
run_id
=
0
,
///< msRun ID
id_file
=
1
,
///< file ID
mzML
=
2
,
///< accession
engine_name
=
3
,
///< engine name
nbr_spectrum
=
4
,
///< number of spectrum
nbr_peptide
=
5
,
///< number of peptide identified
nbr_unique
=
6
,
///< number of unique spectra
percent_assign
=
7
,
///< percent of assignation
id_msrun_id
=
8
,
///< identification of MsRunId
last
=
9
,
///< get list size
};
class
MsIdentificationListWindow
;
...
...
src/gui/lists/ms_identification_run_list_view/msidentificationtableproxymodel.cpp
View file @
e265ea84
...
...
@@ -184,18 +184,42 @@ MsIdentificationTableProxyModel::headerData(int section,
return
sourceModel
()
->
headerData
(
col
,
orientation
,
role
);
}
void
MsIdentificationTableProxyModel
::
onTableClicked
(
const
QModelIndex
&
index
)
{
qDebug
()
<<
"MsIdentificationTableProxyModel::onTableClicked begin "
<<
index
.
row
();
qDebug
()
<<
"MsIdentificationTableProxyModel::onTableClicked begin "
<<
this
->
mapToSource
(
index
).
row
();
QModelIndex
source_index
(
this
->
mapToSource
(
index
));
int
row
=
source_index
.
row
();
msIdentificationListColumn
col
=
(
msIdentificationListColumn
)
source_index
.
column
();
if
(
col
==
msIdentificationListColumn
::
engine_name
)
{
// m_msid_list_window->askProteinDetailView();
}
qDebug
()
<<
"MsIdentificationTableProxyModel::onTableClicked end "
<<
index
.
row
();
}
void
MsIdentificationTableProxyModel
::
setMsIdentificationListColumnDisplay
(
msIdentificationListColumn
column
,
bool
toggled
)
MsIdentificationTableProxyModel
::
resteItemDelegates
()
const
{
qDebug
()
<<
toggled
;
beginResetModel
();
QSettings
settings
;
settings
.
setValue
(
QString
(
"protein_list_columns/%1"
)
.
arg
(
m_msid_table_model_p
->
getTitle
(
column
)),
toggled
);
m_column_display
[(
std
::
int8_t
)
column
]
=
toggled
;
endResetModel
();
for
(
int
i
=
0
;
i
<
columnCount
();
++
i
)
{
qDebug
()
<<
i
;
qDebug
()
<<
(
std
::
int8_t
)
msIdentificationListColumn
::
percent_assign
;
qDebug
()
<<
mapToSource
(
index
(
0
,
i
)).
column
();
// m_msid_list_window->ui->tableView->setItemDelegateForColumn(
// i, m_msid_list_window->ui->tableView->itemDelegate());
if
(
i
==
(
std
::
int8_t
)
msIdentificationListColumn
::
percent_assign
)
{
qDebug
()
<<
"AAAAAAAAAAAAAAAAAAAAA"
;
m_msid_list_window
->
ui
->
tableView
->
setItemDelegateForColumn
(
i
,
m_percent_delegate
);
}
}
}
src/gui/lists/ms_identification_run_list_view/msidentificationtableproxymodel.h
View file @
e265ea84
...
...
@@ -54,9 +54,11 @@ class MsIdentificationTableProxyModel : public QSortFilterProxyModel
const
QModelIndex
&
right
)
const
override
;
void
setSearchOn
(
QString
search_on
);
void
setMsIdentificationSearchString
(
QString
ms_id_search_string
);
void
setMsIdentificationListColumnDisplay
(
msIdentificationListColumn
column
,
bool
toggled
);
void
resteItemDelegates
()
const
;
public
slots
:
void
onTableClicked
(
const
QModelIndex
&
index
);
private:
std
::
vector
<
IdentificationDataSourceSp
>
m_identificationDataSourceSpList
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment