episcanpy.api.ct.build_count_mtx¶
- episcanpy.api.ct.build_count_mtx(cells, annotation, path='', output_file=None, writing_option='w', meth_context='CG', chromosome=None, feature_names=None, threshold=1, ct_mtx=None, sparse=False, copy=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. If None, chromosomes are deduced from the chromosomes containing features.
- feature_names
If you want to write down the name of the annotation features. ‘Int’ (or ‘list’ if you have multiple annotations)
- threshold
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)
- sparse
Boolean, writing option as a normal or sparse matrix. default: False
- copy
if True, return count matrix