pyGenClean.PlateBias package

For more information about how to use this module, refer to the Plate Bias Module.

Module contents

Submodules

pyGenClean.PlateBias.plate_bias module

exception pyGenClean.PlateBias.plate_bias.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.PlateBias.plate_bias.checkArgs(args)[source]

Checks the arguments and options.

Parameters:args (argparse.Namespace) – an 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.PlateBias.plate_bias.computeFrequencyOfSignificantSNPs(options)[source]

Computes the frequency of the significant markers.

Parameters:options (argparse.Namespace) – the options.

Extract a list of markers (significant after plate bias analysis) and computes their frequencies.

pyGenClean.PlateBias.plate_bias.createSummaryFile(results, maf, prefix)[source]

Creat the final summary file containing plate bias results.

Parameters:
  • results (list) – the list of all the significant results.
  • maf (dict) – the minor allele frequency of the significant results.
  • prefix (str) – the prefix of all the files.
pyGenClean.PlateBias.plate_bias.executePlateBiasAnalysis(options)[source]

Execute the plate bias analysis with Plink.

Parameters:options (argparse.Namespace) – the options.
pyGenClean.PlateBias.plate_bias.extractSignificantSNPs(prefix)[source]

Extract significant SNPs in the fisher file.

Parameters:prefix (str) – the prefix of the input file.

Reads a list of significant markers (prefix.assoc.fisher) after plate bias analysis with Plink. Writes a file (prefix.significant_SNPs.txt) containing those significant markers.

pyGenClean.PlateBias.plate_bias.main(argString=None)[source]

The main function of this module.

Parameters:argString (list) – the options.

These are the steps:

  1. Runs a plate bias analysis using Plink (executePlateBiasAnalysis()).
  2. Extracts the list of significant markers after plate bias analysis (extractSignificantSNPs()).
  3. Computes the frequency of all significant markers after plate bias analysis (computeFrequencyOfSignificantSNPs()).
pyGenClean.PlateBias.plate_bias.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).
--loop-assoc string The file containing the plate organization of each samples.
--pfilter float The significance threshold used for the plate effect.
--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.PlateBias.plate_bias.runCommand(command)[source]

Run a command.

Parameters:command (list) – the command to run.

Tries to run a command. If it fails, raise a ProgramError. This function uses the subprocess module.

Warning

The variable command should be a list of strings (no other type).

pyGenClean.PlateBias.plate_bias.safe_main()[source]

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