Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PyFastANI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Monitor
Incidents
Service Desk
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
PyFastANI
Commits
dcf90bdc
Commit
dcf90bdc
authored
3 years ago
by
Martin Larralde
Browse files
Options
Downloads
Patches
Plain Diff
Fix `std::unique` requiring function pointers in OSX
parent
4ab56195
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
pyfastani/_fastani.pyx
+4
-4
4 additions, 4 deletions
pyfastani/_fastani.pyx
pyfastani/_utils.cpp
+0
-6
0 additions, 6 deletions
pyfastani/_utils.cpp
pyfastani/_utils.hpp
+0
-4
0 additions, 4 deletions
pyfastani/_utils.hpp
pyfastani/_utils.pxd
+0
-1
0 additions, 1 deletion
pyfastani/_utils.pxd
with
4 additions
and
15 deletions
pyfastani/_fastani.pyx
+
4
−
4
View file @
dcf90bdc
...
...
@@ -12,7 +12,7 @@ from libc.limits cimport INT_MAX
from
libc.stdint
cimport
int64_t
,
uint64_t
from
libc.stdlib
cimport
malloc
,
realloc
,
free
from
libcpp
cimport
bool
,
nullptr
from
libcpp.algorithm
cimport
sort
from
libcpp.algorithm
cimport
sort
,
unique
from
libcpp.deque
cimport
deque
from
libcpp.utility
cimport
move
,
pair
from
libcpp.functional
cimport
function
...
...
@@ -46,7 +46,7 @@ from fastani.map.base_types cimport (
# HACK: we need kseq_t* as a template argument, which is not supported by
# Cython at the moment, so we just `typedef kseq_t* kseq_ptr_t` in
# an external C++ header to make Cython happy
from
_utils
cimport
kseq_ptr_t
,
toupper
,
complement
,
distance
,
unique_minimizers
from
_utils
cimport
kseq_ptr_t
,
toupper
,
complement
,
distance
from
_unicode
cimport
*
...
...
@@ -579,11 +579,11 @@ cdef class Mapper(_Parameterized):
)
# find the unique minimizers in thos that were just obtained
sort
(
query
.
minimizerTableQuery
.
begin
(),
query
.
minimizerTableQuery
.
end
(),
MinimizerInfo_t
.
lessByHash
)
sort
(
query
.
minimizerTableQuery
.
begin
(),
query
.
minimizerTableQuery
.
end
(),
&
MinimizerInfo_t
.
lessByHash
)
# manually implement `unique` as template instantiation has issues on OSX
it
=
query
.
minimizerTableQuery
.
begin
()
uniq_end_iter
=
unique
_minimizers
(
query
.
minimizerTableQuery
.
begin
(),
query
.
minimizerTableQuery
.
end
())
uniq_end_iter
=
unique
(
query
.
minimizerTableQuery
.
begin
(),
query
.
minimizerTableQuery
.
end
()
,
&
MinimizerInfo_t
.
equalityByHash
)
# early return if no minimizers were found
query
.
sketchSize
=
distance
(
query
.
minimizerTableQuery
.
begin
(),
uniq_end_iter
)
...
...
This diff is collapsed.
Click to expand it.
pyfastani/_utils.cpp
+
0
−
6
View file @
dcf90bdc
...
...
@@ -24,9 +24,3 @@ ZEXTERN int ZEXPORT gzread(gzFile file, void* buf, unsigned int len) {
ZEXTERN
int
ZEXPORT
gzclose
(
gzFile
file
)
{
return
0
;
}
// Implementation from: https://en.cppreference.com/w/cpp/algorithm/
std
::
vector
<
skch
::
MinimizerInfo
>::
iterator
unique_minimizers
(
std
::
vector
<
skch
::
MinimizerInfo
>::
iterator
first
,
std
::
vector
<
skch
::
MinimizerInfo
>::
iterator
last
)
{
return
std
::
unique
(
first
,
last
,
skch
::
MinimizerInfo
::
equalityByHash
);
}
This diff is collapsed.
Click to expand it.
pyfastani/_utils.hpp
+
0
−
4
View file @
dcf90bdc
...
...
@@ -44,8 +44,4 @@ extern "C" {
}
// OSX seems to have trouble instantiating `std::unique` with our
// custom type, so here is a dedicated implementation
std
::
vector
<
skch
::
MinimizerInfo
>::
iterator
unique_minimizers
(
std
::
vector
<
skch
::
MinimizerInfo
>::
iterator
first
,
std
::
vector
<
skch
::
MinimizerInfo
>::
iterator
last
);
#endif // ifdef __UTILS_HPP
This diff is collapsed.
Click to expand it.
pyfastani/_utils.pxd
+
0
−
1
View file @
dcf90bdc
...
...
@@ -40,5 +40,4 @@ cdef extern from "_utils.hpp" nogil:
ctypedef
kseq_t
*
kseq_ptr_t
cdef
vector
[
MinimizerInfo_t
].
iterator
unique_minimizers
(
vector
[
MinimizerInfo_t
].
iterator
,
vector
[
MinimizerInfo_t
].
iterator
)
int
complement
(
int
)
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