The Fragment class

A class for handling 5C fragment information.

class hifive.fragment.Fragment(filename, mode='r', silent=False)

This class handles restriction enzyme digest-generated fragment data for 5C experiments.

This class stores a list of chromosomes, a dictionary for converting from chromosome label to integer and back, fragment starts, stops, and chromosome number in an h5dict.

Note

This class is also available as hifive.Fragment

When initialized, this class creates an h5dict in which to store all data associated with this object.

Parameters:
  • filename (str.) – The file name of the h5dict. This should end with the suffix ‘.hdf5’
  • mode (str.) – The mode to open the h5dict with. This should be ‘w’ for creating or overwriting an h5dict with name given in filename.
  • silent (bool.) – Indicates whether to print information about function execution for this object.
Returns:

Fragment class object.

load()

Load fragment data from h5dict specified at object creation.

Any call of this function will overwrite current object data with values from the last save() call.

Returns:None
load_fragments(filename, genome_name=None, re_name=None, regions=, []minregionspacing=1000000)

Parse and store fragment data from a bed for a 5C assay file into an h5dict.

Parameters:
  • filename (str.) – A file name to read restriction fragment data from. This should be a BED file containing fragment boundaries for all probed fragments and primer names that match those used for read mapping.
  • genome_name (str.) – The name of the species and build. Optional.
  • re_name (str.) – The name of the restriction enzyme used to produce the fragment set. Optional.
  • regions (list) – User-defined partitioning of fragments into different regions. This argument should be a list of lists containing the chromosome, start, and stop coordinates for each region.
  • minregionspacing (int.) – If ‘regions’ is not defined, this is used to parse regions by inserting breaks where fragments are spaced apart greater than this value.
Returns:

None

save()

Save fragment data to h5dict.

Returns:None