The main function of the module.

    :param argString: the options.

    :type argString: list

    These are the following steps:

    1.  Prints the options.
    2.  Checks if there are enough markers on the chromosome ``23``
        (:py:func:`checkBim`). If not, quits here.
    3.  Runs the sex check analysis using Plink (:py:func:`runPlinkSexCheck`).
    4.  If there are no sex problems, then quits (:py:func:`readCheckSexFile`).
    5.  Creates the recoded file for the chromosome ``23``
        (:py:func:`createPedChr23UsingPlink`).
    6.  Computes the heterozygosity percentage on the chromosome ``23``
        (:py:func:`computeHeteroPercentage`).
    7.  If there are enough markers on chromosome ``24`` (at least 1), creates
        the recoded file for this chromosome
        (:py:func:`createPedChr24UsingPlink`).
    8.  Computes the number of no call on the chromosome ``24``
        (:py:func:`computeNoCall`).
    9.  If required, plots the gender plot (:py:func:`createGenderPlot`).
    10. If required, plots the BAF and LRR plot (:py:func:`createLrrBafPlot`).

def main(argString=None):
    """The main function of the module.

    :param argString: the options.

    :type argString: list

    These are the following steps:

    1.  Prints the options.
    2.  Checks if there are enough markers on the chromosome ``23``
        (:py:func:`checkBim`). If not, quits here.
    3.  Runs the sex check analysis using Plink (:py:func:`runPlinkSexCheck`).
    4.  If there are no sex problems, then quits (:py:func:`readCheckSexFile`).
    5.  Creates the recoded file for the chromosome ``23``
        (:py:func:`createPedChr23UsingPlink`).
    6.  Computes the heterozygosity percentage on the chromosome ``23``
        (:py:func:`computeHeteroPercentage`).
    7.  If there are enough markers on chromosome ``24`` (at least 1), creates
        the recoded file for this chromosome
        (:py:func:`createPedChr24UsingPlink`).
    8.  Computes the number of no call on the chromosome ``24``
        (:py:func:`computeNoCall`).
    9.  If required, plots the gender plot (:py:func:`createGenderPlot`).
    10. If required, plots the BAF and LRR plot (:py:func:`createLrrBafPlot`).

    """
    # Getting and checking the options
    args = parseArgs(argString)
    checkArgs(args)

    logger.info("Options used:")
    for key, value in vars(args).iteritems():
        logger.info("  --{} {}".format(key.replace("_", "-"), value))

    # Reads the bim file to see if chromosome 23 is there
    hasSexProblems = None
    if not checkBim("{}.bim".format(args.bfile), args.nbChr23, "23"):
        logger.info("There are not enough markers on chromosome 23: "
                    "STOPPING NOW!")
    else:
        # Run plink "check-sex"
        logger.info("Running Plink for sex check")
        runPlinkSexCheck(args)

        # Reading plink "check-sex" output file
        logger.info("Reading Plink's sex check output to find sex problems")
        hasSexProblems = readCheckSexFile(args.out + ".sexcheck",
                                          args.out + ".list_problem_sex",
                                          args.out + ".list_problem_sex_ids",
                                          args.femaleF, args.maleF)

    if hasSexProblems is not None and hasSexProblems:
        # Run plink to recode chr 23 in a ped format
        logger.info("Creating recoded file for chr23 using Plink")
        createPedChr23UsingPlink(args)

        # Compute the hetero percentage
        logger.info("Computing the heterozygous percentage")
        computeHeteroPercentage(args.out + ".chr23_recodeA.raw")

        # Run plink to get chr 24
        if checkBim("{}.bim".format(args.bfile), 1, "24"):
            logger.info("Creating recoded file for chr24 using Plink")
            createPedChr24UsingPlink(args)

            # Compute the number of no call
            logger.info("Computing the number of no calls")
            computeNoCall(args.out + ".chr24_recodeA.raw")
        else:
            logger.info("Not enough markers on chr24")

        # If required, let's plot the gender plot
        if args.gender_plot:
            logger.info("Creating the gender plot")
            createGenderPlot(args.bfile, args.sex_chr_intensities,
                             args.out + ".list_problem_sex",
                             args.gender_plot_format, args.out)

        # If required, let's plot the LRR and BAF plot
        if args.lrr_baf:
            logger.info("Creating the LRR and BAF plot")
            createLrrBafPlot(
                raw_dir=args.lrr_baf_raw_dir,
                problematic_samples=args.out + ".list_problem_sex_ids",
                format=args.lrr_baf_format,
                dpi=args.lrr_baf_dpi,
                out_prefix=args.out,
            )