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
522b28b4
Commit
522b28b4
authored
6 months ago
by
Schneider Leo
Browse files
Options
Downloads
Patches
Plain Diff
local inetgration update
parent
5d66520d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
local_integration_msms.py
+18
-5
18 additions, 5 deletions
local_integration_msms.py
main_custom.py
+1
-1
1 addition, 1 deletion
main_custom.py
with
19 additions
and
6 deletions
local_integration_msms.py
+
18
−
5
View file @
522b28b4
import
pyopenms
as
oms
import
pyopenms
as
oms
import
numpy
as
np
import
numpy
as
np
import
matplotlib.pyplot
as
plt
def
compute_chromatograms
(
rt
,
charge
,
intensity
,
start_c
,
end_c
):
def
compute_chromatograms
(
rt
,
mz
,
intensity
,
start_c
,
end_c
):
value
=
[]
value
=
[]
for
k
in
range
(
len
(
rt
)):
for
k
in
range
(
len
(
rt
)):
c
=
np
.
array
(
charge
[
k
])
c
=
np
.
array
(
mz
[
k
])
i
=
np
.
array
(
intensity
[
k
])
i
=
np
.
array
(
intensity
[
k
])
value
.
append
(
np
.
sum
(
np
.
where
(
end_c
>
c
>
start_c
,
i
,
0
)))
value
.
append
(
np
.
sum
(
np
.
where
(
(
end_c
>
c
)
&
(
c
>
start_c
)
,
i
,
0
)))
return
value
return
value
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
e
=
oms
.
MSExperiment
()
e
=
oms
.
MSExperiment
()
oms
.
MzMLFile
().
load
(
"
data/S
TAPH
140.mzML
"
,
e
)
oms
.
MzMLFile
().
load
(
"
data/S
taph
140.mzML
"
,
e
)
e
.
updateRanges
()
e
.
updateRanges
()
rt
=
[]
rt
=
[]
charge
=
[]
charge
=
[]
...
@@ -24,4 +25,16 @@ if __name__ == "__main__":
...
@@ -24,4 +25,16 @@ if __name__ == "__main__":
rt
.
append
(
s
.
getRT
())
rt
.
append
(
s
.
getRT
())
charge
.
append
(
s
.
get_peaks
()[
0
])
charge
.
append
(
s
.
get_peaks
()[
0
])
intensity
.
append
(
s
.
get_peaks
()[
1
])
intensity
.
append
(
s
.
get_peaks
()[
1
])
val
=
compute_chromatograms
(
rt
,
charge
,
intensity
,
400.
,
400.5
)
mz_range
=
np
.
linspace
(
350
,
1250
,
4000
)
\ No newline at end of file
for
i
in
range
(
len
(
mz_range
)
-
1
):
print
(
mz_range
[
i
],
'
/1250
'
)
val
=
compute_chromatograms
(
rt
,
charge
,
intensity
,
mz_range
[
i
]
,
mz_range
[
i
+
1
])
fig
,
ax
=
plt
.
subplots
()
ax
.
plot
(
val
)
ax
.
set_xlabel
(
'
Retention time
'
)
ax
.
set_ylabel
(
'
Intensity
'
)
ax
.
set_title
(
'
mz : {} to {}
'
.
format
(
mz_range
[
i
]
,
mz_range
[
i
+
1
]))
plt
.
savefig
(
'
fig/rt_local/{}_to_{}.png
'
.
format
(
mz_range
[
i
]
,
mz_range
[
i
+
1
]))
plt
.
clf
()
df
=
e
.
get_df
()
#358.1 358.32
\ No newline at end of file
This diff is collapsed.
Click to expand it.
main_custom.py
+
1
−
1
View file @
522b28b4
...
@@ -207,7 +207,7 @@ def main(args):
...
@@ -207,7 +207,7 @@ def main(args):
print
(
'
\n
Data loaded
'
)
print
(
'
\n
Data loaded
'
)
model
=
Model_Common_Transformer
_TAPE
(
encoder_ff
=
args
.
encoder_ff
,
decoder_rt_ff
=
args
.
decoder_rt_ff
,
model
=
Model_Common_Transformer
(
encoder_ff
=
args
.
encoder_ff
,
decoder_rt_ff
=
args
.
decoder_rt_ff
,
decoder_int_ff
=
args
.
decoder_int_ff
decoder_int_ff
=
args
.
decoder_int_ff
,
n_head
=
args
.
n_head
,
encoder_num_layer
=
args
.
encoder_num_layer
,
,
n_head
=
args
.
n_head
,
encoder_num_layer
=
args
.
encoder_num_layer
,
decoder_int_num_layer
=
args
.
decoder_int_num_layer
,
decoder_int_num_layer
=
args
.
decoder_int_num_layer
,
...
...
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