pairsToSecondaryStructure: Generates a string with the secondary structure of an RNA...

Description Usage Arguments Value Examples

View source: R/ncRNAtools_secondaryStructurePredictionFunctions.R

Description

Generates a string with the secondary structure of an RNA sequence from a table of paired bases.

Usage

1

Arguments

pairedBases

A dataframe where each row contains the information of two bases that form a pair. The dataframe should contain columns named "Position1" and "Position2" indicating respectively the positions of the 5' and 3' bases involved in the base pair.

sequence

string with the RNA sequence corresponding to the provided table of paired bases. Should contain only standard RNA symbols (i.e., "A", "U", "G" and "C"), and no spaces or newlines.

Value

A string representing the secondary structure of the provided RNA in the Dot-Bracket format.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Read a Dot Bracket file with the secondary structure of an RNA sequence:

exampleDotBracketFile <- system.file("extdata", "exampleDotBracket.dot", 
                                     package="ncRNAtools")

exampleDotBracket <- readDotBracket(exampleDotBracketFile)

# Generate a dataframe of paired bases from the returned secondary structure
# string:

pairedBasesTable <- findPairedBases(secondaryStructureString=exampleDotBracket$secondaryStructure,
sequence=exampleDotBracket$sequence)

# Generate a secondary structure string from the table of paired bases:

secondaryStructureString <- pairsToSecondaryStructure(pairedBasesTable,
exampleDotBracket$sequence)

# Verify that the resulting secondary structure string is equal to the original
# prediction:

secondaryStructureString == exampleDotBracket$secondaryStructure

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