def _double_single_alleles(df, chrom):
        """ Double any single alleles in the specified chromosome.

        Parameters
        ----------
        df : pandas.DataFrame
            SNPs
        chrom : str
            chromosome of alleles to double

        Returns
        -------
        df : pandas.DataFrame
            SNPs with specified chromosome's single alleles doubled
        """
        # find all single alleles of the specified chromosome
        single_alleles = np.where(
            (df["chrom"] == chrom) & (df["genotype"].str.len() == 1)
        )[0]

        # double those alleles
        df.ix[single_alleles, "genotype"] = df.ix[single_alleles, "genotype"] * 2

        return df
def _double_single_alleles ( df , chrom ) : single_alleles = np . where ( ( df [ "chrom" ] == chrom ) & ( df [ "genotype" ] . str . len ( ) == 1 ) ) [ 0 ] df . ix [ single_alleles , "genotype" ] = df . ix [ single_alleles , "genotype" ] * 2 return df
Double any single alleles in the specified chromosome.

        Parameters
        ----------
        df : pandas.DataFrame
            SNPs
        chrom : str
            chromosome of alleles to double

        Returns
        -------
        df : pandas.DataFrame
            SNPs with specified chromosome's single alleles doubled