Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
psot
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SOaAS
psot
Commits
ebb26a4a
Commit
ebb26a4a
authored
Dec 5, 2017
by
Lukas Jelonek
Browse files
Options
Downloads
Plain Diff
Merge branch 'hmmscan-empty-results' into 'develop'
Hmmscan empty results See merge request
!4
parents
f67b0373
f404a49c
No related branches found
No related tags found
1 merge request
!4
Hmmscan empty results
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/convert_hmmer.py
+14
-1
14 additions, 1 deletion
scripts/convert_hmmer.py
scripts/run_hmmer.py
+14
-1
14 additions, 1 deletion
scripts/run_hmmer.py
with
28 additions
and
2 deletions
scripts/convert_hmmer.py
+
14
−
1
View file @
ebb26a4a
...
...
@@ -9,6 +9,11 @@ parser.add_argument('--output', '-o', required=True, help='The converted results
parser
.
add_argument
(
'
--dbxref
'
,
'
-d
'
,
required
=
True
,
help
=
'
The dbxref prefix that will be prepended to the accession or id
'
)
args
=
parser
.
parse_args
()
query_file
=
args
.
result
+
"
/queries.json
"
queries
=
[]
with
open
(
query_file
)
as
f
:
queries
=
json
.
load
(
f
)
filename
=
args
.
result
+
"
/domtblout.tsv
"
documents
=
{}
tool
=
{
'
name
'
:
None
,
'
version
'
:
None
,
'
database
'
:
None
}
...
...
@@ -30,6 +35,10 @@ with open(filename) as f:
query_id
=
split
[
3
]
if
not
query_id
in
documents
:
documents
[
query_id
]
=
{
"
id
"
:
query_id
,
"
computations
"
:
[{
'
tool
'
:
tool
,
'
results
'
:[]}]}
try
:
queries
.
remove
(
query_id
)
except
ValueError
:
print
(
'
HMMER converter: Query ID
"'
+
query_id
+
'"
not found among initial queries!
'
)
results
=
documents
[
query_id
][
'
computations
'
][
0
][
"
results
"
]
results
.
append
({
...
...
@@ -48,6 +57,10 @@ with open(filename) as f:
}
})
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/run_hmmer.py
+
14
−
1
View file @
ebb26a4a
#!/usr/bin/env python3
import
env
import
argparse
import
json
from
psot
import
config
from
os
import
system
,
makedirs
...
...
@@ -22,3 +23,15 @@ system(hmmscan_tool +
"
--domtblout
"
+
args
.
output
+
"
/domtblout.tsv
"
+
"
--pfamtblout
"
+
args
.
output
+
"
/pfamtblout.tsv
"
+
args
.
database
+
"
"
+
args
.
fasta
)
# Provide a list of all query sequence names for conversion process
queries
=
[]
with
open
(
args
.
fasta
)
as
f
:
for
line
in
f
:
if
line
.
startswith
(
'
>
'
):
queries
.
append
(
line
.
split
()[
0
].
strip
().
lstrip
(
'
>
'
))
query_file
=
args
.
output
+
'
/queries.json
'
with
open
(
query_file
,
'
w
'
)
as
o
:
json
.
dump
(
queries
,
o
)
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
sign in
to comment