map_reads: Map Reads to Reference Barcodes

Description Usage Arguments Value Examples

Description

map_reads is the primary workhorse of this package. It iterates through the reads_table, finds the barcodes that are within 2 Hamming distances, and then computes the probability of the read mapping to each barcode that is within 2 Hamming distances. Then, out of this list of probabilities, it selects the first barcode with the greatest probability of being a match.

Usage

1
map_reads(barcodes_table, reads_table, distance_threshold = 2)

Arguments

barcodes_table

The full table of reference barcodes, which contains a column titled Labels, which contains the sequence ID, and another called Code, which contains the barcode sequence.

reads_table

The full table of reads, which contains a column titled Read_ID, another called Called_Read, and a third column titled Phred_Score.

distance_threshold

Integer specifying the Hamming distance threshold for which we want to filter barcodes

Value

Returns the original reads table along with the barcode that was mapped and the probability of the map.

Examples

1
2
3
4
5
6
library(dplyr)
library(SequenceMapper)

mapped_reads <- map_reads(reads_table = reads_table, barcodes_table = barcodes_table)
mapped_reads %>% group_by(mapped_barcodes) %>%
     summarize(Number_Mapped = n(), Proportion_Mapped = n()/nrow(mapped_reads))

Benji-Wagner/SequenceMapper documentation built on June 6, 2019, 1:08 p.m.