FormattedFile::readRecord is slow with std::string
@temehi is already working on this.
Since Nov 9, 2015.
Assessment
This issue has not been assessed yet.
Description
stream/tokenization.h:311 Assertion failed : optr < ochunk.end should be true but was 0
Here's a minimal test case:
(env)mcrusoe@athyra:~/khmer/gl-master$ g++ -I/home/mcrusoe/src/seqan/seqan-1.4.2/core/include/ seqan-std-string-test-1.4.cc -o seqan-std-string-test-1.4 -g
(env)mcrusoe@athyra:~/khmer/gl-master$ g++ -I/home/mcrusoe/src/seqan/seqan-seqan-v2.0.0/include/ seqan-std-string-test-2.0.cc -o seqan-std-string-test-2.0 -g
(env)mcrusoe@athyra:~/khmer/gl-master$ ./seqan-std-string-test-1.4 tests/test-data/random-20-a.fa | head
35 CGCAGGCTGGATTCTAGAGGCAGAGGTGAGCTATAAGATATTGCATACGTTGAGCCAGC
16 CGGAAGCCCAATGAGTTGTCAGAGTCACCTCCACCCCGGGCCCTGTTAGCTACGTCCGT
46 GGTCGTGTTGGGTTAACAAAGGATCCCTGACTCGATCCAGCTGGGTAGGGTAACTATGT
40 GGCTGAAGGAGCGGGCGTACGTGTTTACGGCATGATGGCCGGTGATTATGGGGGACGGG
33 GCAGCGGCTTTGAATGCCGAATATATAACAGCGACGGGGTTCAATAAGCTGCACATGCG
98 ACCAGATGCATAGCCCAACAGCTGAGACATTCCCAGCTCGCGAACCAAGACGTGAGAGC
17 CCCTGTTAGCTACGTCCGTCTAAGGATATTAACATAGTTGCGACTGCGTCCTGTGCTCA
89 GCGAGATACTAGCAAAGGTTCATCAACAGCTACACCCGACGAACCCCGAGAAATTGGGA
30 GTTATGGTCCAGGATGAATGCGCGTACCGGGCGCCTATCACTCCTCTTGTCATTCAGAA
82 ATGCACTATATTTAAGAGGTCTAGAGTGTAAAAAGTGTACCCTTCGGGGTGGAGCTGTT
(env)mcrusoe@athyra:~/khmer/gl-master$ ./seqan-std-string-test-2.0 tests/test-data/random-20-a.fa
/home/mcrusoe/src/seqan/seqan-seqan-v2.0.0/include/seqan/stream/tokenization.h:311 Assertion failed : optr < ochunk.end should be true but was 0
Aborted (core dumped)
Seqan 1.4 version:
#include <seqan/seq_io.h>
int main(int argc, char const ** argv) {
seqan::SequenceStream _stream;
seqan::open(_stream, argv[1]);
std::string name;
std::string sequence;
std::string quality;
while (!seqan::atEnd(_stream)) {
seqan::readRecord(name, sequence, quality, _stream);
std::cout << name << '\t' << sequence << '\t' << quality << '\n';
}
}
Seqan 2.0 version
#include <seqan/seq_io.h>
int main(int argc, char const ** argv) {
seqan::SeqFileIn _file;
seqan::open(_file, argv[1]);
std::string name;
std::string sequence;
std::string quality;
//seqan::readRecord(name, sequence, _file);
while (!seqan::atEnd(_file)) {
seqan::readRecord(name, sequence, quality, _file);
std::cout << name << '\t' << sequence << '\t' << quality << '\n';
}
}
(I ran into this by implementing the Seqan 2.0 changes as recommended by @esiragusa in https://github.com/esiragusa/khmer/commit/66f8c688d74acf06362dc91c35953f6c460c5bba )
- Dominant language
- C++
- Stars
- 502
- Forks
- 172
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from seqan/seqan
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Sensor initialization takes very long when `--initial-sim-time` is set to current UNIX timestamp Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gazebosim/gz-sensors#662 · 1 comment ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
LadybirdBrowser/ladybird#12123 ·