generatePairsProbabilityMatrix: Generates a matrix of base pair probabilities

Description Usage Arguments Value Examples

View source: R/ncRNAtools_secondaryStructurePredictionFunctions.R

Description

Generates a matrix of base pair probabilities from a table of base pair probabilities in the format returned by predictSecondaryStructure when using centroidFold or centroidHomFold as the prediction method.

Usage

1
generatePairsProbabilityMatrix(basePairProbsTable)

Arguments

basePairProbsTable

A dataframe where each line corresponds to a nucleotide of the query RNA sequence. The first column indicates the position number, the second column indicates the corresponding nucleotide type and additional columns indicating the probability of forming a base pair with other nucleotides. The potentially pairing nucleotides and their corresponding probabilities should be provided as strings, with a colon separating both fields.

Value

A symmetric square matrix with a number of rows and columns equal to the number of nucleotides in the corresponding RNA sequence, determined by the number of rows of basePairProbsTable. The names of rows and columns are the nucleotide type and position. The value of each cell of the matrix is the probability that the nucleotides at positions given by the row and columns of the cell form a base pair.

Examples

1
2
3
4
5
6
7
8
9
# Load an example table of base pair probabilities, calculated with centroidFold:

basePairProbabilitiesTable <- read.csv(system.file("extdata", 
"exampleBasePairProbabilitiesTable.csv", package="ncRNAtools"))

# Generate a base pair probability matrix from the returned base pair probability
# table:

basePairProbabilityMatrix <- generatePairsProbabilityMatrix(basePairProbabilitiesTable)

LaraSellesVidal/ncRNAtools documentation built on Oct. 17, 2020, 6:03 a.m.