Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jan Zelenka
prasopes
Commits
27f110ac
Commit
27f110ac
authored
Sep 30, 2019
by
Yan
Browse files
Experimental support for newer rawautoparams
parent
ee764fe4
Changes
2
Show whitespace changes
Inline
Side-by-side
prasopes/__main__.py
View file @
27f110ac
...
...
@@ -79,7 +79,7 @@ def load_file(parent, chrom_plot, spc, d_set, ms_s, fn, chrom_s,
return
if
autoparams
==
True
:
try
:
ms_s
[
'params'
],
rawheaders
=
load_params
(
filename
)
ms_s
[
'params'
],
rawheaders
,
chrom_s
[
'machtype'
]
=
load_params
(
filename
)
segments
=
[
len
(
subset
[
'chrom_dat'
][
0
])
for
subset
in
d_set
]
indicies
=
[
sum
(
segments
[:
i
+
1
])
for
i
in
range
(
len
(
segments
))]
ms_s
[
'headers'
]
=
np
.
split
(
rawheaders
,
indicies
)[:
-
1
]
...
...
@@ -203,7 +203,7 @@ def main():
ms
=
dict
(
annotation
=
[],
name
=
"Spectrum"
,
xlabel
=
"m/z"
,
ylabel
=
"ion count"
,
xtics
=
20
,
predict
=
None
,
params
=
[],
headers
=
[],
texts
=
[])
chrom
=
dict
(
x
=
[
0
],
y
=
[
0
],
t_start
=
None
,
t_end
=
None
,
chrom
=
dict
(
x
=
[
0
],
y
=
[
0
],
t_start
=
None
,
t_end
=
None
,
machtype
=
None
,
name
=
"Chromatogram"
,
xlabel
=
"time(min)"
,
ylabel
=
"total ion count"
,
timesarg
=
[])
filename
=
[
None
]
...
...
prasopes/graphtools.py
View file @
27f110ac
...
...
@@ -377,12 +377,17 @@ def legendize(rawlegend, chrom_data):
marks
=
[
"-"
,
"+"
]
quads
=
[
"q3"
,
"q1"
]
def
translate
(
wut
):
if
chrom_data
[
'machtype'
]
==
47
:
if
wut
[
1
]
in
(
0
,
1
):
text
=
"{}{}ms; m/z = {:.1f}-{:.1f}"
.
format
(
marks
[
int
(
wut
[
0
])],
quads
[
int
(
wut
[
1
])],
*
wut
[
4
:])
else
:
text
=
"{}ms^{} {:.2f}@{:.1f}V; m/z = {:.1f}-{:.1f}"
.
format
(
marks
[
int
(
wut
[
0
])],
*
wut
[
1
:])
elif
chrom_data
[
'machtype'
]
==
57
:
text
=
"ms; m/z = {:.2f}@{:.1f}V; m/z = {:.1f}-{:.1f}"
.
format
(
*
wut
)
else
:
text
=
"unknown header type"
return
text
strdata
=
[
translate
(
i
)
for
i
in
np
.
unique
(
np
.
array
(
rawlegend
),
axis
=
0
)]
strtext
=
" and "
.
join
(
strdata
)
+
"; t = {:.2f}-{:.2f} min"
.
format
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment