def _parse_impute2_line(self, line):
        """Parses the current IMPUTE2 line (a single variant).

        Args:
            line (str): An IMPUTE2 line.

        Returns:
            Genotypes: The genotype in dosage format.

        Warning
        =======
            By default, the genotypes object has multiallelic set to False.

        """
        # Splitting
        row = line.rstrip("\r\n").split(" ")

        # Constructing the probabilities
        prob = np.array(row[5:], dtype=float)
        prob.shape = (prob.shape[0] // 3, 3)

        # Constructing the dosage
        dosage = 2 * prob[:, 2] + prob[:, 1]
        if self.prob_t > 0:
            dosage[~np.any(prob >= self.prob_t, axis=1)] = np.nan

        return Genotypes(
            Variant(row[1], CHROM_STR_ENCODE.get(row[0], row[0]), int(row[2]),
                    [row[3], row[4]]),
            dosage,
            reference=row[3],
            coded=row[4],
            multiallelic=False,
        )
def _parse_impute2_line ( self , line ) : row = line . rstrip ( "\r\n" ) . split ( " " ) prob = np . array ( row [ 5 : ] , dtype = float ) prob . shape = ( prob . shape [ 0 ] // 3 , 3 ) dosage = 2 * prob [ : , 2 ] + prob [ : , 1 ] if self . prob_t > 0 : dosage [ ~ np . any ( prob >= self . prob_t , axis = 1 ) ] = np . nan return Genotypes ( Variant ( row [ 1 ] , CHROM_STR_ENCODE . get ( row [ 0 ] , row [ 0 ] ) , int ( row [ 2 ] ) , [ row [ 3 ] , row [ 4 ] ] ) , dosage , reference = row [ 3 ] , coded = row [ 4 ] , multiallelic = False , )
Parses the current IMPUTE2 line (a single variant).

        Args:
            line (str): An IMPUTE2 line.

        Returns:
            Genotypes: The genotype in dosage format.

        Warning
        =======
            By default, the genotypes object has multiallelic set to False.