Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LipidXplorer
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
labShevchenko
LipidXplorer
Commits
71d65a7a
Commit
71d65a7a
authored
5 years ago
by
mirandaa
Browse files
Options
Downloads
Patches
Plain Diff
ref: clarity
parent
674ce9b2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
new_mfql_parser/manually_run_mfql.py
+3
-1
3 additions, 1 deletion
new_mfql_parser/manually_run_mfql.py
new_mfql_parser/nearest.py
+1
-1
1 addition, 1 deletion
new_mfql_parser/nearest.py
new_mfql_parser/spectra_tools.py
+2
-2
2 additions, 2 deletions
new_mfql_parser/spectra_tools.py
with
6 additions
and
4 deletions
new_mfql_parser/manually_run_mfql.py
+
3
−
1
View file @
71d65a7a
from
mfql_Parser
import
parser
from
nearest
import
nearest
from
spectra_tools
import
get_triggerScan
,
specta_df_fromCSV
,
getMS1Negpeaks
from
var2df
import
var2df
...
...
@@ -27,7 +28,8 @@ if __name__ == '__main__':
FA1 IN MS2- AND
FA2 IN MS2-
'''
print
(
'
pr in ms1-
'
)
MS1Neg_ser
=
getMS1Negpeaks
(
df
)
MS1Neg_arr
=
getMS1Negpeaks
(
df
)
nearest_idx
=
nearest
(
var_dfs
[
'
pr
'
].
mz
,
MS1Neg_arr
)
print
(
'
do such that part
'
)
print
(
'
do report part
'
)
This diff is collapsed.
Click to expand it.
new_mfql_parser/nearest.py
+
1
−
1
View file @
71d65a7a
...
...
@@ -6,8 +6,8 @@ def nearest(ser1, ser2):
# from https://stackoverflow.com/questions/2566412/find-nearest-value-in-numpy-array
# TODO try https://stackoverflow.com/questions/9706041/finding-index-of-an-item-closest-to-the-value-in-a-list-thats-not-entirely-sort
res
=
[]
array
=
np
.
asarray
(
ser2
)
for
value
in
ser1
:
array
=
np
.
asarray
(
ser2
)
idx
=
(
np
.
abs
(
array
-
value
)).
argmin
()
res
.
append
(
idx
)
return
res
...
...
This diff is collapsed.
Click to expand it.
new_mfql_parser/spectra_tools.py
+
2
−
2
View file @
71d65a7a
...
...
@@ -59,11 +59,11 @@ def getScansDF_fromPeaksDF(peaks_df):
return
unique_scan_df
def
getMS1Negpeaks
(
peaks_df
):
def
getMS1Negpeaks
(
peaks_df
,
roundto
=
2
):
unique_scan_df
=
getScansDF_fromPeaksDF
(
peaks_df
)
MS1NegScans
=
unique_scan_df
[(
unique_scan_df
[
'
msLevel
'
]
==
1
)
\
&
(
unique_scan_df
[
'
mode
'
]
==
'
neg
'
)]
peaks_df_merge
=
peaks_df
.
merge
(
MS1NegScans
,
on
=
'
scanNum
'
)
peaks_df_merge
=
peaks_df_merge
.
mz
.
round
(
2
)
peaks_df_merge
=
peaks_df_merge
.
mz
.
round
(
roundto
).
unique
(
)
return
peaks_df_merge
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