Previous topic

bioa.FrequencyMatrix.shape

Next topic

Algorithms

This Page

bioa.FrequencyMatrix.construct_normalized_freq_matrix

classmethod FrequencyMatrix.construct_normalized_freq_matrix(amplicons, include_pairs=True, nthreads=1)

This will normalize the frequencies in our matrix. Meaning that the sum of frequiences in each amplicon will equal one another. This is done in a left to right fashion by simply scaling according to the ratio of sums.

Parameters :

amplicons : list

List of amplicons where each amplicon is a list of reads. This will be used to construct the frequency matrix.

include_pairs : bool (optional, default=False)

Whether or not to output the tuple (read, count) for each item in the frequency matrix rather than just count.

nthreads : int (optional, default=1)

The number of threads to use when counting reads per amplicon. Default value is single thread.

Returns :

freq_matrix : Numpy matrix

Frequency matrix where columns correspond to the normalized frequency (i.e. percentage) distributions of distinct reads in the amplicons and rows correspond to distinct read-representatives with their associated frequencies.