Learn R Programming

RRNA (version 1.2)

loadCoords: Loads a coordinate file into a data frame

Description

Coordinate files can be created from the viennaRNA library.

Usage

loadCoords(filename)

Value

Data frame containing the coordinate file

Arguments

filename

Name of the coordinate file being loaded

Author

JP Bida

References

The RRNAFold program generates the coordinate files used by RRNA

https://github.com/jpbida/ViennaScripts

Examples

Run this code
### Create a test coordinate file using ct2coord ###
ct=makeCt("((((...(((((((.........)))))))...((((.........))))...))))",
          "AAAAAAAACCCCCCCCAAAGGGGGGGAUUACCCCUCCUUUAAAAGGGUUUUCCCCCCC" 
         )
coord=ct2coord(ct)
### add an id ###
coord$id=1
f = tempfile()
### write out test file ###
write.table( coord[,c('id','x','y','seq','num','bound')],
             col.names=FALSE,row.names=FALSE,sep=",",file=f
           )

### Read in the coordinate file ##
input=loadCoords(f)

### Plot the file using RNAPlot ##
RNAPlot(input)

Run the code above in your browser using DataLab