Converts internal rows to BGEN rows. Includes logic to infer phasing and ploidy if missing (eg.
when converting from VCF rows with no GT field), using the number of alleles and the number of
posterior probabilities.
- If phasing and ploidy are missing, we assume ploidy is defaultPloidy.
- If phasing is missing:
If no posterior probabilities are present, we assume phasing is defaultPhasing.
If the number of posterior probabilities matches the case that the probability represents:
Either phased or unphased data: we assume phasing is defaultPhasing.
Phased data: we assume the data is phased.
Unphased data: we assume the data is unphased.
Neither: we throw an exception
- If ploidy is missing:
If no posterior probabilities are present, we assume ploidy is defaultPloidy.
If phased, we try to calculate the ploidy directly.
If unphased, we try to find the ploidy between [1, maxPloidy].
Exceptions thrown
IllegalStateException if phasing or ploidy cannot be inferred or a single row contains
both unphased and phased data.
Converts internal rows to BGEN rows. Includes logic to infer phasing and ploidy if missing (eg. when converting from VCF rows with no GT field), using the number of alleles and the number of posterior probabilities.
- If phasing and ploidy are missing, we assume ploidy is defaultPloidy. - If phasing is missing:
IllegalStateException
if phasing or ploidy cannot be inferred or a single row contains both unphased and phased data.