Run the relatedness step of the data clean up.

    :param inputPrefix: the prefix of the input file.
    :param outPrefix: the prefix of the output file.
    :param options: the options

    :type inputPrefix: str
    :type outPrefix: str
    :type options: argparse.Namespace

    :returns: the prefix of the new bfile.

    Runs :py:mod:`pyGenClean.RelatedSamples.find_related_samples` using the
    ``inputPrefix`` files and ``options`` options, and saves the results using
    the ``outPrefix`` prefix.

def runRelatedness(inputPrefix, outPrefix, options):
    """Run the relatedness step of the data clean up.

    :param inputPrefix: the prefix of the input file.
    :param outPrefix: the prefix of the output file.
    :param options: the options

    :type inputPrefix: str
    :type outPrefix: str
    :type options: argparse.Namespace

    :returns: the prefix of the new bfile.

    Runs :py:mod:`pyGenClean.RelatedSamples.find_related_samples` using the
    ``inputPrefix`` files and ``options`` options, and saves the results using
    the ``outPrefix`` prefix.

    """
    # The options
    new_options = ["--bfile", inputPrefix, "--genome-only",
                   "--min-nb-snp", str(options.min_nb_snp),
                   "--maf", options.maf,
                   "--out", "{}.ibs".format(outPrefix)]
    new_options += ["--indep-pairwise"] + options.indep_pairwise
    if options.sge:
        new_options.append("--sge")
        new_options += ["--line-per-file-for-sge",
                        str(options.line_per_file_for_sge)]
        if options.ibs_sge_walltime is not None:
            new_options += ["--sge-walltime", options.ibs_sge_walltime]
        if options.ibs_sge_nodes is not None:
            new_options += ["--sge-nodes"] + map(str, options.ibs_sge_nodes)

    # Checking the input file
    if not allFileExists([inputPrefix + i for i in [".bed", ".bim", ".fam"]]):
        msg = "{}: not a valid binary prefix".format(inputPrefix)
        raise ProgramError(msg)

    newBfile = None
    try:
        newBfile = Relatedness.main(new_options)
    except Relatedness.ProgramError as e:
        msg = "compute genome: {}".format(e)
        raise ProgramError(msg)

    return newBfile