calculate_probability: Calculate Joint Probability of Map

Description Usage Arguments Value

Description

calculate_probability takes a read and reference of equal length n, finds the positions of mismatch, then calculates the joint probability of the read mapping to the reference based on the given phred score. For a given position in a mapping and P being the probability of error at that position, the probability of mapping is 1 - P if the calls are the same, and P/3 if the calls are different. If there are no mismatches, the joint probability is (1 - P)^n.

Usage

1
calculate_probability(reference, read, phred_score)

Arguments

reference

The barcode sequence to which read maps to. Should be the same length as read.

read

The read sequence which maps to barcode. Should be the same length as barcode.

phred_score

A string of Phred scores. Each character is a representation of the probability that the corresponding base call is an error.

Value

Returns a scalar joint probability, which is the product of marginal probabilities obtained from phred_to_prob


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