CPScalc: Codon pair score calculator

Description Usage Arguments Value Examples

Description

Calculate the codon pair score of a sequence relative to a reference codon pair bias.

Usage

1
2
CPScalc(sequence, reference, start = 1, end = NULL, draw = TRUE,
  windowSize = NULL, silent = FALSE)

Arguments

sequence

Sequences can be input directly as a character string or as the file path to a fasta file.

reference

Reference CPB table. See CPBtable.

start

Nucleotide position in the sequence marking the region of the sequence to use for calculation.

end

Nucleotide position in the sequence marking the region of the sequence to use for calculation.

draw

If TRUE, a line plot showing the local CPS along the length of the sequence is output to the graphics device.

windowSize

CPS line plots are smoothed by locally weighted polynomial regression where windowSize designates the number of nucleotides over which individual codon pair scores are smoothed. If NULL, smoothing spans 7.5% of the sequence length.

silent

If TRUE the progress bar is suppressed.

Value

An invisible list is returned:

averageCPS

Average of the individual codon pair scores of the input sequence.

totalCPS

Numeric vector containing the individual codon pair scores along the sequence length.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
fastaLocation <- system.file('tbevns5.fasta', package = 'CPBias')
tbev <- importFasta(fastaLocation)[[1]]
tbevCPS <- CPScalc(tbev, Homo.sapiens)
tbevCPS[[1]]

# Can plot a smoothed line plot with CPScalc output as it is done in
# CPSplot()
CPSx <- 1:length(tbevCPS[[2]])
smoothCPS <- loess(tbevCPS[[2]] ~ CPSx, span = (.05), degree = 2)
lineCPS <- predict(smoothCPS)
plot(lineCPS, type='l')

alex-sbu/CPBias documentation built on May 11, 2019, 11:24 p.m.