|
| VariantHeaderMerger () |
| empty constructor, initialize 'large' LUTs More...
|
|
| VariantHeaderMerger (const std::shared_ptr< bcf_hdr_t > &input_vcf_header) |
| Constructor with a single input VCF header as input. More...
|
|
| VariantHeaderMerger (const VariantHeader &input_vcf_header) |
| Constructor with a single input VCF header as input. More...
|
|
| VariantHeaderMerger (const std::vector< std::shared_ptr< bcf_hdr_t >> &input_vcf_headers) |
| Constructor with a vector of input VCF headers to be merged. More...
|
|
| VariantHeaderMerger (const std::vector< VariantHeader > &input_vcf_headers) |
| Constructor with a vector of input VCF headers to be merged. More...
|
|
| VariantHeaderMerger (const VariantHeaderMerger &)=delete |
|
VariantHeaderMerger & | operator= (const VariantHeaderMerger &)=delete |
|
| VariantHeaderMerger (VariantHeaderMerger &&)=default |
|
VariantHeaderMerger & | operator= (VariantHeaderMerger &&)=default |
|
| ~VariantHeaderMerger ()=default |
|
void | reset () |
| : resets all mappings, but does not de-allocate LUT memory More...
|
|
void | clear () |
| : resets all mappings, de-allocates LUT memory More...
|
|
void | add_header (const std::shared_ptr< bcf_hdr_t > &hdr) |
| add a new header into the merged header and update LUTs More...
|
|
void | add_header (const VariantHeader &hdr) |
| add a new header into the merged header and update LUTs More...
|
|
void | add_headers (const std::vector< std::shared_ptr< bcf_hdr_t >> &headers) |
| add a vector of new VCF headers into the merged header and update LUTs More...
|
|
void | add_headers (const std::vector< VariantHeader > &headers) |
| add a vector of new VCF headers into the merged header and update LUTs More...
|
|
const std::shared_ptr
< bcf_hdr_t > & | get_raw_merged_header () const |
| Get merged VCF header shared_ptr. More...
|
|
const VariantHeader | get_merged_header () const |
| Get merged VCF header. More...
|
|
int | get_merged_sample_idx_for_input (unsigned inputGVCFIdx, int inputSampleIdx) const |
| Get sample idx for the merged VCF corresponding to sample idx inputSampleIdx in the input VCF of index inputGVCFIdx. More...
|
|
int | get_merged_header_idx_for_input (unsigned inputGVCFIdx, int inputIdx) const |
| Get header field (FLT/FMT/INFO) idx for the merged VCF corresponding to field idx inputIdx in the input VCF of index inputGVCFIdx. More...
|
|
int | get_input_sample_idx_for_merged (unsigned inputGVCFIdx, int mergedSampleIdx) const |
| Get sample idx for the input VCF inputGVCFIdx corresponding to sample mergedSampleIdx in the merged VCF. More...
|
|
int | get_input_header_idx_for_merged (unsigned inputGVCFIdx, int mergedIdx) const |
| Get header field (FLT/FMT/INFO) idx for the input VCF inputGVCFIdx corresponding to field mergedIdx in the merged VCF. More...
|
|
void | store_merged_field_idx_for_enum (const std::string &field, unsigned field_enum_idx) |
| utility function for storing index of frequently used fields in the merged VCF Sometimes the user/developer may know beforehand that certain fields are needed/accesssed (for example "PL") for every variant in a merged VCF Instead of doing a string search everytime, the user may wish to define an enum corresponding to the relevant fields and store the index of the relevant fields in the merged VCF after the merged header is built. Subsequent accesses to the fields need not use any string searches, instead directly using the idx in the LUT Example, the user could define an enum { PL_FIELD=0, AD_FIELD, AF_FIELD } and call the function store_merged_field_idx_for_enum("PL", PL_FIELD); store_merged_field_idx_for_enum("AD", AD_FIELD); ... More...
|
|
int | get_merged_field_idx_for_enum (unsigned field_enum_idx) const |
|
int | get_enum_for_merged_field_idx (int merged_field_idx) const |
|
template<bool fields_forward_LUT_ordering, bool fields_reverse_LUT_ordering, bool samples_forward_LUT_ordering, bool samples_reverse_LUT_ordering>
void gamgee::VariantHeaderMerger< fields_forward_LUT_ordering, fields_reverse_LUT_ordering, samples_forward_LUT_ordering, samples_reverse_LUT_ordering >::store_merged_field_idx_for_enum |
( |
const std::string & |
field, |
|
|
unsigned |
field_enum_idx |
|
) |
| |
utility function for storing index of frequently used fields in the merged VCF Sometimes the user/developer may know beforehand that certain fields are needed/accesssed (for example "PL") for every variant in a merged VCF Instead of doing a string search everytime, the user may wish to define an enum corresponding to the relevant fields and store the index of the relevant fields in the merged VCF after the merged header is built. Subsequent accesses to the fields need not use any string searches, instead directly using the idx in the LUT Example, the user could define an enum { PL_FIELD=0, AD_FIELD, AF_FIELD } and call the function store_merged_field_idx_for_enum("PL", PL_FIELD); store_merged_field_idx_for_enum("AD", AD_FIELD); ...
While processing variants, the user could directly use the merged field idx using the function auto merged_PL_idx = get_merged_field_idx_for_enum(PL_FIELD); This completely avoids string searches during variant processing
The reverse function (get_enum_for_merged_field_idx) is also useful: for(i=0;i<bcf1_t->n_info;++i) { switch(VariantHeaderMerger.get_enum_for_merged_field_idx(bcf1_t->d.info[i].key)) { case PL_FIELD: do_something_with_PL(); break; .... } }