Summary of Python Modules

config module

updateConfig(section, option, value) Update configuration file
getConfig() To get the present configuration.
printConfig() Print configuration file
cleanScratch() Clean scratch directory.

ccmap module

ccmap.CCMAP.copy([fill]) To create a new copy of CCMAP object
ccmap.CCMAP.get_ticks([binsize]) To get xticks and yticks for the matrix
ccmap.CCMAP.make_readable() Enable reading the numpy array binary file.
ccmap.CCMAP.make_unreadable() Disable reading the numpy array binary file from local file system
ccmap.CCMAP.make_writable() Create new numpy array binary file on local file system and enable reading/writing to this file
ccmap.CCMAP.make_editable() Enable editing numpy array binary file
ccmap.jsonify(ccMapObj) Changes data type of attributes in CCMAP object for json module.
ccmap.dejsonify(ccMapObj[, json_dict]) Change back the data type of attributes in CCMAP object.
ccmap.save_ccmap(ccMapObj, outfile[, …]) Save CCMAP object on file
ccmap.load_ccmap(infile[, workDir]) Load CCMAP object from an input file
ccmap.export_cmap(ccmap, outfile[, …]) To export .ccmap as text file
ccmap.checkCCMapObjectOrFile(ccMap[, workDir]) Check whether ccmap is a object or file
ccmap.downSampleCCMap(cmap[, level, method, …]) Downsample or coarsen the contact map
ccmap.getOutputShapeFor2DMapDownsampling(…) Helper function to determine output shape of map for downsampling
ccmap.downSample2DMap(inMatrix[, outMatrix, …]) Downsample or coarsen the matrix

ccmapHelpers module

ccmapHelpers.MemoryMappedArray Convenient wrapper for numpy memory mapped array file
ccmapHelpers.MemoryMappedArray.copy Copy this numpy memory mapped array and generate new
ccmapHelpers.MemoryMappedArray.copy_from Copy values from source MemoryMappedArray
ccmapHelpers.MemoryMappedArray.copy_to Copy values to destination MemoryMappedArray
ccmapHelpers.get_nonzeros_index(matrix[, …]) To get a numpy array of bool values for all rows/columns which have NO missing data
ccmapHelpers.remove_zeros(matrix[, …]) To remove rows/columns with missing data (zero values)

util module

util.resolutionToBinsize(resolution) Return the bin size from the resolution unit
util.binsizeToResolution(binsize) Return the resolution unit from the bin size
util.sorted_nicely(inputList) Sorts the given given list in the way that is expected.
util.locate_significant_digit_after_decimal(value) Get location at which significant digit start after decimal
util.kth_diag_indices(k, a) Get diagonal indices of 2D array ‘a’ offset by ‘k’
util.detectOutliers1D(points[, thresh]) Returns a boolean array with True if points are outliers and False otherwise.
util.getRandomName([size, chars]) Random name generator
util.MapNotFoundError(value)
util.ResolutionNotFoundError(value)

gcmap module

gcmap.GCMAP(hdf5[, mapName, chromAtX, …]) To access Genome wide contact map.
gcmap.GCMAP.checkMapExist([mapName, …]) Check if a map is exist in the file
gcmap.GCMAP.changeMap([mapName, chromAtX, …]) Change the map for another chromosome
gcmap.GCMAP.changeResolution(resolution) Try to change contact map of a given resolution.
gcmap.GCMAP.toFinerResolution() Try to change contact map to next finer resolution
gcmap.GCMAP.toCoarserResolution() Try to change contact map to next coarser resolution
gcmap.GCMAP.loadSmallestMap([resolution]) Load smallest sized contact map
gcmap.GCMAP.genMapNameList([sortBy]) Generate list of contact maps available in gcmap file
gcmap.GCMAP.performDownSampling([method]) Downsample recursively and store the maps
gcmap.GCMAP.downsampleMapToResolution(resolution) Downsample the current map to a particular resolution
gcmap.GCMAP.downsampleAllMapToResolution(…) Downsample all maps to a particular resolution
gcmap.loadGCMapAsCCMap(filename[, mapName, …]) Load a map from gcmap file as a gcMapExplorer.lib.ccmap.CCMAP.
gcmap.addCCMap2GCMap(cmap, filename[, …]) Add gcMapExplorer.lib.ccmap.CCMAP to a gcmap file
gcmap.changeGCMapCompression(infile, …[, …]) Change compression method in GCMAP file

