Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
i2MassChroQ
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
A compter du 1er avril, attention à vos pipelines :
Nouvelles limitations de Docker Hub
Show more breadcrumbs
PAPPSO
i2MassChroQ
Commits
b8ed528b
Commit
b8ed528b
authored
7 years ago
by
Olivier Langella
Browse files
Options
Downloads
Patches
Plain Diff
WIP : writing MassChroqML
parent
73cf8585
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/core/peptidextp.cpp
+6
-2
6 additions, 2 deletions
src/core/peptidextp.cpp
src/core/peptidextp.h
+3
-0
3 additions, 0 deletions
src/core/peptidextp.h
src/output/masschroqml.cpp
+55
-19
55 additions, 19 deletions
src/output/masschroqml.cpp
src/output/masschroqml.h
+0
-1
0 additions, 1 deletion
src/output/masschroqml.h
with
64 additions
and
22 deletions
src/core/peptidextp.cpp
+
6
−
2
View file @
b8ed528b
...
...
@@ -67,8 +67,12 @@ PeptideXtpSp PeptideXtp::makePeptideXtpSp() const {
pappso
::
mz
PeptideXtp
::
getGroupingMass
()
const
{
return
getNativePeptideP
()
->
getMass
();
}
const
pappso
::
Peptide
*
PeptideXtp
::
getNativePeptideP
()
const
{
if
(
_sp_native_peptide
.
get
()
==
nullptr
)
{
return
getMass
()
;
return
this
;
}
return
_sp_native_peptide
.
get
()
->
getMass
()
;
return
_sp_native_peptide
.
get
();
}
This diff is collapsed.
Click to expand it.
src/core/peptidextp.h
+
3
−
0
View file @
b8ed528b
...
...
@@ -40,12 +40,15 @@ public:
~
PeptideXtp
();
PeptideXtpSp
makePeptideXtpSp
()
const
;
/** \brief get the tehoretical mass to use for grouping
* This mass might be different than the true peptide mass to recognize that a tagged
* peptide with taget modification is a light, inter or heavy version of the same peptide
*/
pappso
::
mz
getGroupingMass
()
const
;
const
pappso
::
Peptide
*
getNativePeptideP
()
const
;
/** \brief human readable string that contains modifications
* */
const
QString
getModifString
()
const
;
...
...
This diff is collapsed.
Click to expand it.
src/output/masschroqml.cpp
+
55
−
19
View file @
b8ed528b
...
...
@@ -32,6 +32,15 @@
#include
<pappsomspp/utils.h>
#include
<pappsomspp/grouping/grpprotein.h>
struct
McqPeptide
{
QString
id
;
pappso
::
pappso_double
mh
;
QStringList
mods
;
QStringList
prot_ids
;
QString
seq
;
};
MassChroQml
::
MassChroQml
(
const
QString
&
out_filename
)
{
//_p_digestion_pipeline = p_digestion_pipeline;
...
...
@@ -116,29 +125,58 @@ void MassChroQml::write(ProjectSp sp_project) {
void
MassChroQml
::
writePeptideList
()
{
//<peptide_list>
_output_stream
->
writeStartElement
(
"peptide_list"
);
QStringList
empty
;
for
(
const
GroupingGroupSp
&
group
:
_group_list
)
{
std
::
map
<
const
PeptideMatch
*
,
QStringList
>
peptide_sg_map
;
unsigned
int
group_number
=
group
.
get
()
->
getGroupNumber
();
for
(
auto
&&
pair_peptide_match
:
group
.
get
()
->
getPairSgNumberPeptideMatchList
())
{
unsigned
int
sg_number
=
pair_peptide_match
.
first
;
const
PeptideMatch
*
p_peptide_match
=
pair_peptide_match
.
second
;
if
(
!
p_peptide_match
->
isGrouped
())
continue
;
std
::
pair
<
std
::
map
<
const
PeptideMatch
*
,
QStringList
>::
iterator
,
bool
>
ret
=
peptide_sg_map
.
insert
(
std
::
pair
<
const
PeptideMatch
*
,
QStringList
>
(
p_peptide_match
,
empty
));
QString
sg_str
=
QString
(
"%1.%2.a1"
).
arg
(
pappso
::
Utils
::
getLexicalOrderedString
(
group_number
)).
arg
(
pappso
::
Utils
::
getLexicalOrderedString
(
sg_number
));
if
(
!
ret
.
first
->
second
.
contains
(
sg_str
))
{
ret
.
first
->
second
<<
sg_str
;
std
::
vector
<
McqPeptide
>
mcq_peptide_list
;
for
(
ProteinMatch
*
p_protein_match
:
_p_identification_group
->
getProteinMatchList
())
{
if
(
!
p_protein_match
->
isGrouped
())
continue
;
for
(
PeptideMatch
*
peptide_match
:
p_protein_match
->
getPeptideMatchList
())
{
if
(
!
peptide_match
->
isGrouped
())
continue
;
McqPeptide
mcq_peptide
;
mcq_peptide
.
id
=
peptide_match
->
getGrpPeptideSp
().
get
()
->
getGroupingId
();
mcq_peptide
.
mods
<<
peptide_match
->
getPeptideXtpSp
().
get
()
->
getModifString
();
mcq_peptide
.
prot_ids
<<
p_protein_match
->
getGrpProteinSp
().
get
()
->
getGroupingId
();
mcq_peptide
.
seq
=
peptide_match
->
getPeptideXtpSp
().
get
()
->
getSequence
();
mcq_peptide
.
mh
=
peptide_match
->
getPeptideXtpSp
().
get
()
->
getNativePeptideP
()
->
getMz
(
1
);
mcq_peptide_list
.
push_back
(
mcq_peptide
);
}
}
//sort list
std
::
sort
(
mcq_peptide_list
.
begin
(),
mcq_peptide_list
.
end
(),[](
const
McqPeptide
&
first
,
const
McqPeptide
&
second
)
{
return
(
first
.
id
<
second
.
id
)
;
});
std
::
vector
<
McqPeptide
>
cumul_mcq_peptide_list
;
if
(
mcq_peptide_list
.
size
()
>
0
)
{
McqPeptide
cumul
=
mcq_peptide_list
[
0
];
for
(
McqPeptide
&
mcq_peptide
:
mcq_peptide_list
)
{
if
(
cumul
.
id
==
mcq_peptide
.
id
)
{
if
(
!
cumul
.
prot_ids
.
contains
(
mcq_peptide
.
prot_ids
[
0
]))
{
cumul
.
prot_ids
<<
mcq_peptide
.
prot_ids
[
0
];
}
if
(
!
cumul
.
mods
.
contains
(
mcq_peptide
.
mods
[
0
]))
{
cumul
.
mods
<<
mcq_peptide
.
mods
[
0
];
}
}
else
{
cumul_mcq_peptide_list
.
push_back
(
cumul
);
cumul
=
mcq_peptide
;
}
}
cumul_mcq_peptide_list
.
push_back
(
cumul
);
}
for
(
auto
&&
pair_peptide_sgid
:
peptide_
sg_map
)
{
for
(
McqPeptide
mcq_peptide
:
cumul_mcq_
peptide_
list
)
{
//<peptide id="pep0" mh="1463.626" mods="114.08" prot_ids="P1.1"
// seq="TCVADESHAGCEK">
_output_stream
->
writeStartElement
(
"peptide"
);
_output_stream
->
writeAttribute
(
"id"
,
pair_peptide_sgid
.
first
->
getGrpPeptideSp
().
get
()
->
getGroupingId
());
_output_stream
->
writeAttribute
(
"prot_ids"
,
pair_peptide_sgid
.
second
.
join
(
" "
));
_output_stream
->
writeAttribute
(
"id"
,
mcq_peptide
.
id
);
_output_stream
->
writeAttribute
(
"mods"
,
mcq_peptide
.
mods
.
join
(
"|"
));
_output_stream
->
writeAttribute
(
"prot_ids"
,
mcq_peptide
.
prot_ids
.
join
(
" "
));
_output_stream
->
writeAttribute
(
"mh"
,
QString
::
number
(
mcq_peptide
.
mh
,
'f'
,
10
));
_output_stream
->
writeAttribute
(
"seq"
,
mcq_peptide
.
seq
);
/*
<modifications><!-- this tag is optional but gives an exact mass computation -->
<psimod at="2" acc="MOD:00397"></psimod>
...
...
@@ -148,7 +186,6 @@ void MassChroQml::writePeptideList() {
<observed_in data="samp1" scan="798" z="2" />*/
//</peptide>
_output_stream
->
writeEndElement
();
}
}
//</peptide_list>
_output_stream
->
writeEndElement
();
...
...
@@ -187,7 +224,6 @@ void MassChroQml::writeProteinList() {
if
(
!
p_protein_match
->
isGrouped
())
continue
;
//<protein desc="conta|P02769|ALBU_BOVIN SERUM ALBUMIN PRECURSOR."
// id="P1.1" />
_group_list
.
insert
(
p_protein_match
->
getGroupingGroupSp
());
pappso
::
GrpProteinSp
grp_protein
=
p_protein_match
->
getGrpProteinSp
();
if
(
grp_protein
.
get
()
->
getRank
()
==
1
)
{
_output_stream
->
writeStartElement
(
"protein"
);
...
...
This diff is collapsed.
Click to expand it.
src/output/masschroqml.h
+
0
−
1
View file @
b8ed528b
...
...
@@ -53,7 +53,6 @@ private :
QXmlStreamWriter
*
_output_stream
;
ProjectSp
_sp_project
;
IdentificationGroup
*
_p_identification_group
;
std
::
set
<
GroupingGroupSp
>
_group_list
;
};
#endif // MASSCHROQML_H
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment