plot_seqlogo: Plot sequence logo based on list that consist of motifs and...

View source: R/plot_seqlogo.R

plot_seqlogoR Documentation

Plot sequence logo based on list that consist of motifs and sequences.

Description

Plot sequence logo based on list that consist of motifs and sequences.

Usage

plot_seqlogo(
  base_dir,
  foreground_sequences_mapped_to_motifs,
  plot_min_seqs = 5
)

Arguments

base_dir

A path used for saving plots.

foreground_sequences_mapped_to_motifs

A list that consist of motifs and sequences.

plot_min_seqs

A numeric value for cutoff, sequences of motifs greater than the cutoff are plotted, the default is 5.

Value

Plot sequence logo based on list that consist of motifs and sequences. The results will be saved in a folder named PhosMap_ggseqlogo in the BASE_DIR parameter specified directory.

Author(s)

Dongdong Zhan and Mengsha Tong

References

(1) Omar Wagih (2017). ggseqlogo: A 'ggplot2' Extension for Drawing Publication-Ready Sequence Logos. R package version 0.1.\ https://github.com/omarwagih/ggseqlogo; (2) Hadley Wickham (2018). stringr: Simple, Consistent Wrappers for Common String Operations. \ R package version 1.3.0. https://CRAN.R-project.org/package=stringr

Examples

## The process needs to load data from PhosMap datasets stored into FTP server and perform large computation.
## It may take a few minutes.
if(FALSE){
ftp_url <- "ftp://111.198.139.72:4000/pub/PhosMap_datasets/function_demo_data/plot_seqlogo.RData"
load_data <- load_data_with_ftp(ftp_url, 'RData')
writeBin(load_data, "plot_seqlogo.RData")
load("plot_seqlogo.RData")

BASE_DIR = getwd() # current working directory
BASE_DIR = normalizePath(BASE_DIR)
plot_seqlogo(BASE_DIR, foreground_sequences_mapped_to_motifs[1:50], plot_min_seqs = 25)

}

ecnuzdd/PhosMap documentation built on Dec. 7, 2022, 4:09 a.m.