importer module

importer.CooMatrixHandler([inputFiles, …]) To import ccmap from files similar to sparse matrix in Coordinate (COO) format
importer.CooMatrixHandler.save_ccmaps([…]) To Save all Hi-C maps
importer.CooMatrixHandler.save_gcmap(outputFile) To Save all Hi-C maps as a gcmap file
importer.CooMatrixHandler.setLabels(xlabels, …) To set xlabels and ylabels for contact maps
importer.CooMatrixHandler.setOutputFileList(…) To set list of output files
importer.PairCooMatrixHandler(inputFile[, …]) To import ccmap from files similar to paired sparse matrix Coordinate (COO) format
importer.PairCooMatrixHandler.setGCMapOptions([…]) Set options for output gcmap file
importer.PairCooMatrixHandler.runConversion() Perform conversion and save to ccmap and/or gcmap file.
importer.HomerInputHandler([inputFiles, …]) To import ccmap from Hi-C maps generated by HOMER
importer.HomerInputHandler.save_ccmaps(outdir) Import and save ccmap file
importer.HomerInputHandler.save_gcmap(outputFile) To Save all Hi-C maps as a gcmap file
importer.BinsNContactFilesHandler(binFile, …) To import Hi-C map from bin and contact file in list format
importer.BinsNContactFilesHandler.save_ccmaps(outdir) Import and save ccmap file
importer.BinsNContactFilesHandler.save_gcmap(…) To Save all Hi-C maps as a gcmap file
importer.gen_map_from_locations_value(i, j, …) To generate CCMAP object from three lists – i, j, value

normalizer module

normalizer.NormalizeKnightRuizOriginal(ccMapObj) Original Knight-Ruiz algorithm for matrix balancing
normalizer.normalizeCCMapByKR(ccMap[, …]) Normalize a ccmap using Knight-Ruiz matrix balancing method.
normalizer.normalizeGCMapByKR(…[, …]) Normalize a gcmap using Knight-Ruiz matrix balancing method.
normalizer.normalizeCCMapByIC(ccMap[, tol, …]) Normalize a ccmap by Iterative correction method
normalizer.normalizeGCMapByIC(…[, vmin, …]) Normalize a gcmap using Iterative Correction.
normalizer.normalizeCCMapByMCFS(ccMap[, …]) Scale ccmap using Median Contact Frequency
normalizer.normalizeGCMapByMCFS(…[, …]) Scale all maps in gcmap using Median Contact Frequency
normalizer.normalizeCCMapByVCNorm(ccMap[, …]) Normalize ccmap using Vanilla-Coverage method
normalizer.normalizeGCMapByVCNorm(…[, …]) Normalize all maps using Vanilla-Coverage method

cmstats module

cmstats.correlateCMaps(ccMapObjOne, ccMapObjTwo) To calculate correlation between two Hi-C maps
cmstats.correlateGCMaps(gcmapOne, gcmapTwo) To calculate correlation between common Hi-C maps from two gcmap files
cmstats.getAvgContactByDistance(ccmaps[, …]) To calculate average contact as a function of distance

corrMatrix module

corrMatrix.calculateCorrMatrix(…[, maskvalue]) Calculate correlation matrix from a 2D numpy array.
corrMatrix.calculateCovMatrix(…[, maskvalue]) Calculate covariance matrix from a 2D numpy array.
corrMatrix.calculateCorrelation(ndarray x, …) Calculate correlation between two 1D numpy array.
corrMatrix.calculateCovariance(ndarray x, …) Calculate covariance between two 1D numpy array.
corrMatrix.calculateCorrMatrixForCCMap(…) Calculate correlation matrix of a contact map.
corrMatrix.calculateCorrMatrixForGCMaps(…) Calculate Correlation matrix for all maps present in input gcmap file It calculates correlation between all rows and columns of contact map.

