Skip to content

Commit ccda093

Browse files
authored
Merge pull request #1747 from dib-lab/feature/cython_hash_classes
[WIP] Convert Counttable interface to cython
2 parents f25555b + 8251e62 commit ccda093

22 files changed

+528
-773
lines changed

include/khmer/_cpy_counttable.hh

Lines changed: 0 additions & 60 deletions
This file was deleted.

include/khmer/_cpy_khmer.hh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,18 @@ Contact: [email protected]
7474

7575
#include "_cpy_readparsers.hh"
7676

77-
#include "_cpy_hashtable.hh"
78-
#include "_cpy_nodetable.hh"
79-
#include "_cpy_counttable.hh"
80-
#include "_cpy_smallcounttable.hh"
77+
#include "_cpy_hashtable.hh"
8178

8279
#include "_cpy_hashgraph.hh"
8380
#include "_cpy_subsetpartition.hh"
8481
#include "_cpy_countgraph.hh"
8582
#include "_cpy_nodegraph.hh"
8683
#include "_cpy_smallcountgraph.hh"
8784

88-
#include "_cpy_graphlabels.hh"
89-
#include "_cpy_hashset.hh"
85+
#include "_cpy_graphlabels.hh"
86+
#include "_cpy_hashset.hh"
9087
#include "_cpy_readaligner.hh"
91-
88+
9289

9390
namespace khmer {
9491

include/khmer/_cpy_nodetable.hh

Lines changed: 0 additions & 65 deletions
This file was deleted.

include/khmer/_cpy_smallcounttable.hh

Lines changed: 0 additions & 61 deletions
This file was deleted.

include/oxli/hashtable.hh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,27 +500,27 @@ public:
500500
hash_dna(const char * kmer) const
501501
{
502502
if (!(strlen(kmer) >= _ksize)) {
503-
throw oxli_exception("Supplied kmer string doesn't match the underlying k-size.");
503+
throw oxli_value_exception("Supplied kmer string doesn't match the underlying k-size.");
504504
}
505505
return _hash_murmur(kmer, _ksize);
506506
}
507507

508508
inline virtual HashIntoType
509509
hash_dna_top_strand(const char * kmer) const
510510
{
511-
throw oxli_exception("not implemented");
511+
throw oxli_value_exception("not implemented");
512512
}
513513

514514
inline virtual HashIntoType
515515
hash_dna_bottom_strand(const char * kmer) const
516516
{
517-
throw oxli_exception("not implemented");
517+
throw oxli_value_exception("not implemented");
518518
}
519519

520520
inline virtual std::string
521521
unhash_dna(HashIntoType hashval) const
522522
{
523-
throw oxli_exception("not implemented");
523+
throw oxli_value_exception("not implemented");
524524
}
525525

526526
virtual KmerHashIteratorPtr new_kmer_iterator(const char * sp) const

include/oxli/read_parsers.hh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,14 @@ public:
159159
PAIR_MODE_ERROR_ON_UNPAIRED
160160
};
161161

162-
explicit ReadParser(std::unique_ptr<SeqIO> pf);
163-
explicit ReadParser(ReadParser& other);
162+
ReadParser(std::unique_ptr<SeqIO> pf);
163+
164+
ReadParser(ReadParser& other);
165+
ReadParser& operator=(ReadParser& other);
166+
167+
ReadParser(ReadParser&&) noexcept;
168+
ReadParser& operator=(ReadParser&&) noexcept;
169+
164170
virtual ~ReadParser();
165171

166172
Read get_next_read();
@@ -185,7 +191,13 @@ private:
185191
public:
186192
FastxReader();
187193
FastxReader(const std::string& infile);
194+
188195
FastxReader(FastxReader& other);
196+
FastxReader& operator=(FastxReader& other);
197+
198+
FastxReader(FastxReader&&) noexcept;
199+
FastxReader& operator=(FastxReader&&) noexcept;
200+
189201
~FastxReader();
190202

191203
Read get_next_read();
@@ -221,14 +233,16 @@ inline PartitionID _parse_partition_id(std::string name)
221233
}
222234

223235
// Alias for generic/templated ReadParser pointer
224-
template<typename T> using ReadParserPtr = std::unique_ptr<ReadParser<T>>;
236+
template<typename T> using ReadParserPtr = std::shared_ptr<ReadParser<T>>;
237+
template<typename T> using WeakReadParserPtr = std::weak_ptr<ReadParser<T>>;
225238

226239
// Convenience function
227240
template<typename SeqIO>
228241
ReadParserPtr<SeqIO> get_parser(const std::string& filename);
229242

230243
// Alias for instantiated ReadParsers
231-
typedef std::unique_ptr<ReadParser<FastxReader>> FastxParserPtr;
244+
typedef std::shared_ptr<ReadParser<FastxReader>> FastxParserPtr;
245+
typedef std::weak_ptr<ReadParser<FastxReader>> WeakFastxParserPtr;
232246

233247
} // namespace read_parsers
234248

0 commit comments

Comments
 (0)