predNuCpos: R function for prediction of nucleosome positioning

Description Usage Arguments Value Examples

View source: R/predNuCpos.R

Description

Like the predNuPoP function of the parental package NuPoP does, this function invokes Fortran codes to compute the Viterbi prediction of nucleosome positioning, nucleosome occupancy score and histone binding affinity score. Nucleosomal and linker models built upon the chemical maps are used for the calculation.

When ActLikePredNuPoP is TRUE, this function acts like the predNuPoP function of NuPoP: the function receives the path to a file containing a DNA sequence (specified by file) and save a text file containing the prediction results in the working directory. Nucleosome positioning throughout a long chromosome containing ‘N’ can be predicted.

When ActLikePredNuPoP is FALSE (dafault), this function directly receives a DNA sequence as an R object (inseq) and returns the prediction results as a data frame. ‘N’ must not be in the sequence.

Usage

1
2
predNuCpos(file, inseq, species="mm", smoothHBA=FALSE, 
    std=FALSE, ActLikePredNuPoP = FALSE)

Arguments

file

The file path to the FASTA file to be tested. The FASTA must be in a single FASTA format. This will be ignored when ActLikePredNuPoP = FALSE.

inseq

a character or DNAString object. The length of the character string must be over 1 kb. This will be ignored when ActLikePredNuPoP = TRUE.

species

a character = mm, sc or sp; "mm" for mouse, "sc" for S. cerevisiae and "sp" for S. pombe.

smoothHBA

a logical value indicating whether smoothing of histone binding affinity should be applied as in the predNuPoP function of the parental package NuPoP.

std

a logical value indicating whether standardization should be applied to the histone binding affinity score.

ActLikePredNuPoP

a logical value indicating whether the function acts like the predNuPoP function in the parental package NuPoP.

Value

When the ActLikePredNuPoP argument is set as TRUE, predNuCpos outputs the prediction results into the working directory, in the same format as that generated by the predNuPoP function of NuPoP. Thus, it can be handled by the NuPoP functions readNuPoP and plotNuPoP. The output file is named after the input file with an extension “_Prediction4.txt”. The output file has five columns:

Position

position in the input DNA sequence

P-start

probability that a nucleosome starts at

Occup

nucleosome occupancy score

N/L

Viterbi path (1 and 0 for the nucleosome and linker states, repsectively)

Affinity

histone binding affinity score

When the ActLikePredNuPoP argument is set as FALSE, predNuCpos outputs the prediction results as a data frame object with five columns, on which the plotNuPoP function of NuPoP can be applied:

pos

position in the input DNA sequence

pstart

probability that a nucleosome starts at

nucoccup

nucleosome occupancy score

viterbi

Viterbi path (1 and 0 for the nucleosome and linker states, repsectively)

affinity

histone binding affinity score

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
predNuCpos(file = system.file("extdata", "TRP1ARS1x1.fasta", 
    package="nuCpos"), species="sc", smoothHBA=FALSE, 
    std=FALSE, ActLikePredNuPoP = TRUE)
library(NuPoP)
results.TRP1ARS1.1 <- readNuPoP("TRP1ARS1x1.fasta_Prediction4.txt", 
    startPos = 1, endPos = 1465)
results.TRP1ARS1.1[72:76,]
plotNuPoP(results.TRP1ARS1.1)
TRP1ARS1 <- paste(scan(file = 
    system.file("extdata", "TRP1ARS1x1.fasta", package = "nuCpos"), 
    what = character(), skip = 1), sep = "", collapse = "")
results.TRP1ARS1.2 <- 
    predNuCpos(inseq = TRP1ARS1, species = "sc", smoothHBA = FALSE, 
    ActLikePredNuPoP = FALSE)
results.TRP1ARS1.2[72:76,]
plotNuPoP(results.TRP1ARS1.2)
## The DNA sequence TRP1ARS1 is from Fuse et al. (2017).

Example output

/usr/lib/R/site-library/nuCpos/extdata/TRP1ARS1x1.fasta_Prediction4.txt was created in the working directory.
   Position P.start Occup N/L Affinity
72       72   0.001 0.893   1       NA
73       73   0.000 0.893   1       NA
74       74   0.000 0.893   1    0.346
75       75   0.000 0.893   1   -4.435
76       76   0.000 0.893   1   -3.429
Read 1 item
species: sc
   pos       pstart  nucoccup viterbi   affinity
72  72 9.802925e-04 0.8926019       1         NA
73  73 3.182192e-04 0.8929201       1         NA
74  74 5.025299e-05 0.8929704       1  0.3456824
75  75 5.160730e-06 0.8929756       1 -4.4353083
76  76 1.397652e-06 0.8929769       1 -3.4287470

nuCpos documentation built on Nov. 8, 2020, 5:33 p.m.