pyGenClean.FlagMAF package

For more information about how to use this module, refer to the Minor Allele Frequency of Zero Module.

Module contents

Submodules

pyGenClean.FlagMAF.flag_maf_zero module

exception pyGenClean.FlagMAF.flag_maf_zero.ProgramError(msg)[source]

Bases: exceptions.Exception

An Exception raised in case of a problem.

Parameters:msg (str) – the message to print to the user before exiting.
pyGenClean.FlagMAF.flag_maf_zero.checkArgs(args)[source]

Checks the arguments and options.

Parameters:args (argparse.Namespace) – a argparse.Namespace object containing the options of the program.
Returns:True if everything was OK.

If there is a problem with an option, an exception is raised using the ProgramError class, a message is printed to the sys.stderr and the program exists with code 1.

pyGenClean.FlagMAF.flag_maf_zero.computeFrequency(options)[source]

Compute the frequency of the SNPs.

Parameters:options (argparse.Namespace) – the options.
pyGenClean.FlagMAF.flag_maf_zero.findSnpWithMaf0(freqFileName, prefix)[source]

Finds SNPs with MAF of 0 and put them in a file.

Parameters:
  • freqFileName (str) – the name of the frequency file.
  • prefix (str) – the prefix of all the files.

Reads a frequency file from Plink, and find markers with a minor allele frequency of zero.

pyGenClean.FlagMAF.flag_maf_zero.main(argString=None)[source]

The main function.

Parameters:argString (list) – the options.

These are the steps:

  1. Prints the options.
  2. Computes the frequencies using Plinl (computeFrequency()).
  3. Finds markers with MAF of 0, and saves them in a file (findSnpWithMaf0()).
pyGenClean.FlagMAF.flag_maf_zero.parseArgs(argString=None)[source]

Parses the command line options and arguments.

Parameters:argString (list) – the options.
Returns:A argparse.Namespace object created by the argparse module. It contains the values of the different options.
Options Type Description
--bfile string The input file prefix (Plink binary file).
--out string The prefix of the output files.

Note

No option check is done here (except for the one automatically done by argparse). Those need to be done elsewhere (see checkArgs()).

pyGenClean.FlagMAF.flag_maf_zero.safe_main()[source]

A safe version of the main function (that catches ProgramError).