eXpress “1.5”

MapParser Class Reference

The MapParser class is meant to be run as a separate thread from the main processing. More...

#include <mapparser.h>

List of all members.

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.

Detailed Description

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.

Author:
Adam Roberts
Date:
2011 Artistic License 2.0

Definition at line 308 of file mapparser.h.


Constructor & Destructor Documentation

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).

Parameters:
libpointer to variables associated with the input, including file path.
write_activebool to initialize _write_active.

Definition at line 96 of file mapparser.cpp.


Member Function Documentation

const TransIndex& MapParser::targ_index ( ) [inline]

An accessor for the target name to index map.

Returns a reference that does not outlive this.

Returns:
Reference to the target-to-index map.

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.

Returns:
Reference to the target-to-length map.

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.

Parameters:
thread_safetya pointer to the struct containing shared queues with the processing thread.
stop_ata size_t indicating how many reads to process before stopping (disabled if 0, default).
num_neighborsexperimental.

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.

Parameters:
bupdated write-active status

Definition at line 371 of file mapparser.h.


The documentation for this class was generated from the following files:
 All Classes Functions Variables