| |
- barcodes_to_vector(barcodes)
- Helper function to turn an array of strings into
a array of uint8 with an extra dimension of the characters
of the string
- calc_barcode_distances(reads, library, counts=None, max_edit_distance=None, read_mask=None, dtype=<class 'numpy.float32'>, reads_needed=None)
- Calculates a full distance matrix between reads and a barcode library.
reads: array of barcode sequences, or 2d array if multiple reads are specified
per entry
library: same as reads, array or 2d array of barcode sequences
counts (optional): Integer array same shape as reads, can be used to specify
counts of each read.
- call_reads(cells, poses, values, num_reads=8, distance_threshold=None, quality_threshold=None)
- Function to collect detected reads into cells
cells: int array of shape (W, H)
A segmentation mask of cells, 0 is the background and all values N>0 correspond
to the mask of cell N.
poses: int array of shape (N, 2)
The positions of the reads found.
values: float array of shape (N, cycle, channel)
The values of the reads across all cycles and channels.
- cluster_reads(values, distance_threshold=None)
- Clusters the values of many reads to determine which reads
are likely to belong to the same sequence, despite errors
that may have altered their sequence.
- edit_distance(barcode1, barcode2, out=None)
- Calculates edit distance of packed barcodes. Limit specifies a limit for the distance,
if for example you only care about distances lower than 2 this will limit the computation.
- euclidean_distance(poses1, poses2)
- filter_reads(values, quality_threshold=None)
- Filters out reads that are clearly not true reads.
- make_edit_distance_table()
- match_barcodes(reads, counts, library, max_edit_distance=0, return_distances=False, debug=True, progress=False)
- Matches each set of reads given with a library barcode or set of barcodes.
If max_edit_distance is nonzero, it will also try to match barcodes that differ
in less that or equal to that many bases.
- match_barcodes_bad(reads, counts, library, max_edit_distance=0, debug=True, progress=False)
- Matches each set of reads given with a library barcode or set of barcodes.
If max_edit_distance is nonzero, it will also try to match barcodes that differ
in less that or equal to that many bases.
- match_barcodes_nn(reads, counts, library, max_edit_distance=0)
- pack_barcodes(barcodes, dtype=None, out=None)
- Helper function that converts strings of 'GTAC' into packed integers or byte strings.
Because there are only 4 possibilities for each character, we can use two bits to represent
them and allow for much faster comparisons and edit distance computation.
dtype can be an unsigned integer type or bytes, if it is None it will default to uint64 unless
the barcodes are longer than 32 characters
- unpack_barcodes(barcodes, length=None, out=None)
- Reverse function to utils.pack_barcodes that converts the packed integer values back to sequences.
Importantly, this function will not give the exact same sequence given into pack_barcodes. The
length of the barcode is not stored, so if not specified it will decode as many bases as the underlying
dtype can hold.
|