Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
psot.repository
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container 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
SOaAS
psot.repository
Commits
7a52f072
Commit
7a52f072
authored
6 years ago
by
Lukas Jelonek
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug: hmmer and ghostx don't include sequences with no results
parent
cda62f3e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/convert_ghostx.py
+15
-0
15 additions, 0 deletions
scripts/convert_ghostx.py
scripts/convert_hmmer.py
+3
-1
3 additions, 1 deletion
scripts/convert_hmmer.py
with
18 additions
and
1 deletion
scripts/convert_ghostx.py
+
15
−
0
View file @
7a52f072
...
...
@@ -4,6 +4,7 @@ import sys
import
json
import
argparse
from
os
import
path
import
glob
import
subprocess
parser
=
argparse
.
ArgumentParser
(
description
=
'
Convert ghostx results to json documents
'
)
...
...
@@ -55,6 +56,20 @@ with open(result_filename) as f:
results
.
append
(
result
)
# add entries for files with no results
queries
=
[]
path
=
"
*.ids
"
for
filename
in
glob
.
glob
(
path
):
with
open
(
filename
)
as
f
:
for
line
in
f
:
if
line
.
startswith
(
'
>
'
):
queries
.
append
(
line
.
split
()[
0
].
strip
().
lstrip
(
'
>
'
))
else
:
queries
.
append
(
line
.
split
()[
0
].
strip
())
for
query_id
in
queries
:
if
not
query_id
in
documents
:
documents
[
query_id
]
=
{
"
id
"
:
query_id
,
"
computations
"
:
[{
'
tool
'
:
tool
,
'
results
'
:[]}]}
output_filename
=
args
.
output
with
open
(
output_filename
,
'
w
'
)
as
o
:
json
.
dump
(
documents
,
o
)
...
...
This diff is collapsed.
Click to expand it.
scripts/convert_hmmer.py
+
3
−
1
View file @
7a52f072
...
...
@@ -12,12 +12,14 @@ args = parser.parse_args()
# Provide a list of all query sequence names for conversion process
queries
=
[]
path
=
"
*
_enum_headers.tsv
"
path
=
"
*
.ids
"
for
filename
in
glob
.
glob
(
path
):
with
open
(
filename
)
as
f
:
for
line
in
f
:
if
line
.
startswith
(
'
>
'
):
queries
.
append
(
line
.
split
()[
0
].
strip
().
lstrip
(
'
>
'
))
else
:
queries
.
append
(
line
.
split
()[
0
].
strip
())
filename
=
args
.
result
+
"
/domtblout.tsv
"
documents
=
{}
...
...
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