diff --git a/khmer/_oxli/graphs.pxd b/khmer/_oxli/graphs.pxd index 55339a2ec1..2d661358b9 100644 --- a/khmer/_oxli/graphs.pxd +++ b/khmer/_oxli/graphs.pxd @@ -7,7 +7,7 @@ from libc.stdint cimport uint8_t, uint32_t, uint64_t, uintptr_t from khmer._oxli.oxli_types cimport * from khmer._oxli.hashing cimport Kmer, CpKmer, KmerSet, CpKmerFactory, CpKmerIterator -from khmer._oxli.parsing cimport CpReadParser, CpSequence +from khmer._oxli.parsing cimport CpReadParser, CpSequence, FastxParserPtr from khmer._oxli.legacy_partitioning cimport (CpSubsetPartition, cp_pre_partition_info, SubsetPartition) from khmer._oxli.utils cimport oxli_raise_py_error @@ -139,7 +139,7 @@ cdef extern from "oxli/hashgraph.hh" namespace "oxli" nogil: void consume_seqfile_and_tag[SeqIO](const string &, unsigned int, - unsigned long long) + unsigned long long) # Ugly workaround. For some reason, Cython doesn't like *just this* # templated overload -- it chooses whichever was defined last, breaking @@ -147,7 +147,7 @@ cdef extern from "oxli/hashgraph.hh" namespace "oxli" nogil: # the Cython side and give it a real name substitution for code gen. void consume_seqfile_and_tag_readparser "consume_seqfile_and_tag" [SeqIO](shared_ptr[CpReadParser[SeqIO]], unsigned int, - unsigned long long) + unsigned long long) void consume_sequence_and_tag(const string &, unsigned long long &) @@ -160,7 +160,7 @@ cdef extern from "oxli/hashgraph.hh" namespace "oxli" nogil: unsigned int &, unsigned long long &) except +oxli_raise_py_error - uintptr_t trim_on_stoptags(string) + uintptr_t trim_on_stoptags(string) unsigned int traverse_from_kmer(CpKmer, uint32_t, @@ -177,7 +177,7 @@ cdef extern from "oxli/hashgraph.hh" namespace "oxli" nogil: void load_stop_tags(string, bool) except +oxli_raise_py_error void extract_unique_paths(string, uint32_t, float, vector[string]) void calc_connected_graph_size(CpKmer, uint64_t&, KmerSet&, - const uint64_t, bool) + const uint64_t, bool) uint32_t kmer_degree(HashIntoType, HashIntoType) uint32_t kmer_degree(const char *) void find_high_degree_nodes(const char *, set[HashIntoType] &) const @@ -246,6 +246,7 @@ cdef class Hashtable: cdef HashIntoType sanitize_hash_kmer(self, object kmer) except -1 cdef bytes _valid_sequence(self, str sequence) cdef CpKmer _build_kmer(self, object kmer) except * + cdef FastxParserPtr _get_parser(self, object parser_or_filename) except * cdef list _get_raw_tables(self, uint8_t **, vector[uint64_t]) diff --git a/khmer/_oxli/graphs.pyx b/khmer/_oxli/graphs.pyx index 14c2d2de96..f8429824bc 100644 --- a/khmer/_oxli/graphs.pyx +++ b/khmer/_oxli/graphs.pyx @@ -12,8 +12,9 @@ from libcpp.string cimport string from khmer._oxli.utils cimport _bstring, is_str, is_num from khmer._oxli.utils import get_n_primes_near_x -from khmer._oxli.parsing cimport (CpFastxReader, CPyReadParser_Object, get_parser, - CpReadParser, FastxParserPtr) +from khmer._oxli.parsing cimport (CpFastxReader, CPyReadParser_Object, + get_parser, CpReadParser, FastxParser, + FastxParserPtr) from khmer._oxli.hashset cimport HashSet from khmer._oxli.legacy_partitioning cimport (CpSubsetPartition, SubsetPartition, cp_pre_partition_info, PrePartitionInfo) @@ -128,7 +129,7 @@ cdef class Hashtable: return deref(self._ht_this).get_count( kmer) else: self._kmer_type_error(kmer) - + def ksize(self): """k-mer size""" @@ -211,87 +212,81 @@ cdef class Hashtable: max_count)) return posns - def consume_seqfile_with_reads_parser(self, read_parser): - """Count all k-mers from read_parser.""" - cdef unsigned long long n_consumed = 0 - cdef unsigned int total_reads = 0 - - cdef CPyReadParser_Object* parser = read_parser + cdef FastxParserPtr _get_parser(self, object parser_or_filename) except *: + cdef FastxParserPtr _parser + if isinstance(parser_or_filename, FastxParser): + _parser = (parser_or_filename)._this + elif isinstance(parser_or_filename, ReadParser): + _parser = (parser_or_filename).parser + elif is_str(parser_or_filename): + _parser = get_parser[CpFastxReader](_bstring(parser_or_filename)) + else: + raise TypeError('argument does not appear to be a parser or a ' + 'filename: {}'.format(parser_or_filename)) + return _parser - deref(self._ht_this).consume_seqfile[CpFastxReader](parser.parser, - total_reads, - n_consumed) - return total_reads, n_consumed - def consume_seqfile(self, file_name): + def consume_seqfile(self, object parser_or_filename): """Count all k-mers from file_name.""" cdef unsigned long long n_consumed = 0 cdef unsigned int total_reads = 0 - - cdef FastxParserPtr parser = get_parser[CpFastxReader](_bstring(file_name)) - deref(self._ht_this).consume_seqfile[CpFastxReader](parser, - total_reads, - n_consumed) + cdef FastxParserPtr _parser = self._get_parser(parser_or_filename) + with nogil: + deref(self._ht_this).consume_seqfile[CpFastxReader](\ + _parser, total_reads, n_consumed + ) return total_reads, n_consumed - def consume_seqfile_with_mask(self, file_name, Hashtable mask, int threshold=0): + def consume_seqfile_with_mask(self, object parser_or_filename, + Hashtable mask, int threshold=0): cdef unsigned long long n_consumed = 0 cdef unsigned int total_reads = 0 - cdef FastxParserPtr parser = get_parser[CpFastxReader](_bstring(file_name)) + cdef FastxParserPtr _parser = self._get_parser(parser_or_filename) cdef CpHashtable * cmask = mask._ht_this.get() - deref(self._ht_this).consume_seqfile_with_mask[CpFastxReader](parser, - cmask, - threshold, - total_reads, - n_consumed) + with nogil: + deref(self._ht_this).consume_seqfile_with_mask[CpFastxReader](\ + _parser, cmask, threshold, total_reads, n_consumed + ) return total_reads, n_consumed - def consume_seqfile_banding(self, file_name, num_bands, band): + def consume_seqfile_banding(self, object parser_or_filename, int num_bands, + int band): """Count all k-mers from file_name.""" cdef unsigned long long n_consumed = 0 cdef unsigned int total_reads = 0 - cdef FastxParserPtr parser = get_parser[CpFastxReader](_bstring(file_name)) - deref(self._ht_this).consume_seqfile_banding[CpFastxReader](parser, - num_bands, - band, - total_reads, - n_consumed) + cdef FastxParserPtr _parser = self._get_parser(parser_or_filename) + with nogil: + deref(self._ht_this).consume_seqfile_banding[CpFastxReader](\ + _parser, num_bands, band, total_reads, n_consumed + ) return total_reads, n_consumed - def consume_seqfile_banding_with_mask(self, file_name, num_bands, band, + def consume_seqfile_banding_with_mask(self, object parser_or_filename, + int num_bands, int band, Hashtable mask, int threshold=0): cdef unsigned long long n_consumed = 0 cdef unsigned int total_reads = 0 - cdef FastxParserPtr parser = get_parser[CpFastxReader](_bstring(file_name)) + cdef FastxParserPtr _parser = self._get_parser(parser_or_filename) cdef CpHashtable * cmask = mask._ht_this.get() - deref(self._ht_this).consume_seqfile_banding_with_mask[CpFastxReader](parser, - num_bands, - band, - cmask, - threshold, - total_reads, - n_consumed) + with nogil: + deref(self._ht_this).\ + consume_seqfile_banding_with_mask[CpFastxReader](\ + _parser, num_bands, band, cmask, threshold, total_reads, + n_consumed + ) return total_reads, n_consumed - def abundance_distribution(self, file_name, Hashtable tracking): - """Calculate the k-mer abundance distribution over reads in file_name.""" - cdef FastxParserPtr parser = get_parser[CpFastxReader](_bstring(file_name)) - cdef CpHashtable * cptracking = tracking._ht_this.get() - cdef uint64_t * x = deref(self._ht_this).\ - abundance_distribution[CpFastxReader](parser, cptracking) - abunds = [] - for i in range(MAX_BIGCOUNT): - abunds.append(x[i]) - return abunds - - def abundance_distribution_with_reads_parser(self, object read_parser, Hashtable tracking): - """Calculate the k-mer abundance distribution over reads.""" + def abundance_distribution(self, object parser_or_filename, + Hashtable tracking): + """Calculate the k-mer abundance distribution over input reads.""" + cdef FastxParserPtr _parser = self._get_parser(parser_or_filename) + cdef CpHashtable * _tracking = tracking._ht_this.get() + cdef uint64_t * x + with nogil: + x = deref(self._ht_this).abundance_distribution[CpFastxReader](\ + _parser, _tracking + ) - cdef CpHashtable * cptracking = tracking._ht_this.get() - cdef CPyReadParser_Object* parser - parser = read_parser - cdef uint64_t * x = deref(self._ht_this).abundance_distribution[CpFastxReader]( - parser.parser, cptracking) abunds = [] for i in range(MAX_BIGCOUNT): abunds.append(x[i]) @@ -486,12 +481,12 @@ cdef class Hashgraph(Hashtable): list; used in graph contraction.''' cdef HashSet hdns = HashSet(self.ksize()) _sequence = self._valid_sequence(sequence) - deref(self._hg_this).find_high_degree_nodes(_sequence, + deref(self._hg_this).find_high_degree_nodes(_sequence, hdns.hs) return hdns - def traverse_linear_path(self, object kmer, HashSet hdns, + def traverse_linear_path(self, object kmer, HashSet hdns, Nodegraph stop_filter=None): '''Traverse the path through the graph starting with the given k-mer and avoiding high-degree nodes, finding (and returning) @@ -539,7 +534,7 @@ cdef class Hashgraph(Hashtable): cdef HashSet hs = HashSet(self.ksize()) deref(self._hg_this).get_tags_for_sequence(_sequence, hs.hs) return hs - + def find_all_tags_list(self, object kmer): '''Find all tags within range of the given k-mer, return as list''' cdef CpKmer _kmer = self._build_kmer(kmer) @@ -548,32 +543,35 @@ cdef class Hashgraph(Hashtable): cdef shared_ptr[CpHashgraph] this = self._hg_this with nogil: - deref(deref(self._hg_this).partition).find_all_tags(_kmer, deref(tags), + deref(deref(self._hg_this).partition).find_all_tags(_kmer, deref(tags), deref(this).all_tags) return result - def consume_seqfile_and_tag(self, str filename): + def consume_seqfile_and_tag(self, object parser_or_filename): '''Consume all sequences in a FASTA/FASTQ file and tag the resulting graph.''' cdef unsigned long long n_consumed = 0 cdef unsigned int total_reads = 0 - cdef string _filename = _bstring(filename) + cdef FastxParserPtr _parser = self._get_parser(parser_or_filename) + + with nogil: + deref(self._hg_this).\ + consume_seqfile_and_tag_readparser[CpFastxReader](_parser, + total_reads, + n_consumed) - deref(self._hg_this).consume_seqfile_and_tag[CpFastxReader](_filename, - total_reads, - n_consumed) return total_reads, n_consumed - + def print_tagset(self, str filename): '''Print out all of the tags.''' deref(self._hg_this).print_tagset(_bstring(filename)) - + def add_tag(self, object kmer): '''Add a k-mer to the tagset.''' cdef HashIntoType _kmer = self.sanitize_hash_kmer(kmer) deref(self._hg_this).add_tag(_kmer) - + def get_tagset(self): '''Get all tagged k-mers as DNA strings.''' cdef HashIntoType st @@ -591,16 +589,16 @@ cdef class Hashgraph(Hashtable): def load_tagset(self, str filename, clear_tags=True): '''Load tags from a file.''' deref(self._hg_this).load_tagset(_bstring(filename), clear_tags) - + def save_tagset(self, str filename): '''Save tags to a file.''' deref(self._hg_this).save_tagset(_bstring(filename)) - + @property def n_tags(self): '''Return the count of all tags.''' return deref(self._hg_this).n_tags() - + def divide_tags_into_subsets(self, int subset_size=0): '''Divide tags equally up into subsets of given size.''' cdef set[HashIntoType] divvy @@ -608,12 +606,12 @@ cdef class Hashgraph(Hashtable): cdef HashSet hs = HashSet(self.ksize()) hs.hs = divvy return hs - + @property def tag_density(self): '''Get the tagging density.''' return deref(self._hg_this)._get_tag_density() - + @tag_density.setter def tag_density(self, int density): '''Set the tagging density.''' @@ -630,7 +628,7 @@ cdef class Hashgraph(Hashtable): cdef HashIntoType end = self.sanitize_hash_kmer(end_kmer) cdef bool cbreak = break_on_stoptags cdef bool cstop = stop_big_traversals - + with nogil: deref(subset_ptr).do_partition(start, end, cbreak, cstop) @@ -650,7 +648,7 @@ cdef class Hashgraph(Hashtable): return ppi - + def assign_partition_id(self, PrePartitionInfo ppi): '''Assign a partition ID to a given tag.''' cdef cp_pre_partition_info * cppi = ppi._this.get() @@ -658,7 +656,7 @@ cdef class Hashgraph(Hashtable): pi = deref(deref(self._hg_this).partition).assign_partition_id(deref(cppi).kmer, deref(cppi).tagged_kmers) return pi - + def output_partitions(self, str filename, str output, bool output_unassigned=False): '''Write out sequences in given filename to another file, annotating ''' @@ -668,7 +666,7 @@ cdef class Hashgraph(Hashtable): _bstring(output), output_unassigned) return n_partitions - + def load_partitionmap(self, str filename): '''Load a partitionmap for the master subset.''' deref(deref(self._hg_this).partition).load_partitionmap(_bstring(filename)) @@ -676,24 +674,11 @@ cdef class Hashgraph(Hashtable): def save_partitionmap(self, str filename): '''Save a partitionmap for the master subset.''' deref(deref(self._hg_this).partition).save_partitionmap(_bstring(filename)) - + def _validate_partitionmap(self): '''Run internal validation checks.''' deref(deref(self._hg_this).partition)._validate_pmap() - - def consume_seqfile_and_tag_with_reads_parser(self, object read_parser): - '''Count all k-mers using the given reads parser''' - cdef unsigned long long n_consumed = 0 - cdef unsigned int total_reads = 0 - cdef CPyReadParser_Object * parser_o = read_parser - cdef FastxParserPtr parser = parser_o.parser - cdef CpHashgraph * ptr = self._hg_this.get() - deref(ptr).consume_seqfile_and_tag_readparser[CpFastxReader](parser, - total_reads, - n_consumed) - return total_reads, n_consumed - def consume_partitioned_fasta(self, filename): '''Count all k-mers in a given file''' cdef unsigned long long n_consumed = 0 @@ -703,7 +688,7 @@ cdef class Hashgraph(Hashtable): total_reads, n_consumed) return total_reads, n_consumed - + def merge_subset(self, SubsetPartition subset): '''Merge the given subset into this one.''' deref(deref(self._hg_this).partition).merge(subset._this.get()) @@ -711,11 +696,11 @@ cdef class Hashgraph(Hashtable): def merge_subset_from_disk(self, str filename): '''Merge the given subset (filename) into this one.''' deref(deref(self._hg_this).partition).merge_from_disk(_bstring(filename)) - + def count_partitions(self): '''Count the number of partitions in the master partitionmap.''' return self.partition.count_partitions() - + def set_partition_id(self, object kmer, PartitionID pid): '''Set the partition ID for this tag.''' cdef string start = self.sanitize_kmer(kmer) @@ -729,7 +714,7 @@ cdef class Hashgraph(Hashtable): '''Get the partition ID of this tag.''' cdef string _kmer = self.sanitize_kmer(kmer) return deref(deref(self._hg_this).partition).get_partition_id(_kmer) - + def repartition_largest_partition(self, Countgraph counts not None, unsigned int distance, unsigned int threshold, @@ -754,7 +739,7 @@ cdef class Hashgraph(Hashtable): def load_stop_tags(self, object filename, clear_tags=False): '''Load the set of stop tags.''' deref(self._hg_this).load_stop_tags(_bstring(filename), clear_tags) - + def save_stop_tags(self, object filename): '''Save the set of stop tags.''' deref(self._hg_this).save_stop_tags(_bstring(filename)) @@ -762,7 +747,7 @@ cdef class Hashgraph(Hashtable): def print_stop_tags(self, filename): '''Print out the set of stop tags.''' deref(self._hg_this).print_stop_tags(_bstring(filename)) - + def trim_on_stoptags(self, str sequence): '''Trim the reads on the given stop tags.''' cdef size_t trim_at @@ -776,7 +761,7 @@ cdef class Hashgraph(Hashtable): '''Add this k-mer as a stop tag.''' cdef HashIntoType _kmer = self.sanitize_hash_kmer(kmer) deref(self._hg_this).add_stop_tag(_kmer) - + def get_stop_tags(self): '''Return a DNA list of all of the stop tags.''' cdef HashIntoType st diff --git a/khmer/_oxli/utils.pyx b/khmer/_oxli/utils.pyx index 49d43996f4..3fcb553df3 100644 --- a/khmer/_oxli/utils.pyx +++ b/khmer/_oxli/utils.pyx @@ -14,12 +14,13 @@ def get_n_primes_near_x(n_primes, x): if len(primes) != n_primes: msg = "unable to find {0} prime numbers < {1}".format(n_primes, x) raise RuntimeError(msg) - return primes + return primes cdef bytes _bstring(s): if not isinstance(s, (basestring, bytes)): - raise TypeError("Requires a string-like sequence") + raise TypeError("Requires a string-like sequence, "\ + " got {0} of type {1}".format(s, type(s))) if isinstance(s, unicode): s = s.encode('utf-8') @@ -30,9 +31,6 @@ cdef unicode _ustring(s): if type(s) is unicode: # fast path for most common case(s) return s - elif PY_MAJOR_VERSION < 3 and isinstance(s, bytes): - # only accept byte strings in Python 2.x, not in Py3 - return (s).decode('UTF-8') elif isinstance(s, unicode): # an evil cast to might work here in some(!) cases, # depending on what the further processing does. to be safe, @@ -58,5 +56,3 @@ cdef void _fill(double * fill_to, object fill_from): '''UNSAFE fill from flat python iterable to C array.''' for idx, item in enumerate(fill_from): fill_to[idx] = item - - diff --git a/oxli/functions.py b/oxli/functions.py index b252c53fae..c79c475f83 100755 --- a/oxli/functions.py +++ b/oxli/functions.py @@ -49,9 +49,9 @@ def build_graph(ifilenames, graph, num_threads=1, tags=False): - tags: should there be tags """ if tags: - eat = graph.consume_seqfile_and_tag_with_reads_parser + eat = graph.consume_seqfile_and_tag else: - eat = graph.consume_seqfile_with_reads_parser + eat = graph.consume_seqfile for _, ifile in enumerate(ifilenames): rparser = khmer.ReadParser(ifile) diff --git a/sandbox/count-kmers-single.py b/sandbox/count-kmers-single.py index fd8aaf5b3d..ae895dd289 100755 --- a/sandbox/count-kmers-single.py +++ b/sandbox/count-kmers-single.py @@ -102,7 +102,7 @@ def main(): for _ in range(args.threads): thread = \ threading.Thread( - target=countgraph.consume_seqfile_with_reads_parser, + target=countgraph.consume_seqfile, args=(rparser, ) ) threads.append(thread) diff --git a/sandbox/optimal_args_hashbits.py b/sandbox/optimal_args_hashbits.py index 34fbf5a223..5969337053 100755 --- a/sandbox/optimal_args_hashbits.py +++ b/sandbox/optimal_args_hashbits.py @@ -80,7 +80,7 @@ def main(): file=sys.stderr) htable = khmer.new_nodegraph(args.ksize, args.max_tablesize, args.n_tables) - target_method = htable.consume_seqfile_with_reads_parser + target_method = htable.consume_seqfile for _, filename in enumerate(filenames): rparser = khmer.ReadParser(filename) diff --git a/scripts/abundance-dist-single.py b/scripts/abundance-dist-single.py index 01ad2a6648..7fcf580276 100755 --- a/scripts/abundance-dist-single.py +++ b/scripts/abundance-dist-single.py @@ -147,7 +147,7 @@ def main(): # pylint: disable=too-many-locals,too-many-branches for _ in range(args.threads): thread = \ threading.Thread( - target=countgraph.consume_seqfile_with_reads_parser, + target=countgraph.consume_seqfile, args=(rparser, ) ) threads.append(thread) @@ -162,7 +162,7 @@ def main(): # pylint: disable=too-many-locals,too-many-branches abundance_lists = [] def __do_abundance_dist__(read_parser): - abundances = countgraph.abundance_distribution_with_reads_parser( + abundances = countgraph.abundance_distribution( read_parser, tracking) abundance_lists.append(abundances) diff --git a/scripts/filter-abund-single.py b/scripts/filter-abund-single.py index 6d810df03a..3edcef86ec 100755 --- a/scripts/filter-abund-single.py +++ b/scripts/filter-abund-single.py @@ -140,7 +140,7 @@ def main(): for _ in range(args.threads): cur_thread = \ threading.Thread( - target=graph.consume_seqfile_with_reads_parser, + target=graph.consume_seqfile, args=(rparser, ) ) threads.append(cur_thread) diff --git a/scripts/load-into-counting.py b/scripts/load-into-counting.py index 6e797232a8..963a4dc030 100755 --- a/scripts/load-into-counting.py +++ b/scripts/load-into-counting.py @@ -148,7 +148,7 @@ def main(): for _ in range(args.threads): cur_thrd = \ threading.Thread( - target=countgraph.consume_seqfile_with_reads_parser, + target=countgraph.consume_seqfile, args=(rparser, ) ) threads.append(cur_thrd) diff --git a/tests/test_countgraph.py b/tests/test_countgraph.py index 6b2a9e93d2..23134def1a 100755 --- a/tests/test_countgraph.py +++ b/tests/test_countgraph.py @@ -1186,16 +1186,16 @@ def test_consume_absentfasta(): print(str(err)) -def test_consume_absentfasta_with_reads_parser(): +def test_consume_absentfasta(): countgraph = khmer.Countgraph(4, 4 ** 4, 4) try: - countgraph.consume_seqfile_with_reads_parser() + countgraph.consume_seqfile() assert 0, "this should fail" except TypeError as err: print(str(err)) try: readparser = ReadParser(utils.get_test_data('empty-file')) - countgraph.consume_seqfile_with_reads_parser(readparser) + countgraph.consume_seqfile(readparser) assert 0, "this should fail" except OSError as err: print(str(err)) diff --git a/tests/test_nodegraph.py b/tests/test_nodegraph.py index 5cd788f49d..521408a992 100755 --- a/tests/test_nodegraph.py +++ b/tests/test_nodegraph.py @@ -905,16 +905,16 @@ def test_bad_primes_list(): print(str(e)) -def test_consume_absentfasta_with_reads_parser(): +def test_consume_absentfasta(): nodegraph = khmer.Nodegraph(31, 1, 1) try: - nodegraph.consume_seqfile_with_reads_parser() + nodegraph.consume_seqfile() assert 0, "this should fail" except TypeError as err: print(str(err)) try: readparser = ReadParser(utils.get_test_data('empty-file')) - nodegraph.consume_seqfile_with_reads_parser(readparser) + nodegraph.consume_seqfile(readparser) assert 0, "this should fail" except OSError as err: print(str(err)) @@ -934,7 +934,7 @@ def test_consume_seqfile_and_tag_with_badreads_parser(): nodegraph = khmer.Nodegraph(6, 1e6, 2) try: readsparser = khmer.ReadParser(utils.get_test_data("test-empty.fa")) - nodegraph.consume_seqfile_and_tag_with_reads_parser(readsparser) + nodegraph.consume_seqfile_and_tag(readsparser) assert 0, "this should fail" except OSError as e: print(str(e)) diff --git a/tests/test_tabletype.py b/tests/test_tabletype.py index d67635d516..37d75c21e9 100755 --- a/tests/test_tabletype.py +++ b/tests/test_tabletype.py @@ -376,7 +376,7 @@ def test_consume_seqfile_reads_parser(AnyTabletype): kh = AnyTabletype(5) rparser = ReadParser(utils.get_test_data('test-fastq-reads.fq')) - kh.consume_seqfile_with_reads_parser(rparser) + kh.consume_seqfile(rparser) kh2 = AnyTabletype(5) for record in screed.open(utils.get_test_data('test-fastq-reads.fq')): @@ -460,7 +460,7 @@ def test_abund_dist_A_readparser(AnyTabletype): tracking = Nodegraph(4, 1, 1, primes=PRIMES_1m) kh.consume_seqfile(A_filename) - dist = kh.abundance_distribution_with_reads_parser(rparser, tracking) + dist = kh.abundance_distribution(rparser, tracking) print(dist[:10]) assert sum(dist) == 1