GithubHelp home page GithubHelp logo

kvnkuang / rweblogo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from omarwagih/rweblogo

0.0 1.0 0.0 4.83 MB

RWebLogo is a wrapper R package for the popular WebLogo that allows plotting of customised sequence logos.

License: Other

R 100.00%

rweblogo's Introduction

What is RWebLogo?

RWebLogo is a wrapper package for the WebLogo python package that can create customised sequence logos in R. Sequence logos are graphical representations of the sequence conservation of nucleotides (in a strand of DNA/RNA) or amino acids (in protein sequences). Each logo consists of stacks of symbols, one stack for each position in the sequence. The overall height of the stack indicates the sequence conservation at that position, while the height of symbols within the stack indicates the relative frequency of each amino or nucleic acid at that position. In general, a sequence logo provides a richer and more precise description of, for example, a binding site, than would a consensus sequence.

Getting started

To start using RWebLogo, ensure you have Python 2.6 or greater installed in your path. Then, install and load RWebLogo from CRAN:

install.packages('RWebLogo')
library('RWebLogo')

Plotting a sequence logo

Plotting a sequence logo is easy. Simply provide a character vector of the aligned sequences into the weblogo function

# Example alignment
aln <- c('CCAACCCAA', 'CCAACCCTA', 'AAAGCCTGA', 'TGAACCGGA')
# Generate the logo in the file mylogo.pdf
weblogo(seqs=aln, file.out='mylogo.pdf')

Lets add some text!

weblogo(seqs=aln, file.out='mylogo.pdf', errorbars=FALSE, title='Yay, No error bars!', fineprint='RWebLogo 1.0', label='1a')

We can also change the format of the output:

weblogo(seqs=aln, format='png', file.out='mylogo.png')

or change the axis labels:

weblogo(seqs=aln, file.out='mylogo.pdf', xlabel='My x-axis', ylabel='Awesome bits')

Lets try plot a web logo to the R graphics device:

weblogo(seqs=aln, plot=TRUE, open=FALSE, format='jpeg', resolution=600)

Alternatively, you could provide sequences from an external file using one of the formats supported by WebLogo. Here's an example using the a file with the Multiple Sequence Format (msf)
# Get path to file
fpath = system.file("extdata", "example_data.msf", package="RWebLogo")
# Generate the logo 
weblogo(file.in=fpath, file.out='mylogo_msf.pdf')

It's as simple as that!

Help

See ?weblogo for more awesome options ?plotlogo for more information on plotting jpeg sequence logos to the R graphics device. The manual for the original WebLogo python library can be found here.

A full detailed pdf manual can be found on the CRAN package page

If you're having trouble setting things up or have any questions feel free to drop me a line at [email protected]. If you have a feature request or would like to report a bug, please submit it to the issues section.

rweblogo's People

Contributors

kvnkuang avatar omarwagih avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.