from typing import List


def remove_vars(df,
                r_val: int,
                num_samples: int,
                cols: List[str]):
    """Removes variants that are homozygous variant or references in more that
    80% of the samples

    Parameters
    -----------
    df: data frame of the variants from readCounts

    r_val: number of reads corresponding to homozygous or homozygous reference

    num_samples: number of unique samples

    cols: list of the new columns names which will be created

    Returns
    -------
     a dataframe that meet the condition above

    """

    df[cols[0]] = (df['R'] == r_val).groupby(df['SNV']).transform('sum')
    df[cols[1]] = df[cols[0]] / num_samples

    df = df[df[cols[1]] < 0.8].reset_index()

    return df