#include <multipath_alignment_emitter.hpp>
|
| MultipathAlignmentEmitter (const string &filename, size_t num_threads, const string out_format="GAMP", const PathPositionHandleGraph *graph=nullptr, const vector< pair< string, int64_t >> *path_order_and_length=nullptr) |
|
| ~MultipathAlignmentEmitter () |
|
void | set_read_group (const string &read_group) |
| Choose a read group to apply to all emitted alignments. More...
|
|
void | set_sample_name (const string &sample_name) |
| Choose a sample name to apply to all emitted alignments. More...
|
|
void | set_min_splice_length (int64_t min_splice_length) |
|
void | emit_pairs (const string &name_1, const string &name_2, vector< pair< multipath_alignment_t, multipath_alignment_t >> &&mp_aln_pairs, vector< pair< tuple< string, bool, int64_t >, tuple< string, bool, int64_t >>> *path_positions=nullptr, vector< int64_t > *tlen_limits=nullptr) |
| Emit paired read mappings as interleaved protobuf messages. More...
|
|
void | emit_singles (const string &name, vector< multipath_alignment_t > &&mp_alns, vector< tuple< string, bool, int64_t >> *path_positions=nullptr) |
| Emit read mappings as protobuf messages. More...
|
|
| HTSWriter (const string &filename, const string &format, const vector< pair< string, int64_t >> &path_order_and_length, const unordered_map< string, int64_t > &subpath_to_length, size_t max_threads) |
|
| ~HTSWriter () |
| Tear down an HTSWriter and destroy HTSlib structures. More...
|
|
| HTSWriter (const HTSWriter &other)=delete |
|
HTSWriter & | operator= (const HTSWriter &other)=delete |
|
| HTSWriter (HTSWriter &&other)=delete |
|
HTSWriter & | operator= (HTSWriter &&other)=delete |
|
|
void | convert_to_alignment (const multipath_alignment_t &mp_aln, Alignment &aln, const string *prev_name=nullptr, const string *next_name=nullptr) const |
| make a GAM alignment from a multipath alignment More...
|
|
void | create_alignment_shim (const string &name, const multipath_alignment_t &mp_aln, Alignment &shim, const string *prev_name=nullptr, const string *next_name=nullptr) const |
| store the data in an Algnment that is used in the conversion to bam1_t More...
|
|
void | convert_to_hts_unpaired (const string &name, const multipath_alignment_t &mp_aln, const string &ref_name, bool ref_rev, int64_t ref_pos, bam_hdr_t *header, vector< bam1_t * > &dest) const |
| store a bam1_t object with the indicated data in the dest vector More...
|
|
void | convert_to_hts_paired (const string &name_1, const string &name_2, const multipath_alignment_t &mp_aln_1, const multipath_alignment_t &mp_aln_2, const string &ref_name_1, bool ref_rev_1, int64_t ref_pos_1, const string &ref_name_2, bool ref_rev_2, int64_t ref_pos_2, int64_t tlen_limit, bam_hdr_t *header, vector< bam1_t * > &dest) const |
| store two paired bam1_t objects with the indicated data in the dest vector More...
|
|
void | add_annotations (const multipath_alignment_t &mp_aln, bam1_t *bam) const |
| transfer the allelic mapq, group mapq, and secondary annotations to a BAM record More...
|
|
|
void | save_records (bam_hdr_t *header, vector< bam1_t * > &records, size_t thread_number) |
|
bam_hdr_t * | ensure_header (const string &read_group, const string &sample_name, size_t thread_number) |
|
void | initialize_sam_file (bam_hdr_t *header, size_t thread_number, bool keep_header=false) |
|
unique_ptr< ofstream > | out_file |
| If we are doing output to a file, this will hold the open file. Otherwise (for stdout) it will be empty. More...
|
|
vg::io::StreamMultiplexer | multiplexer |
|
string | format |
| This holds our format name, for later error messages. More...
|
|
vector< pair< string, int64_t > > | path_order_and_length |
| Store the path names and lengths in the order to put them in the header. More...
|
|
unordered_map< string, int64_t > | subpath_to_length |
|
vector< hFILE * > | backing_files |
|
vector< samFile * > | sam_files |
|
atomic< bam_hdr_t * > | atomic_header |
| We need a header. More...
|
|
string | sam_header |
|
mutex | header_mutex |
| If the header isn't present when we want to write, we need a mutex to control creating it. More...
|
|
bool | output_is_bgzf |
|
string | hts_mode |
| Remember the HTSlib mode string we need to open our files. More...
|
|
static const size_t | BGZF_FOOTER_LENGTH = 28 |
| We hack about with htslib's BGZF EOF footers, so we need to know how long they are. More...
|
|
◆ output_format_t
what format are we outputting in
Enumerator |
---|
GAMP | |
GAM | |
GAF | |
BAM | |
SAM | |
CRAM | |
◆ MultipathAlignmentEmitter()
vg::MultipathAlignmentEmitter::MultipathAlignmentEmitter |
( |
const string & |
filename, |
|
|
size_t |
num_threads, |
|
|
const string |
out_format = "GAMP" , |
|
|
const PathPositionHandleGraph * |
graph = nullptr , |
|
|
const vector< pair< string, int64_t >> * |
path_order_and_length = nullptr |
|
) |
| |
Initialize with the intended output stream and the maximum number of threads that will be outputting. Allowed formats:
- "GAMP"
- "GAM", involves conversion to single path
- "GAF", involves conversion to single path, requires a graph
- "SAM", "BAM", "CRAM:" requires path length map, and all input alignments must already be surjected. If alignments have connections, requires a graph
◆ ~MultipathAlignmentEmitter()
vg::MultipathAlignmentEmitter::~MultipathAlignmentEmitter |
( |
| ) |
|
◆ add_annotations()
void vg::MultipathAlignmentEmitter::add_annotations |
( |
const multipath_alignment_t & |
mp_aln, |
|
|
bam1_t * |
bam |
|
) |
| const |
|
private |
transfer the allelic mapq, group mapq, and secondary annotations to a BAM record
◆ convert_to_alignment()
void vg::MultipathAlignmentEmitter::convert_to_alignment |
( |
const multipath_alignment_t & |
mp_aln, |
|
|
Alignment & |
aln, |
|
|
const string * |
prev_name = nullptr , |
|
|
const string * |
next_name = nullptr |
|
) |
| const |
|
private |
make a GAM alignment from a multipath alignment
◆ convert_to_hts_paired()
void vg::MultipathAlignmentEmitter::convert_to_hts_paired |
( |
const string & |
name_1, |
|
|
const string & |
name_2, |
|
|
const multipath_alignment_t & |
mp_aln_1, |
|
|
const multipath_alignment_t & |
mp_aln_2, |
|
|
const string & |
ref_name_1, |
|
|
bool |
ref_rev_1, |
|
|
int64_t |
ref_pos_1, |
|
|
const string & |
ref_name_2, |
|
|
bool |
ref_rev_2, |
|
|
int64_t |
ref_pos_2, |
|
|
int64_t |
tlen_limit, |
|
|
bam_hdr_t * |
header, |
|
|
vector< bam1_t * > & |
dest |
|
) |
| const |
|
private |
store two paired bam1_t objects with the indicated data in the dest vector
◆ convert_to_hts_unpaired()
void vg::MultipathAlignmentEmitter::convert_to_hts_unpaired |
( |
const string & |
name, |
|
|
const multipath_alignment_t & |
mp_aln, |
|
|
const string & |
ref_name, |
|
|
bool |
ref_rev, |
|
|
int64_t |
ref_pos, |
|
|
bam_hdr_t * |
header, |
|
|
vector< bam1_t * > & |
dest |
|
) |
| const |
|
private |
store a bam1_t object with the indicated data in the dest vector
◆ create_alignment_shim()
void vg::MultipathAlignmentEmitter::create_alignment_shim |
( |
const string & |
name, |
|
|
const multipath_alignment_t & |
mp_aln, |
|
|
Alignment & |
shim, |
|
|
const string * |
prev_name = nullptr , |
|
|
const string * |
next_name = nullptr |
|
) |
| const |
|
private |
store the data in an Algnment that is used in the conversion to bam1_t
◆ emit_pairs()
void vg::MultipathAlignmentEmitter::emit_pairs |
( |
const string & |
name_1, |
|
|
const string & |
name_2, |
|
|
vector< pair< multipath_alignment_t, multipath_alignment_t >> && |
mp_aln_pairs, |
|
|
vector< pair< tuple< string, bool, int64_t >, tuple< string, bool, int64_t >>> * |
path_positions = nullptr , |
|
|
vector< int64_t > * |
tlen_limits = nullptr |
|
) |
| |
Emit paired read mappings as interleaved protobuf messages.
◆ emit_singles()
void vg::MultipathAlignmentEmitter::emit_singles |
( |
const string & |
name, |
|
|
vector< multipath_alignment_t > && |
mp_alns, |
|
|
vector< tuple< string, bool, int64_t >> * |
path_positions = nullptr |
|
) |
| |
Emit read mappings as protobuf messages.
◆ set_min_splice_length()
void vg::MultipathAlignmentEmitter::set_min_splice_length |
( |
int64_t |
min_splice_length | ) |
|
Set the length deletion (at a node boundary) that will be considered an unaligned splicing event in HTSLib output
◆ set_read_group()
void vg::MultipathAlignmentEmitter::set_read_group |
( |
const string & |
read_group | ) |
|
Choose a read group to apply to all emitted alignments.
◆ set_sample_name()
void vg::MultipathAlignmentEmitter::set_sample_name |
( |
const string & |
sample_name | ) |
|
Choose a sample name to apply to all emitted alignments.
◆ aln_emitters
◆ format
◆ graph
◆ min_splice_length
int64_t vg::MultipathAlignmentEmitter::min_splice_length = numeric_limits<int64_t>::max() |
|
private |
the shortest deletion that we will interpret as a splice in the CIGAR string of HTS output
◆ mp_aln_emitters
◆ read_group
string vg::MultipathAlignmentEmitter::read_group |
|
private |
read group applied to alignments
◆ sample_name
string vg::MultipathAlignmentEmitter::sample_name |
|
private |
sample name applied to alignments
The documentation for this class was generated from the following files: