eXpress “1.5”
|
The MapParser class is meant to be run as a separate thread from the main processing. More...
#include <mapparser.h>
Public Member Functions | |
MapParser (Library *lib, bool write_active) | |
MapParser constructor determines what format the input is in and initializes the correct parser and writer (if appropriate). | |
void | threaded_parse (ParseThreadSafety *thread_safety, size_t stop_at=0, size_t num_neighbors=0) |
A member function that drives the parse thread. | |
const TransIndex & | targ_index () |
An accessor for the target name to index map. | |
const TransIndex & | targ_lengths () |
An accessor for the target-to-length map. | |
void | write_active (bool b) |
A mutator for the write-active status of the parser. | |
void | reset_reader () |
A member function that resets the input parser. |
The MapParser class is meant to be run as a separate thread from the main processing.
Once started, this thread will read input from a file or stream in SAM/BAM format, parse, and collect read alignments into fragment alignments, and fragment alignments into fragments, which are placed on a buffer for the processing thread. Once the processing thread copies the fragment address from the buffer, the parser is unlocked to load the next fragment. The process stops when EOF is reached.
Definition at line 308 of file mapparser.h.
MapParser::MapParser | ( | Library * | lib, |
bool | write_active | ||
) |
MapParser constructor determines what format the input is in and initializes the correct parser and writer (if appropriate).
lib | pointer to variables associated with the input, including file path. |
write_active | bool to initialize _write_active. |
Definition at line 96 of file mapparser.cpp.
const TransIndex& MapParser::targ_index | ( | ) | [inline] |
An accessor for the target name to index map.
Returns a reference that does not outlive this.
Definition at line 359 of file mapparser.h.
const TransIndex& MapParser::targ_lengths | ( | ) | [inline] |
An accessor for the target-to-length map.
Returns a reference that does not outlive this.
Definition at line 365 of file mapparser.h.
void MapParser::threaded_parse | ( | ParseThreadSafety * | thread_safety, |
size_t | stop_at = 0 , |
||
size_t | num_neighbors = 0 |
||
) |
A member function that drives the parse thread.
When all valid mappings of a fragment have been parsed, its mapped targets are found and the information is passed in a Fragment object to the processing thread through a queue in the ParseThreadSafety struct. After processing, the Fragment returns on a different in queue, and is written to the output map file (depending on settings) and deleted.
thread_safety | a pointer to the struct containing shared queues with the processing thread. |
stop_at | a size_t indicating how many reads to process before stopping (disabled if 0, default). |
num_neighbors | experimental. |
Definition at line 149 of file mapparser.cpp.
void MapParser::write_active | ( | bool | b | ) | [inline] |
A mutator for the write-active status of the parser.
This specifies whether or not the alignments (sampled or with probs) should be ouptut.
b | updated write-active status |
Definition at line 371 of file mapparser.h.