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
436ba8fb
Commit
436ba8fb
authored
Jun 21, 2017
by
Lukas Jelonek
Browse files
Adapt blastp result to hmmer output
parent
36b489b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/convert_blastp.py
View file @
436ba8fb
...
...
@@ -35,18 +35,20 @@ with open(filename) as f:
documents
[
split
[
0
]]
=
{
"id"
:
split
[
0
],
"computations"
:
[{
'tool'
:
tool
,
'results'
:[]}]}
results
=
documents
[
split
[
0
]][
'computations'
][
0
][
'results'
]
result
=
{}
result
[
"dbxref"
]
=
"UniProtKB/Swiss-Prot:"
+
split
[
header
[
'subject id'
]].
split
(
"|"
)[
1
]
result
=
{
'target'
:{},
'query'
:{}
}
result
[
'target'
][
"dbxref"
]
=
"UniProtKB/Swiss-Prot:"
+
split
[
header
[
'subject id'
]].
split
(
"|"
)[
1
]
if
'% identity'
in
header
:
result
[
"percent_identity"
]
=
float
(
split
[
header
[
'% identity'
]])
result
[
'target'
][
"percent_identity"
]
=
float
(
split
[
header
[
'% identity'
]])
if
'q. start'
in
header
and
'q. end'
in
header
:
result
[
'qloc'
]
=
split
[
header
[
'q. start'
]]
+
'-'
+
split
[
header
[
'q. end'
]]
result
[
'query'
][
'start'
]
=
split
[
header
[
'q. start'
]]
result
[
'query'
][
'end'
]
=
split
[
header
[
'q. end'
]]
if
's. start'
in
header
and
's. end'
in
header
:
result
[
'sloc'
]
=
split
[
header
[
's. start'
]]
+
'-'
+
split
[
header
[
's. end'
]]
result
[
'target'
][
'start'
]
=
split
[
header
[
's. start'
]]
result
[
'target'
][
'end'
]
=
split
[
header
[
's. end'
]]
if
'evalue'
in
header
:
result
[
'evalue'
]
=
float
(
split
[
header
[
'evalue'
]])
result
[
'
target'
][
'
evalue'
]
=
float
(
split
[
header
[
'evalue'
]])
if
'BTOP'
in
header
:
result
[
'btop'
]
=
split
[
header
[
'BTOP'
]]
result
[
'
target'
][
'
btop'
]
=
split
[
header
[
'BTOP'
]]
results
.
append
(
result
)
...
...
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