Skip to content
Snippets Groups Projects
Commit 133e14e6 authored by Martin Larralde's avatar Martin Larralde
Browse files

Move `kseq_ptr_t` to the `_utils.hpp` helper header

parent e54f5ccc
No related branches found
No related tags found
No related merge requests found
...@@ -43,7 +43,7 @@ cdef extern from "map/include/base_types.hpp" namespace "skch" nogil: ...@@ -43,7 +43,7 @@ cdef extern from "map/include/base_types.hpp" namespace "skch" nogil:
cdef cppclass QueryMetaData[ K, MV ]: cdef cppclass QueryMetaData[ K, MV ]:
K kseq K kseq
seqno_t seqCounter seqno_t seqCounter
int sketchsize int sketchSize
MV minimizerTableQuery MV minimizerTableQuery
......
from libc.stdint cimport uint64_t from libc.stdint cimport uint64_t
from libcpp.vector cimport vector from libcpp.vector cimport vector
from libcpp.functional cimport function from libcpp.functional cimport function
from libcpp11.fstream cimport ofstream
from fastani.map.base_types cimport seqno_t, offset_t, ContigInfo, MappingResult, MappingResultsVector_t from fastani.map.base_types cimport seqno_t, offset_t, ContigInfo, MappingResult, MappingResultsVector_t
from fastani.map.map_parameters cimport Parameters from fastani.map.map_parameters cimport Parameters
...@@ -12,12 +13,12 @@ cdef extern from "map/include/computeMap.hpp" namespace "skch" nogil: ...@@ -12,12 +13,12 @@ cdef extern from "map/include/computeMap.hpp" namespace "skch" nogil:
cdef cppclass Map: cdef cppclass Map:
cppclass L1_candidateLocus_t: struct L1_candidateLocus_t:
seqno_t seqId seqno_t seqId
offset_t rangeStartPos offset_t rangeStartPos
offset_t rangeEndPos offset_t rangeEndPos
cppclass L2_mapLocus_t: struct L2_mapLocus_t:
seqno_t seqId seqno_t seqId
offset_t meanOptimalPos offset_t meanOptimalPos
Sketch.MIIter_t optimalStart Sketch.MIIter_t optimalStart
...@@ -37,10 +38,4 @@ cdef extern from "map/include/computeMap.hpp" namespace "skch" nogil: ...@@ -37,10 +38,4 @@ cdef extern from "map/include/computeMap.hpp" namespace "skch" nogil:
function[void(MappingResult&)] f = nullptr function[void(MappingResult&)] f = nullptr
) )
Map( void mapSingleQuerySeq[Q](Q&, MappingResultsVector_t&, ofstream&)
const Parameters &p,
const Sketch &refsketch,
uint64_t &totalQueryFragments,
int queryno,
MappingResultsVector_t &r
)
...@@ -7,6 +7,5 @@ cdef extern from "common/kseq.h": ...@@ -7,6 +7,5 @@ cdef extern from "common/kseq.h":
size_t m size_t m
char* s char* s
ctypedef __kseq_t kseq_t cdef cppclass kseq_t:
cdef struct __kseq_t:
kstring_t seq kstring_t seq
#include <iostream>
#include <ctime>
#include <chrono>
#include <functional>
#include "_utils.hpp" #include "_utils.hpp"
skch::Map* new_map_with_result_vector(
const skch::Parameters &p,
const skch::Sketch &refsketch,
uint64_t &totalQueryFragments,
int queryno,
skch::MappingResultsVector_t &r
) {
auto fn = std::bind(skch::Map::insertL2ResultsToVec, std::ref(r), std::placeholders::_1);
return new skch::Map( p, refsketch, totalQueryFragments, queryno, fn );
}
int omp_get_thread_num(void) { int omp_get_thread_num(void) {
return 1; // Make the logger shut up. return 1; // Make the logger shut up.
} }
......
#ifndef __UTILS_HPP #ifndef __UTILS_HPP
#define __UTILS_HPP #define __UTILS_HPP
#include "map/include/computeMap.hpp"
#include <stdint.h> #include <stdint.h>
#include <functional> #include <chrono>
#include <limits>
#include <iostream>
#include <vector>
#include "common/kseq.h"
#include "map/include/base_types.hpp" #include "map/include/base_types.hpp"
#include "map/include/computeMap.hpp" #include "map/include/winSketch.hpp"
skch::Map* new_map_with_result_vector(
const skch::Parameters &p,
const skch::Sketch &refsketch,
uint64_t &totalQueryFragments,
int queryno,
skch::MappingResultsVector_t &r
);
// not needed anywhere except in `cgi::correctRefGenomeIds` // not needed anywhere except in `cgi::correctRefGenomeIds`
// so we can just patch them // so we can just patch them
extern int omp_get_thread_num(void); extern int omp_get_thread_num(void);
extern int omp_get_num_threads(void); extern int omp_get_num_threads(void);
typedef kseq_t* kseq_ptr_t;
#endif #endif
from libc.stdint cimport uint64_t from libc.stdint cimport uint64_t
from kseq cimport kseq_t
from fastani.map.base_types cimport MappingResultsVector_t from fastani.map.base_types cimport MappingResultsVector_t
from fastani.map.compute_map cimport Map from fastani.map.compute_map cimport Map
from fastani.map.map_parameters cimport Parameters from fastani.map.map_parameters cimport Parameters
...@@ -8,10 +9,7 @@ from fastani.map.win_sketch cimport Sketch ...@@ -8,10 +9,7 @@ from fastani.map.win_sketch cimport Sketch
cdef extern from "_utils.hpp" nogil: cdef extern from "_utils.hpp" nogil:
Map* new_map_with_result_vector( int omp_get_thread_num()
const Parameters &p, int omp_get_num_threads()
const Sketch &refsketch,
uint64_t &totalQueryFragments, ctypedef kseq_t* kseq_ptr_t
int queryno,
MappingResultsVector_t &r
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment