Computes the number of no call.

    :param fileName: the name of the file

    :type fileName: str

    Reads the ``ped`` file created by Plink using the ``recodeA`` options (see
    :py:func:`createPedChr24UsingPlink`) and computes the number and percentage
    of no calls on the chromosome ``24``.

def computeNoCall(fileName):
    """Computes the number of no call.

    :param fileName: the name of the file

    :type fileName: str

    Reads the ``ped`` file created by Plink using the ``recodeA`` options (see
    :py:func:`createPedChr24UsingPlink`) and computes the number and percentage
    of no calls on the chromosome ``24``.
    """
    outputFile = None
    try:
        outputFile = open(fileName + ".noCall", "w")
    except IOError:
        msg = "%s: can't write file" % fileName + ".noCall"
        raise ProgramError(msg)
    print >>outputFile, "\t".join(["PED", "ID", "SEX", "nbGeno", "nbNoCall"])

    try:
        toPrint = []
        with open(fileName, "r") as inputFile:
            for i, line in enumerate(inputFile):
                row = line.rstrip("\r\n").split(" ")
                if i != 0:
                    # This is data
                    genotypes = np.array(row[6:])

                    nbMarker = len(genotypes)
                    nbNA = len(np.where(genotypes == "NA")[0])

                    toPrint.append((row[0], row[1], row[4], str(nbMarker),
                                    str(nbNA)))

        toPrint.sort(reverse=True, key=lambda values: int(values[4]))

        for row in toPrint:
            print >>outputFile, "\t".join(row)

    except IOError:
        msg = "%(fileName)s: no such file" % locals()
        raise ProgramError(msg)

    # Closing the output file
    outputFile.close()