Introduction¶
IVio, pronounced for you aka io4. A c++20 library for bioinformatics. Providing functions for reading and writing different file formats.
Support¶
A list of currently supported file types:
read support | write support | |
---|---|---|
fasta | ✔ | ✔ |
fasta+gzip | ✔ | ✔ |
indexed fasta | ✔ | ✘ |
fastq | ✔ | ✘ |
fastq+gzip | ✔ | ✘ |
vcf | ✔ | ✔ |
bcf | ✔ | ✘ |
sam | ✔ | ✔ |
bam | ✔ | ✘ |
Basic concepts¶
Each file type consist of different parts. Here we discuss it for the fasta format.
fasta::reader
fasta::writer
fasta::record
fasta::record_view
Integration CMake via CPM¶
Easiest way is using CPM by adding to your CMakeLists.txt
CPMAddPackage("gh:SGSSGene/iv-project/IVio@1.0.0")
#...
target_link_libraries(your_lib_or_exec PUBLIC ivio::ivio)
Thats it.
Integration CMake via subdirectory¶
Another way to use this repository is to clone this as a sub-repo into your project, for example to
lib/IVio
, and then edit your CMakeLists.txt
:
find_package (ivio REQUIRED PATHS lib/IVio)
# ...
target_link_libraries(your_project ivio::ivio)
You can now happily use IVio
Example Code¶
Reading a fasta file:
#include <ivio/ivio.h>
int main() {
auto reader = ivio::fasta::reader{{"somedata.fasta"}};
for (auto record_view : reader) {
std::cout << "id: " << record_view.id << "\n";
std::cout << "seq: " << record_view.seq << "\n";
}
}