def predict_sex(x_coverage, y_coverage):
    """Make a simple yet accurate prediction of a samples sex.

    The calculation is based on the average coverage across the X and Y
    chromosomes. Note that an extrapolation from a subsection of bases is
    usually quite sufficient.

    Args:
        x_coverage (float): estimated average coverage on X chromosome
        y_coverage (float): estimated average coverage on Y chromosome

    Returns:
        str: prediction, ['male', 'female', 'unknown']
    """
    # algoritm doesn't work if coverage is missing for X chromosome
    if x_coverage == 0:
        return 'unknown'
    elif (y_coverage > 0) and (x_coverage / y_coverage < 10):
        # this is the entire prediction, it's usually very obvious
        return 'male'
    else:
        # the few reads mapping to the Y chromosomes are artifacts
        return 'female'
dataset/ETHPy150Open robinandeer/chanjo/chanjo/sex/core.py/predict_sex/original