Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LC-MS-RT-prediction
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package 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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Léo Schneider
LC-MS-RT-prediction
Commits
8bf3898b
Commit
8bf3898b
authored
4 months ago
by
Schneider Leo
Browse files
Options
Downloads
Patches
Plain Diff
datasets
parent
939cddd6
Branches
RelectureBK2
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
local_integration_msms.py
+17
-4
17 additions, 4 deletions
local_integration_msms.py
with
17 additions
and
4 deletions
local_integration_msms.py
+
17
−
4
View file @
8bf3898b
...
...
@@ -3,6 +3,7 @@ import numpy as np
import
matplotlib.pyplot
as
plt
import
pandas
as
pd
import
scipy.signal
from
PIL.ImageOps
import
cover
def
compute_chromatograms
(
rt
,
mz
,
intensity
,
start_c
,
end_c
):
...
...
@@ -99,6 +100,10 @@ def integrated_mz_int(mz_list,int_list,mz_bin, mz_ref):
res
[
int
((
mz_list
[
i
]
-
min_mz
)
//
mz_bin
)]
+=
int_list
[
i
]
return
res
def
intensity_coverage
(
int_expe
,
int_theo
):
coverage
=
np
.
sum
(
np
.
where
(
int_theo
>
0
,
int_expe
,
0
))
/
np
.
sum
(
int_expe
)
return
coverage
if
__name__
==
"
__main__
"
:
e
=
oms
.
MSExperiment
()
oms
.
MzMLFile
().
load
(
"
data/echantillons données DIA/CITAMA-5-AER-d200.mzML
"
,
e
)
...
...
@@ -158,10 +163,12 @@ if __name__ == "__main__":
plt
.
savefig
(
'
fig/local_inte_res/spec_large_theo_1.png
'
)
plt
.
clf
()
int_theo_inte_peak
=
integrated_mz_int
(
masses_1
,
intensities_1
,
0.25
,
mz1
)
int_theo_inte_large
=
integrated_mz_int
(
masses_1
,
intensities_1
,
0.25
,
mz1_large
)
res_peak_1
=
scipy
.
stats
.
pearsonr
(
int_theo_inte_peak
,
inty1
)
res_large_1
=
scipy
.
stats
.
pearsonr
(
int_theo_inte_large
,
inty1_large
)
int_theo_inte_peak_1
=
integrated_mz_int
(
masses_1
,
intensities_1
,
0.25
,
mz1
)
int_theo_inte_large_1
=
integrated_mz_int
(
masses_1
,
intensities_1
,
0.25
,
mz1_large
)
res_peak_1
=
scipy
.
stats
.
pearsonr
(
int_theo_inte_peak_1
,
inty1
)
coverage_peak_1
=
intensity_coverage
(
inty1
,
int_theo_inte_peak_1
)
res_large_1
=
scipy
.
stats
.
pearsonr
(
int_theo_inte_large_1
,
inty1_large
)
coverage_large_1
=
intensity_coverage
(
inty1_large
,
int_theo_inte_large_1
)
df_large_2
=
df
[
df
[
'
MSlevel
'
]
==
2
]
df_large_2
=
df_large_2
[
619
<
df_large_2
[
'
MS1_mz_max
'
]]
...
...
@@ -201,5 +208,11 @@ if __name__ == "__main__":
plt
.
savefig
(
'
fig/local_inte_res/spec_large_theo_2.png
'
)
plt
.
clf
()
int_theo_inte_peak_2
=
integrated_mz_int
(
masses_2
,
intensities_2
,
0.25
,
mz2
)
int_theo_inte_large_2
=
integrated_mz_int
(
masses_2
,
intensities_2
,
0.25
,
mz2_large
)
res_peak_2
=
scipy
.
stats
.
pearsonr
(
int_theo_inte_peak_2
,
inty2
)
coverage_peak_2
=
intensity_coverage
(
inty2
,
int_theo_inte_peak_2
)
res_large_2
=
scipy
.
stats
.
pearsonr
(
int_theo_inte_large_2
,
inty2_large
)
coverage_large_2
=
intensity_coverage
(
inty2_large
,
int_theo_inte_large_2
)
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