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
SOaAS
psot.repository
Commits
6a22244c
Commit
6a22244c
authored
Nov 30, 2017
by
hmueller
Browse files
Translate location identifiers into more verbose representations.
parent
1c531d81
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/convert_targetp.py
View file @
6a22244c
...
...
@@ -8,6 +8,8 @@ parser.add_argument('--result', '-r', required = True, help = 'The targetp resul
parser
.
add_argument
(
'--output'
,
'-o'
,
required
=
True
,
help
=
'The converted results json file'
)
args
=
parser
.
parse_args
()
loc_dict
=
{
"C"
:
"chloroplast"
,
"M"
:
"mitochondrion"
,
"S"
:
"secretory pathway"
,
"_"
:
"other"
,
"*"
:
"undetermined"
}
filename
=
args
.
result
documents
=
{}
with
open
(
filename
)
as
f
:
...
...
@@ -27,6 +29,8 @@ with open(filename) as f:
if
field_index
[
field
]
is
not
None
:
if
field
in
[
"cTP"
,
"mTP"
,
"SP"
]:
results
[
field
.
lower
()]
=
float
(
split
[
field_index
[
field
]])
elif
field
==
"Loc"
:
results
[
field
.
lower
()]
=
loc_dict
[
split
[
field_index
[
field
]]]
else
:
results
[
field
.
lower
()]
=
split
[
field_index
[
field
]]
else
:
...
...
Write
Preview
Markdown
is supported
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