plotPartial: This function plots the conservity for selected alignment...

Description Usage Arguments Value References Examples

View source: R/plotConser.R

Description

This function plots the conservity for selected alignment region from user using the conservity vector.

Usage

1
plotPartial(conserV, firstIndex, lastIndex)

Arguments

conserV

a vector with serveral number of conservity

firstIndex

a number to point the start index of selected region

lastIndex

a number to point the end index of selected region

Value

a plot to view the seleted region alignment's conservity

References

R - Bar Charts: Bar Chart Labels, Title and Colors. Tutorialpoints-R Tutorial Link

Silva, A. (2020) TestingPackage: An Example R Package For BCB410H. Unpublished. Link

R Bar Plot (2018) DataMentor Getting Started in Data Science With R Link

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# Example 1: Plot a conservity against of each position for testSeqShort
# from position 2 to 15
data(testSeqShort)
testSeq <- testSeqShort
# Use conservityTable() to create table for testSeqShort,
# and pass it to plotOverall() for plotting
table  <- conservityTable(testSeq)
oPar <- par(mar = c(2, 4, 2, 1)) # Set plot parameters to layout plot in center.
plotPartial(table, 2, 15)

# Example 2: Plot a conservity against of each position for raw data
# from position 50 to 100
# sampleSeq3.txt. This should takes longer time to run.
findpath <- system.file("extdata", "sampleSeq3.txt", package = "conservedPos")
rawSeq <- Biostrings::readBStringSet(findpath,"fasta")

# Use conservityTable() to create table for rawSeq,
# and pass it to plotOverall() for plotting
table  <- conservityTable(testSeq)
oPar <- par(mar = c(2, 4, 2, 1)) # Set plot parameters to layout plot in center.
plotPartial(table, 50, 100)

hezijin/conservedPos documentation built on Jan. 1, 2021, 3:18 a.m.