statDist module

statDist.calculateTransitionProbabilityMatrix(A) Core function to calculate transition probability matrix.
statDist.transitionProbabilityMatrixForCCMap(ccMap) To calculate transition probability matrix.
statDist.transitionProbabilityMatrixForGCMap(…) To calculate transition matrices using a gcmap file.
statDist.statDistrByEigenDecompForCCMap(ccMap) Calculate stationary distribution from a ccmap file or object.
statDist.statDistrByEigenDecompForGCMap(…) Calculate stationary distribution using transition matrices from gcmap file for given resolution.
statDist.stationaryDistributionByEigenDecomp(…) To calculate stationary distribution from probability transition matrix.

genomicsDataHandler module

genomicsDataHandler.HDF5Handler(filename[, …]) Handler for genomic data HDF5 file.
genomicsDataHandler.HDF5Handler.setTitle(title) Set title of the dataset
genomicsDataHandler.HDF5Handler.getChromList() To get list of all chromosomes present in hdf5 file
genomicsDataHandler.HDF5Handler.getResolutionList(chrom) To get all resolutions for given chromosome from hdf5 file
genomicsDataHandler.HDF5Handler.getDataNameList(…) List of all available arrays by respective coarse method name for given chromosome and resolution
genomicsDataHandler.HDF5Handler.buildDataTree() Build data dictionary from the input hdf5 file
genomicsDataHandler.BigWigHandler(filenames) To handle bigWig files and to convert it to h5 file
genomicsDataHandler.BigWigHandler.getBigWigInfo() Retrieve chromosome names and their sizes
genomicsDataHandler.BigWigHandler.bigWigtoWig([…]) To generate Wig file
genomicsDataHandler.BigWigHandler.saveAsH5(…) Save data to h5 file.
genomicsDataHandler.WigHandler(filenames[, …]) To convert Wig files to hdf5 file
genomicsDataHandler.WigHandler.parseWig() To parse Wig files
genomicsDataHandler.WigHandler.setChromosome(…) Set the target chromosome for reading and extracting from wig file
genomicsDataHandler.WigHandler.saveAsH5(hdf5Out) To convert Wig files to hdf5 file
genomicsDataHandler.WigHandler.getRawWigDataAsDictionary([…]) To get a entire dictionary of data from Wig file
genomicsDataHandler.BEDHandler(filenames[, …]) To convert BED files to hdf5/h5 file
genomicsDataHandler.BEDHandler.parseBed() To parse bed files
genomicsDataHandler.BEDHandler.setChromosome(…) Set the target chromosome for reading and extracting from bed file
genomicsDataHandler.BEDHandler.saveAsH5(hdf5Out) To convert bed files to hdf5 file
genomicsDataHandler.EncodeDatasetsConverter(…) Download and convert datasets from ENCODE Experiments matrix
genomicsDataHandler.EncodeDatasetsConverter.saveAsH5(outDir) Download the files and convert to gcMapExplorer compatible hdf5 file.
genomicsDataHandler.TextFileHandler(…[, …]) To import a genomic data from column text file format
genomicsDataHandler.TextFileHandler.readData() Read data from input file
genomicsDataHandler.TempNumpyArrayFiles([…]) To handle temporary numpy array files
genomicsDataHandler.TempNumpyArrayFiles.updateArraysByBigWig(…) Update/resize all array files using given bigWig file
genomicsDataHandler.TempNumpyArrayFiles.updateArraysByChromSize(…) Update/resize an array file using given chromosome and its size
genomicsDataHandler.TempNumpyArrayFiles.addChromSizeInfo(…) Update chromosome sizes using new bigWig file
genomicsDataHandler.TempNumpyArrayFiles.generateAllTempNumpyFiles() Generate all memory mapped numpy array files
genomicsDataHandler.TempNumpyArrayFiles.generateTempNumpyFile(key) Generate a memory mapped numpy array file
genomicsDataHandler.TempNumpyArrayFiles.fillAllArraysWithZeros() Fill all arrays with zeros.