Learn R Programming

RRNA (version 1.2)

backward: Internal function for moving through secondary structures

Description

Given a bracket notation for RNA secondary structure and an index of a ")" bracket type the backward function will find the "(" bracket that closes the ")" at the given index.

Usage

backward(stc, i)

Value

returns the index of the bracket that closes the bracket at the given index

Arguments

stc

Array of brackets and dots. a=unlist(strsplit("(((...)))...((..))",""))

i

index giving the position of a bracket

Author

JP Bida

Examples

Run this code
a=unlist(strsplit("(((...)))...((..))",""))
ind=backward(a,7)

Run the code above in your browser using DataLab