Runs the genome command from plink.

    :param bfile: the input file prefix.
    :param options: the options.

    :type bfile: str
    :type options: argparse.Namespace

    :returns: the name of the ``genome`` file.

    Runs Plink with the ``genome`` option. If the user asks for SGE
    (``options.sge`` is True), a frequency file is first created by plink.
    Then, the input files are split in ``options.line_per_file_for_sge`` and
    Plink is called (using the ``genome`` option) on the cluster using SGE
    (:py:func:`runGenomeSGE`). After the analysis, Plink's output files and
    logs are merged using :py:func:`mergeGenomeLogFiles`.

def runGenome(bfile, options):
    """Runs the genome command from plink.

    :param bfile: the input file prefix.
    :param options: the options.

    :type bfile: str
    :type options: argparse.Namespace

    :returns: the name of the ``genome`` file.

    Runs Plink with the ``genome`` option. If the user asks for SGE
    (``options.sge`` is True), a frequency file is first created by plink.
    Then, the input files are split in ``options.line_per_file_for_sge`` and
    Plink is called (using the ``genome`` option) on the cluster using SGE
    (:py:func:`runGenomeSGE`). After the analysis, Plink's output files and
    logs are merged using :py:func:`mergeGenomeLogFiles`.

    """
    outPrefix = options.out + ".genome"
    if options.sge:
        # We run genome using SGE
        # We need to create a frequency file using plink
        plinkCommand = ["plink", "--noweb", "--bfile", bfile, "--freq",
                        "--out", options.out + ".frequency"]
        runCommand(plinkCommand)

        # We need to split the .fam file
        nbJob = splitFile(bfile + ".fam", options.line_per_file_for_sge,
                          outPrefix)

        runGenomeSGE(bfile, options.out + ".frequency.frq", nbJob,
                     outPrefix, options)

        # Merging genome files
        mergeGenomeLogFiles(outPrefix, nbJob)

    else:
        plinkCommand = ["plink", "--noweb", "--bfile", bfile, "--genome",
                        "--genome-full", "--out", outPrefix]
        runCommand(plinkCommand)

    return outPrefix + ".genome"