Minimac4
Loading...
Searching...
No Matches
imputation Class Reference

Class responsible for managing genotype imputation statistics and timing. More...

#include <imputation.hpp>

Public Member Functions

long total_input_time () const
 Get the total accumulated input time.
 
long total_output_time () const
 Get the total accumulated output time.
 
long total_impute_time () const
 Get the total accumulated imputation time.
 
bool impute_chunk (const savvy::region &impute_region, const prog_args &args, omp::internal::thread_pool2 &tpool, dosage_writer &output)
 Perform genotype imputation for a given genomic region.
 

Detailed Description

Class responsible for managing genotype imputation statistics and timing.

This class tracks cumulative input, output, and imputation times for genotype imputation runs. It also provides helper methods to record elapsed times and retrieve totals.

The timing values are updated by internal helper functions whenever an operation (e.g., input loading, output writing, or HMM traversal) completes. These values can then be retrieved for reporting and profiling.

Member Function Documentation

◆ impute_chunk()

bool imputation::impute_chunk ( const savvy::region & impute_region,
const prog_args & args,
omp::internal::thread_pool2 & tpool,
dosage_writer & output )

Perform genotype imputation for a given genomic region.

This function loads target haplotypes, reference haplotypes, and executes a Hidden Markov Model (HMM)–based imputation algorithm across the specified region. The region is optionally extended by an overlap to reduce edge effects.
Results are written to the provided output writer or via temporary files when sample sizes are large.

Workflow:

  • Extend the target imputation region with overlap.
  • Load target haplotypes for the region.
  • Load reference haplotypes (typed-only + full reference panel).
  • Check ratio of typed to reference variants against thresholds.
  • Run HMM forward/backward traversal in parallel for each sample haplotype.
  • Write dosages to temporary files (if buffered) or directly to output.
  • Merge temporary files if necessary.
Parameters
impute_regionThe genomic region to impute (chromosome, start, end).
argsProgram arguments controlling paths, thresholds, buffers, and options.
tpoolThread pool for parallel HMM traversal.
outputDosage writer for writing final imputation results.
Returns
True if the imputation completed successfully (even if the chunk was skipped), false if an error occurred (e.g., file loading/writing failed).
Note
  • If no reference variants exist in the region, the chunk is skipped.
  • If the ratio of typed sites to reference sites is below args.min_ratio(), the chunk may be skipped or treated as an error depending on args.fail_min_ratio().
  • Target-only variants can be optionally included in the output (--all-typed-sites).
  • Temporary files are created and merged automatically when processing in buffered groups.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ total_impute_time()

long imputation::total_impute_time ( ) const
inline

Get the total accumulated imputation time.

Returns
Total imputation time in seconds.
Here is the caller graph for this function:

◆ total_input_time()

long imputation::total_input_time ( ) const
inline

Get the total accumulated input time.

Returns
Total input time in seconds.
Here is the caller graph for this function:

◆ total_output_time()

long imputation::total_output_time ( ) const
inline

Get the total accumulated output time.

Returns
Total output time in seconds.
Here is the caller graph for this function:

The documentation for this class was generated from the following files: