cartoonist / kseqpp Goto Github PK
View Code? Open in Web Editor NEWFast FASTA/Q parser and writer (C++ re-implementation of kseq library)
License: MIT License
Fast FASTA/Q parser and writer (C++ re-implementation of kseq library)
License: MIT License
When compiling the code containing kseq++ it keeps complaining about the ZLIB:
undefined reference to `gzopen'
undefined reference to `gzread'
Although the ZLIB is being interfaced in the CMAKE configurations of kseq++, the following lines were necessary to be added to the project's CMakeLists.txt to force linking ZLIB:
find_package(ZLIB)
target_link_libraries(_target_ ZLIB::ZLIB)
Hi, I want to make a map of {int -> SeqStreamOut}, for output reads to different files according to the int key. but the compiler says that "no matching constructor for initialization of SeqStreamOut", any could help me? Thank you
When writing a FASTQ file using this library, I find a newline is added into sequence line and quality line by default. My output result is like this:
@name
AGAAAGCTTCATGTTTCAATTGGCCAAAGAATAAGGTAGAGTACGGTAGAAAATAGAGTG
AGCGAACAAA
+
222222222222222222222222222222222222222222222222222222222222
2222222222
Is there any way to avoid the newline?
kseqpp/include/kseq++/kseq++.hpp
Line 291 in 558de30
Library installation instructions would be greatly appreciated!
Upon trying to install the library using cmake... The following results:
-- The CXX compiler identification is GNU 8.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.7")
-- Found BZip2: /usr/lib64/libbz2.so (found version "1.0.6")
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
CMake Error at CMakeLists.txt:17 (add_library):
add_library INTERFACE library requires no source arguments.
CMake Error at CMakeLists.txt:19 (target_sources):
Cannot specify sources for target "kseq++" which is not built by this
project.
CMake Error at CMakeLists.txt:21 (target_include_directories):
Cannot specify include directories for target "kseq++" which is not built
by this project.
CMake Error at CMakeLists.txt:28 (target_link_libraries):
Cannot specify link libraries for target "kseq++" which is not built by
this project.
-- Configuring incomplete, errors occurred!
Suggested in #2, there should be a section in the README file explaining how to install the library and alternatively how to bundle it in the source tree without installation (i.e. as a git submodule).
this is a great minimal library, thanks!
it would be nice have std::thread as an ifdef option.
these are my changes, not tested yet.
line 29
#ifdef KSEQPP_THREADS
#include <thread>
#endif
line 100
#ifdef KSEQPP_THREADS
std::thread worker; /**< @brief worker thread */
#endif
line 430
inline void
worker_join( )
{
#ifdef KSEQPP_THREADS
this->async_write( true );
if ( this->worker.joinable() ) this->worker.join();
#else
this->async_write( false );
#endif
}
inline void
worker_start( )
{
#ifdef KSEQPP_THREADS
this->worker = std::thread( &KStream::writer, this );
#else
this->writer();
#endif
}
This library implements both reading and writing of FASTQ files. I wonder is it faster than just using std::iostream ?
After doing some adapter trimming on a read I wound up with an empty sequence (and corresponding empty qualities). When I write that out instead of four lines (two of them blank) I get only two lines (name line and one blank line). And the name line starts with a greater-than sign (>) instead of an at-sign (@). Setting the wraplen to larger values (I tried 1000 and 10000) had no effect.
Code sample follows:
// g++ -Wall -Wextra -O3 -std=c++14 -I /path/to/kseqpp/src emptySeq.cpp -o emptySeq -lz -pthread
#include <iostream>
#include <seqio.h>
int main()
{
klibpp::SeqStreamOut out("/dev/stdout");
klibpp::KSeq s;
s.name = "should start with an at-sign";
s.seq = "";
s.qual = "";
out << s;
return 0;
}
I also tried opening /dev/tty, /dev/stderr and a file on disk. Same output.
If I set the seq/qual to even a single character it behaves fine.
Using g++ 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609 on Ubuntu 16.04.6 LTS.
When decompressing a file that has been compressed with gzip, kseqpp relies on zlib for decompression. However, there is a library called libdeflate which offers faster decompression speed compared to zlib. Perhaps using libdeflate could result in improved performance?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.