Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PyHMMER
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Martin Larralde
PyHMMER
Commits
41c377e6
Commit
41c377e6
authored
5 months ago
by
Martin Larralde
Browse files
Options
Downloads
Patches
Plain Diff
Fix handling of `TopHits` in `pyhmmer.daemon.Client`
parent
a13e32aa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#65664
failed
5 months ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pyhmmer/daemon.pxd
+1
-1
1 addition, 1 deletion
pyhmmer/daemon.pxd
pyhmmer/daemon.pyx
+12
-39
12 additions, 39 deletions
pyhmmer/daemon.pyx
with
13 additions
and
40 deletions
pyhmmer/daemon.pxd
+
1
−
1
View file @
41c377e6
...
...
@@ -22,7 +22,7 @@ cdef class Client:
cdef
bytearray
_recvall
(
self
,
size_t
message_size
)
cdef
TopHits
_client
(
self
,
bytes
query
,
object
query
,
uint64_t
db
,
list
ranges
,
Pipeline
pli
,
...
...
This diff is collapsed.
Click to expand it.
pyhmmer/daemon.pyx
+
12
−
39
View file @
41c377e6
...
...
@@ -160,7 +160,7 @@ cdef class Client:
cdef
TopHits
_client
(
self
,
bytes
query
,
object
query
,
uint64_t
db
,
list
ranges
,
Pipeline
pli
,
...
...
@@ -190,7 +190,7 @@ cdef class Client:
cdef
uint32_t
hits_start
cdef
uint32_t
buf_offset
=
0
cdef
TopHits
hits
=
TopHits
()
cdef
TopHits
hits
=
TopHits
(
query
)
cdef
str
options
=
""
.
join
(
pli
.
arguments
())
# check ranges argument
...
...
@@ -207,6 +207,12 @@ cdef class Client:
memset
(
&
search_status
,
0
,
sizeof
(
HMMD_SEARCH_STATUS
))
search_stats
.
hit_offsets
=
NULL
# serialize query
with
io
.
BytesIO
()
as
buffer
:
query
.
write
(
buffer
)
buffer
.
write
(
b
"
\n
//
"
)
txt
=
buffer
.
getvalue
()
try
:
# send the options
if
mode
==
p7_pipemodes_e
.
p7_SEARCH_SEQS
:
...
...
@@ -220,7 +226,7 @@ cdef class Client:
self
.
socket
.
sendall
(
f
"
@--hmmdb
{
db
}
{
options
}
\n
"
.
encode
(
"
ascii
"
))
# send the query
self
.
socket
.
sendall
(
query
)
self
.
socket
.
sendall
(
txt
)
# get the search status back
response
=
self
.
_recvall
(
HMMD_SEARCH_STATUS_SERIAL_SIZE
)
...
...
@@ -344,20 +350,9 @@ cdef class Client:
sequence against the sequence database loaded on the server side.
"""
cdef
bytes
txt
cdef
TopHits
hits
cdef
Alphabet
abc
=
getattr
(
query
,
"
alphabet
"
,
Alphabet
.
amino
())
cdef
Pipeline
pli
=
Pipeline
(
abc
,
**
options
)
with
io
.
BytesIO
()
as
buffer
:
query
.
write
(
buffer
)
buffer
.
write
(
b
"
\n
//
"
)
txt
=
buffer
.
getvalue
()
hits
=
self
.
_client
(
txt
,
db
,
ranges
,
pli
,
p7_pipemodes_e
.
p7_SEARCH_SEQS
)
hits
.
_query
=
query
return
hits
return
self
.
_client
(
query
,
db
,
ranges
,
pli
,
p7_pipemodes_e
.
p7_SEARCH_SEQS
)
def
search_hmm
(
self
,
...
...
@@ -384,19 +379,8 @@ cdef class Client:
server side.
"""
cdef
bytes
txt
cdef
TopHits
hits
cdef
Pipeline
pli
=
Pipeline
(
query
.
alphabet
,
**
options
)
with
io
.
BytesIO
()
as
buffer
:
query
.
write
(
buffer
)
buffer
.
write
(
b
"
\n
//
"
)
txt
=
buffer
.
getvalue
()
hits
=
self
.
_client
(
txt
,
db
,
ranges
,
pli
,
p7_pipemodes_e
.
p7_SEARCH_SEQS
)
hits
.
_query
=
query
return
hits
return
self
.
_client
(
query
,
db
,
ranges
,
pli
,
p7_pipemodes_e
.
p7_SEARCH_SEQS
)
def
scan_seq
(
self
,
Sequence
query
,
uint64_t
db
=
1
,
**
options
):
"""
Search the HMMER daemon database with a query sequence.
...
...
@@ -415,20 +399,9 @@ cdef class Client:
server side.
"""
cdef
bytes
txt
cdef
TopHits
hits
cdef
Alphabet
abc
=
getattr
(
query
,
"
alphabet
"
,
Alphabet
.
amino
())
cdef
Pipeline
pli
=
Pipeline
(
abc
,
**
options
)
with
io
.
BytesIO
()
as
buffer
:
query
.
write
(
buffer
)
buffer
.
write
(
b
"
\n
//
"
)
txt
=
buffer
.
getvalue
()
hits
=
self
.
_client
(
txt
,
db
,
None
,
pli
,
p7_pipemodes_e
.
p7_SCAN_MODELS
)
hits
.
_query
=
query
return
hits
return
self
.
_client
(
query
,
db
,
None
,
pli
,
p7_pipemodes_e
.
p7_SCAN_MODELS
)
def
iterate_seq
(
self
,
...
...
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