episcanpy.ct.build_count_mtx

episcanpy.ct.build_count_mtx(cells, annotation, path='', output_file=None, writing_option='a', meth_context='CG', chromosome=['1', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '2', '20', '21', '22', '3', '4', '5', '6', '7', '8', '9', 'X', 'Y'], feature_names=None, threshold=1, ct_mtx=None, sparse=False)

Build methylation count matrix for a given annotation. It either write the count matrix (if given an output file) or return it as a variable (numpy matrix). If you want to add cells to an already existing matrix (with the same annotations), you put the initial matrix as ct_mtx or you specify the matrix to write + writing option = a

if you want to write down the matrix as a sparse matrix you have to specify it (not implented yet)

I need to pay attention to where I am writing the output file.

Also, verbosity..

Pay attention, it does not average variables. If you want to process many small features such as tfbs, we advise to use the dedicated function.

Parameters
cells

list of the file names to read to build the count matrix.

annotation

loaded annotation to use to build the count matrix ‘str’ or ‘list’ depending of the number of matrices to build

path

path to the input data.

output_file

name files to write. ‘str’ or ‘list’ depending of the number of matrices to build

writing_option

either ‘w’ if you want to erase potentialy already existing file or ‘a’ to append. ‘str’ or ‘list’ if you have a list of matrices and the writing options are differents

meth_context

read methylation in ‘CG’ of ‘CH’ context

chromosome

‘MOUSE’ and ‘HUMAN’ (without mitochondrial genome) or list with chromosomes.

feature_names

If you want to write down the name of the annotation features. ‘Int’ (or ‘list’ if you have multiple annotations)

thereshold

the minimum of cytosines covered per annotation to calculate a methylation level. default=1 ‘Int’ (or ‘list’ if you have multiple annotations with different thresholds)

ct_mtx

numpy matrix containing the same set of annotations and for which you want to append. default: None

sparse

Boolean, writing option as a normal or sparse matrix. default: False