Compression in this function always uses "bgzip" for compatibility with "tabix".

write_vcf(vars, out_prefix, compress = FALSE, sample_matrix = NULL,
  show_progress = FALSE, overwrite = FALSE)



A variants object.


Prefix for the output file.


Logical specifying whether or not to compress output file, or an integer specifying the level of compression, from 1 to 9. If TRUE, a compression level of 6 is used. Defaults to FALSE.


Matrix to specify how haploid variants are grouped into samples if samples are not haploid. There should be one row for each sample, and each row should contain indices or names for the variants present in that sample. Indices/names for variants cannot be repeated. Instead of repeating indices here, you should use the dup_vars method of the variants class to duplicate the necessary variant(s). The number of columns indicates the ploidy level: 2 columns for diploid, 3 for triploid, 4 for tetraploid, and so on; there is no limit to the ploidy level. If this argument is NULL, it's assumed that each variant is its own separate sample. Defaults to NULL.


Logical for whether to show a progress bar. Defaults to FALSE.


Logical for whether to overwrite existing file(s) of the same name, if they exist. Defaults to FALSE.