The quasar module¶
A class for determining HiC data quality.
Quasar(filename, mode='a', silent=False)¶
This class performs subsampling and QuASAR transformations for calculating HiC quality.
This class is also available as hifive.Quasar
When initialized, this class creates an h5dict in which to store all data associated with this object.
- filename (str.) – The file name of the h5dict to store the QuASAR-transformed data in.
- 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.
Close h5dict file.
Find QuASAR quality scores across whole dataset.
Parameters: force (bool.) – Recalculate scores even if they have already been stored in the QuASAR object. Returns: A structured numpy array with the fields resolution’, ‘coverage’, and ‘score’.
Find QuASAR replicate scores across whole dataset.
- replicate (class:Quasar class object.) – A class:Quasar object to calculate replicate scores with. If this function has been previously called with a different sample, the current transformed matrices will be deleted prior to calculating new matrices.
- force (bool.) – Recalculate scores even if they have already been stored in the QuASAR object.
A structured numpy array with the fields ‘resolution’, ‘coverage’, and ‘score’.
find_transformation(hic, chroms=, resolutions=[1000000, 200000, 40000, 10000], coverages=[0, 40000000, 20000000, 10000000, 5000000, 2000000, 1000000], seed=None)¶
Find QuASAR transformation from the specified HiC project.
- hic (class:HiC class object.) – The HiC project from which to calculate QuASAR transformations from. If this function has been previously called with a different HiC project, the current transformed matrices will be deleted prior to calculating new matrices.
- chroms – A list of chromosome names to calculate transformed matrices from. If this is an empty list, all chromosomes from the HiC object will be used.
- resolutions (list) – A list of binning resolutions to find transformed matrices for.
- coverages (list) – A list of cis read counts to downsample to prior to finding transformed matrices. A value of 0 indicates to use all reads. Coverages are calculated across only chromosomes specified in the ‘chroms’ argument.
- seed – An integer to use as the initialization value for the random number generator.
Load data from h5dict specified at object creation.
Any call of this function will overwrite current object data with values from the last
Parameters: mode (str.) – The mode to open the h5dict with. Returns: None
Write QuASAR scores to output file.
Parameters: filename (str.) – The location to write the report to. The suffix will be used to determine the output format. Returns: None
Save analysis parameters to h5dict.