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
58509e21
Commit
58509e21
authored
3 months ago
by
Schneider Leo
Browse files
Options
Downloads
Patches
Plain Diff
datasets
parent
2cb6249b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mzml_exploration.py
+30
-2
30 additions, 2 deletions
mzml_exploration.py
with
30 additions
and
2 deletions
mzml_exploration.py
+
30
−
2
View file @
58509e21
...
...
@@ -4,6 +4,7 @@ import numpy as np
import
matplotlib.pyplot
as
plt
import
matplotlib.colors
as
colors
from
PIL
import
Image
import
re
def
plot_spectra_2d
(
exp
,
ms_level
=
1
,
marker_size
=
5
):
exp
.
updateRanges
()
...
...
@@ -282,7 +283,34 @@ def check_energy(im):
def
create_antibio_dataset
(
path
=
'
data/230804_strain_peptides_antibiogram_Enterobacterales.xlsx
'
):
df
=
pd
.
read_excel
(
path
,
header
=
1
)
#sample_name : lien avec le fichier brut
df
=
df
[[
'
sample_name
'
,
'
species
'
,
'
AMC (disk)
'
,
'
AMK (disk)
'
,
'
AMK (mic)
'
,
'
AMK (vitek)
'
,
'
AMP (vitek)
'
,
'
AMX (disk)
'
,
'
AMX (vitek)
'
,
'
ATM (disk)
'
,
'
ATM (vitek)
'
,
'
CAZ (disk)
'
,
'
CAZ (mic)
'
,
'
CAZ (vitek)
'
,
'
CHL (vitek)
'
,
'
CIP (disk)
'
,
'
CIP (vitek)
'
,
'
COL (disk)
'
,
'
COL (mic)
'
,
'
CRO (mic)
'
,
'
CRO (vitek)
'
,
'
CTX (disk)
'
,
'
CTX (mic)
'
,
'
CTX (vitek)
'
,
'
CXM (vitek)
'
,
'
CZA (disk)
'
,
'
CZA (vitek)
'
,
'
CZT (disk)
'
,
'
CZT (vitek)
'
,
'
ETP (disk)
'
,
'
ETP (mic)
'
,
'
ETP (vitek)
'
,
'
FEP (disk)
'
,
'
FEP (mic)
'
,
'
FEP (vitek)
'
,
'
FOS (disk)
'
,
'
FOX (disk)
'
,
'
FOX (vitek)
'
,
'
GEN (disk)
'
,
'
GEN (mic)
'
,
'
GEN (vitek)
'
,
'
IPM (disk)
'
,
'
IPM (mic)
'
,
'
IPM (vitek)
'
,
'
LTM (disk)
'
,
'
LVX (disk)
'
,
'
LVX (vitek)
'
,
'
MEC (disk)
'
,
'
MEM (disk)
'
,
'
MEM (mic)
'
,
'
MEM (vitek)
'
,
'
NAL (vitek)
'
,
'
NET (disk)
'
,
'
OFX (vitek)
'
,
'
PIP (vitek)
'
,
'
PRL (disk)
'
,
'
SXT (disk)
'
,
'
SXT (vitek)
'
,
'
TCC (disk)
'
,
'
TCC (vitek)
'
,
'
TEM (disk)
'
,
'
TEM (vitek)
'
,
'
TGC (disk)
'
,
'
TGC (vitek)
'
,
'
TIC (disk)
'
,
'
TIC (vitek)
'
,
'
TOB (disk)
'
,
'
TOB (vitek)
'
,
'
TZP (disk)
'
,
'
TZP (mic)
'
,
'
TZP (vitek)
'
]]
def
split_before_number
(
s
):
return
re
.
split
(
r
'
(\d+)
'
,
s
)
def
create_fname
(
s
,
analyse
):
l
=
split_before_number
(
s
)
species
=
l
[
0
]
nb
=
l
[
1
]
return
'
{}-{}-{}_100vW_100SPD
'
.
format
(
species
,
nb
,
analyse
)
df
[
'
path_ana
'
]
=
df
[
'
sample_name
'
].
map
(
lambda
x
:
create_fname
(
x
,
analyse
=
'
ANA
'
))
df
[
'
path_aer
'
]
=
df
[
'
sample_name
'
].
map
(
lambda
x
:
create_fname
(
x
,
analyse
=
'
AER
'
))
return
df
#69 antibio + species
#sample_name : lien avec le fichier brut ESCCOL-284-AER_100vW_100SPD correspond à ESCCOL284 variant ANA pour chaque echantillon
#species : espèce => label de prédiction "simple"
#antibiogramme : disk + grand - résistant, vitek + grand + resistant, mic + grand + resistant
#AMC, AMK, AMP, AMX, ATM, CAZ, CHL, CIP, COL, CRO, CTX, CXM, CZA, CZT, ETP, FEP, FOS, FOX, GEN, IPM, LVX, MEC, MEM,
...
...
@@ -291,7 +319,7 @@ def create_antibio_dataset(path='data/230804_strain_peptides_antibiogram_Enterob
if
__name__
==
"
__main__
"
:
path
=
'
data/230804_strain_peptides_antibiogram_Enterobacterales.xlsx
'
df
=
pd
.
read_excel
(
path
,
header
=
1
)
df
=
create_antibio_dataset
(
path
)
# e = oms.MSExperiment()
# oms.MzMLFile().load("data/STAPH140.mzML", e)
# im = build_image_frag(e, 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