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
bd587ede
Commit
bd587ede
authored
3 years ago
by
Martin Larralde
Browse files
Options
Downloads
Patches
Plain Diff
Expose additional private fields of `skch::Sketch` in Cython headers
parent
bc8967c2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/fastani/map/common_func.pxd
+27
-0
27 additions, 0 deletions
include/fastani/map/common_func.pxd
include/fastani/map/win_sketch.pxd
+41
-11
41 additions, 11 deletions
include/fastani/map/win_sketch.pxd
setup.py
+8
-4
8 additions, 4 deletions
setup.py
with
76 additions
and
15 deletions
include/fastani/map/common_func.pxd
0 → 100644
+
27
−
0
View file @
bd587ede
from
libc.stdint
cimport
uint64_t
from
libcpp.string
cimport
string
from
libcpp.vector
cimport
vector
from
fastani.map.base_types
cimport
hash_t
,
seqno_t
cdef
extern
from
"
map/include/commonFunc.hpp
"
namespace
"
skch::CommonFunc
"
nogil
:
cdef
int
seed
void
reverseComplement
(
const
char
*
src
,
char
*
dest
,
int
length
)
hash_t
getHash
(
const
char
*
seq
,
int
length
)
void
addMinimizers
[
T
,
KSEQ
](
vector
[
T
]
&
minimizerIndex
,
KSEQ
kseq
,
int
kmerSize
,
int
windowSize
,
int
alphabetSize
,
seqno_t
seqCounter
)
uint64_t
getReferenceSize
(
const
vector
[
string
]
&
refSequences
)
void
ltrim
(
string
&
s
)
void
rtrim
(
string
&
s
)
void
trim
(
string
&
s
)
This diff is collapsed.
Click to expand it.
include/fastani/map/win_sketch.pxd
+
41
−
11
View file @
bd587ede
cimport
libcpp11.iostream
from
libcpp.map
cimport
map
from
libcpp.unordered_map
cimport
unordered_map
from
libcpp.vector
cimport
vector
...
...
@@ -15,18 +16,47 @@ from fastani.map.map_parameters cimport Parameters
cdef
extern
from
"
map/include/winSketch.hpp
"
namespace
"
skch
"
nogil
:
cdef
cppclass
Sketch
:
IF
FASTANI_PRIVATE_ACCESS
:
ctypedef
vector
[
MinimizerInfo
].
const_iterator
MIIter_t
ctypedef
unordered_map
[
MinimizerMapKeyType
,
MinimizerMapValueType
]
MI_Map_t
ctypedef
vector
[
MinimizerInfo
]
MI_Type
cdef
cppclass
Sketch
:
vector
[
ContigInfo
]
metadata
vector
[
seqno_t
]
sequencesByFileInfo
MI_Map_t
minimizerPosLookupIndex
ctypedef
vector
[
MinimizerInfo
].
const_iterator
MIIter_t
ctypedef
unordered_map
[
MinimizerMapKeyType
,
MinimizerMapValueType
]
MI_Map_t
ctypedef
vector
[
MinimizerInfo
]
MI_Type
Sketch
(
const
Parameters
&
p
)
float
percentageThreshold
# private
int
freqThreshold
# private
Parameters
&
param
# private
MI_Type
minimizerIndex
# private
map
[
int
,
int
]
minimizerFreqHistogram
# private
vector
[
ContigInfo
]
metadata
vector
[
seqno_t
]
sequencesByFileInfo
MI_Map_t
minimizerPosLookupIndex
int
getFreqThreshold
()
MIIter_t
searchIndex
(
seqno_t
seqId
,
offset_t
winpos
)
MIIter_t
getMinimizerIndexEnd
()
Sketch
()
# private
Sketch
(
const
Parameters
&
p
)
void
build
()
# private
void
index
()
# private
void
computeFreqHist
()
# private
int
getFreqThreshold
()
MIIter_t
searchIndex
(
seqno_t
seqId
,
offset_t
winpos
)
MIIter_t
getMinimizerIndexEnd
()
ELSE
:
cdef
cppclass
Sketch
:
ctypedef
vector
[
MinimizerInfo
].
const_iterator
MIIter_t
ctypedef
unordered_map
[
MinimizerMapKeyType
,
MinimizerMapValueType
]
MI_Map_t
ctypedef
vector
[
MinimizerInfo
]
MI_Type
vector
[
ContigInfo
]
metadata
vector
[
seqno_t
]
sequencesByFileInfo
MI_Map_t
minimizerPosLookupIndex
Sketch
(
const
Parameters
&
p
)
int
getFreqThreshold
()
MIIter_t
searchIndex
(
seqno_t
seqId
,
offset_t
winpos
)
MIIter_t
getMinimizerIndexEnd
()
This diff is collapsed.
Click to expand it.
setup.py
+
8
−
4
View file @
bd587ede
...
...
@@ -93,9 +93,13 @@ class publicize_headers(_build_ext):
def
patch_header
(
self
,
old_path
,
new_path
):
self
.
mkpath
(
os
.
path
.
dirname
(
new_path
))
with
open
(
old_path
,
"
r
"
)
as
src
:
with
open
(
new_path
,
"
w
"
)
as
dst
:
for
line
in
src
:
dst
.
write
(
line
.
replace
(
"
private:
"
,
"
public:
"
)
)
source
=
src
.
read
()
source
=
re
.
sub
(
"
private:
"
,
"
public:
"
,
source
)
source
=
re
.
sub
(
r
"
class (.+\s*)\{(\s*)
"
,
r
"
class \1 {\npublic:\n\2
"
,
source
)
with
open
(
new_path
,
"
w
"
)
as
dst
:
dst
.
write
(
source
)
class
build_ext
(
_build_ext
):
...
...
@@ -121,7 +125,7 @@ class build_ext(_build_ext):
# use debug directives with Cython if building in debug mode
cython_args
=
{
"
include_path
"
:
[
"
include
"
,
"
pyfastani
"
],
"
compiler_directives
"
:
{}}
cython_args
[
"
compile_time_env
"
]
=
{
"
SYS_IMPLEMENTATION
"
:
SYS_IMPLEMENTATION
}
cython_args
[
"
compile_time_env
"
]
=
{
"
FASTANI_PRIVATE_ACCESS
"
:
1
}
if
self
.
force
:
cython_args
[
"
force
"
]
=
True
if
self
.
debug
:
...
...
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