Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xtpcpp
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
Container Registry
Model registry
Operate
Environments
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
xtpcpp
Commits
dd0842a8
Commit
dd0842a8
authored
7 years ago
by
Olivier Langella
Browse files
Options
Downloads
Patches
Plain Diff
WIP : writing MassChroqML
parent
b8ed528b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/output/masschroqml.cpp
+90
-10
90 additions, 10 deletions
src/output/masschroqml.cpp
src/output/masschroqml.h
+1
-0
1 addition, 0 deletions
src/output/masschroqml.h
with
91 additions
and
10 deletions
src/output/masschroqml.cpp
+
90
−
10
View file @
dd0842a8
...
...
@@ -31,14 +31,23 @@
#include
<pappsomspp/pappsoexception.h>
#include
<pappsomspp/utils.h>
#include
<pappsomspp/grouping/grpprotein.h>
#include
<pappsomspp/amino_acid/Aa.h>
struct
McqPeptide
{
QString
id
;
pappso
::
pappso_double
mh
;
QStringList
mods
;
QStringList
prot_ids
;
QString
seq
;
const
pappso
::
Peptide
*
native_peptide
;
std
::
vector
<
QString
>
data
;
std
::
vector
<
unsigned
int
>
scan
;
std
::
vector
<
unsigned
int
>
charge
;
};
struct
McqPsimod
{
unsigned
int
at
;
QString
accession
;
};
MassChroQml
::
MassChroQml
(
const
QString
&
out_filename
)
...
...
@@ -121,7 +130,26 @@ void MassChroQml::write(ProjectSp sp_project) {
writeGroups
();
writeProteinList
();
writePeptideList
();
writeIsotopeLabelList
();
}
void
MassChroQml
::
writeIsotopeLabelList
()
{
//<isotope_label_list>
_output_stream
->
writeStartElement
(
"isotope_label_list"
);
/*
<isotope_label id="iso1">
<mod at="Nter" value="28.0" acc="MOD:00429"/>
<mod at="K" value="28.0" acc="MOD:00429"/>
</isotope_label>
<isotope_label id="iso2">
<mod at="Nter" value="32.0" />
<mod at="K" value="32.0" />
</isotope_label>*/
//</isotope_label_list>
_output_stream
->
writeEndElement
();
}
void
MassChroQml
::
writePeptideList
()
{
//<peptide_list>
_output_stream
->
writeStartElement
(
"peptide_list"
);
...
...
@@ -136,7 +164,10 @@ void MassChroQml::writePeptideList() {
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
.
native_peptide
=
peptide_match
->
getPeptideXtpSp
().
get
()
->
getNativePeptideP
();
mcq_peptide
.
data
.
push_back
(
peptide_match
->
getMsRunP
()
->
getXmlId
());
mcq_peptide
.
scan
.
push_back
(
peptide_match
->
getScan
());
mcq_peptide
.
charge
.
push_back
(
peptide_match
->
getCharge
());
mcq_peptide_list
.
push_back
(
mcq_peptide
);
}
...
...
@@ -152,6 +183,23 @@ void MassChroQml::writePeptideList() {
McqPeptide
cumul
=
mcq_peptide_list
[
0
];
for
(
McqPeptide
&
mcq_peptide
:
mcq_peptide_list
)
{
if
(
cumul
.
id
==
mcq_peptide
.
id
)
{
unsigned
int
charge
=
mcq_peptide
.
charge
[
0
];
QString
data
=
mcq_peptide
.
data
[
0
];
unsigned
int
scan
=
mcq_peptide
.
scan
[
0
];
bool
not_found
=
true
;
for
(
unsigned
int
i
=
0
;
i
<
cumul
.
scan
.
size
();
i
++
)
{
if
((
cumul
.
charge
[
i
]
==
charge
)
&&
(
cumul
.
data
[
i
]
==
data
)
&&
(
cumul
.
scan
[
i
]
==
scan
))
{
not_found
=
false
;
break
;
}
}
if
(
not_found
)
{
cumul
.
charge
.
push_back
(
mcq_peptide
.
charge
[
0
]);
cumul
.
data
.
push_back
(
mcq_peptide
.
data
[
0
]);
cumul
.
scan
.
push_back
(
mcq_peptide
.
scan
[
0
]);
}
if
(
!
cumul
.
prot_ids
.
contains
(
mcq_peptide
.
prot_ids
[
0
]))
{
cumul
.
prot_ids
<<
mcq_peptide
.
prot_ids
[
0
];
}
...
...
@@ -175,15 +223,47 @@ void MassChroQml::writePeptideList() {
_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
(
"mh"
,
QString
::
number
(
mcq_peptide
.
native_peptide
->
getMz
(
1
)
,
'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>
<psimod at="11" acc="MOD:00397"></psimod>
</modifications>
<observed_in data="samp0" scan="655" z="2" />
<observed_in data="samp1" scan="798" z="2" />*/
//<modifications><!-- this tag is optional but gives an exact mass computation -->
std
::
vector
<
McqPsimod
>
mod_list
;
unsigned
int
pos
=
1
;
for
(
const
pappso
::
Aa
&
aa
:
*
(
mcq_peptide
.
native_peptide
))
{
const
std
::
list
<
pappso
::
AaModificationP
>
aa_mod_list
=
aa
.
getModificationList
();
for
(
pappso
::
AaModificationP
mod
:
aa_mod_list
)
{
if
(
!
mod
->
isInternal
())
{
McqPsimod
psimod
;
psimod
.
accession
=
mod
->
getAccession
();
psimod
.
at
=
pos
;
mod_list
.
push_back
(
psimod
);
}
}
pos
++
;
}
if
(
mod_list
.
size
()
>
0
)
{
_output_stream
->
writeStartElement
(
"modifications"
);
for
(
McqPsimod
&
psimod
:
mod_list
)
{
//<psimod at="2" acc="MOD:00397"></psimod>
_output_stream
->
writeStartElement
(
"psimod"
);
_output_stream
->
writeAttribute
(
"at"
,
QString
(
"%1"
).
arg
(
psimod
.
at
));
_output_stream
->
writeAttribute
(
"acc"
,
psimod
.
accession
);
//<psimod at="11" acc="MOD:00397"></psimod>
_output_stream
->
writeEndElement
();
}
//</modifications>
_output_stream
->
writeEndElement
();
}
//<observed_in data="samp0" scan="655" z="2" />
for
(
unsigned
int
i
=
0
;
i
<
mcq_peptide
.
scan
.
size
();
i
++
)
{
_output_stream
->
writeStartElement
(
"observed_in"
);
_output_stream
->
writeAttribute
(
"data"
,
mcq_peptide
.
data
[
i
]);
_output_stream
->
writeAttribute
(
"scan"
,
QString
(
"%1"
).
arg
(
mcq_peptide
.
scan
[
i
]));
_output_stream
->
writeAttribute
(
"z"
,
QString
(
"%1"
).
arg
(
mcq_peptide
.
charge
[
i
]));
_output_stream
->
writeEndElement
();
}
//<observed_in data="samp1" scan="798" z="2" />*/
//</peptide>
_output_stream
->
writeEndElement
();
}
...
...
This diff is collapsed.
Click to expand it.
src/output/masschroqml.h
+
1
−
0
View file @
dd0842a8
...
...
@@ -48,6 +48,7 @@ private:
void
writeGroups
();
void
writeProteinList
();
void
writePeptideList
();
void
writeIsotopeLabelList
();
private
:
QFile
*
_output_file
;
QXmlStreamWriter
*
_output_stream
;
...
...
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