Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
63 lines (47 sloc) 1.62 KB
#include <fstream>
#include <iostream>
#include <string>
#include <cstring>
#include "minimap2/minimap.h"
#include "wrappers/mm_reader.h"
#include "wrappers/mm_buffer.h"
#include "wrappers/mm_alignments.h"
#include "sequences.h"
int main(int argc, char *argv[])
{
mm_idxopt_t iopt; // indexing options
mm_mapopt_t mopt; // mapping options
int n_threads = 2;
mm_verbose = 2; // disable message output to stderr
mm_set_opt("ava-pb", &iopt, &mopt);
size_t numSequences = 10;
Sequences sequences(argv[1], numSequences);
// options for an index
int window_size = 5;
int kmer_size = 19;
bool is_hpc = true;
int bucket_bits = 14;
int numSeq = (int)numSequences;
mm_idx_t *mm_index = mm_idx_str(window_size, kmer_size, is_hpc, bucket_bits, numSeq,
sequences.getSequences(), sequences.getSeqNames());
Index index;
index.reset(mm_index);
QueryFileReader queryFileReader(argv[2]);
size_t numQuerySeq = 10;
Buffer buffer;
Alignments alignments;
// read sequences from file and align each sequence to index
for (size_t i = 0; i < numQuerySeq; ++i)
{
queryFileReader.readSeq();
mm_reg1_t *mm_alignments;
int numOfAlignments;
mm_alignments = mm_map(index.get(),
queryFileReader.currentSeqLength(),
queryFileReader.currentSequence(),
&numOfAlignments, buffer.get(), &mopt, 0);
alignments.reset(mm_alignments, numOfAlignments);
alignments.printAll(queryFileReader, index);
}
return 0;
}
You can’t perform that action at this time.