API: normalization

blockify.normalization.normalize(input_file, regions_bed, libraryFactor, lengthFactor)[source]

Core normalization method

Parameters
  • input_file (BedTool object) – BedTool object (instantiated from pybedtools) for input data

  • regions_bed (BedTool object) – BedTool object (instantiated from pybedtools) for regions over which we are normalizing input_file

  • libraryFactor (float) – Scalar to normalize by input_file’s library size.

  • lengthFactor (float or None) – Scalar to normalize by each block’s length. If None, no length normalization is performed.

Returns

bedgraph – A BedTool object in bedGraph format, using the intervals supplied in regions_bed

Return type

BedTool

blockify.normalization.normalize_from_command_line(args)[source]

Wrapper function for the command line function blockify normalize

Parameters

args (argparse.Namespace object) – Input from command line

Returns

bedgraph – Normalized command line data in bedGraph format

Return type

BedTool

blockify.normalization.validateNormalizationArguments(input_file, regions_bed, libraryFactor, lengthFactor)[source]

Validates parameters passed via the command line.

Parameters
  • input_file (BedTool object) – BedTool object (instantiated from pybedtools) for input data

  • regions_bed (BedTool object) – BedTool object (instantiated from pybedtools) for regions over which we are normalizing input_file

  • libraryFactor (float) – Scalar to normalize by input_file’s library size.

  • lengthFactor (float or None) – Scalar to normalize by each block’s length. If None, no length normalization is performed.

Returns

None

Return type

None