Learn R Programming

Pasha (version 0.99.21)

WigRepeatAnalyzer: WIG Repeat Analyzer

Description

This script aims at analyzing the distribution (in coverage and score) of a signal (stored in a WIG file) according to genome repeat annotations.

Usage

WigRepeatAnalyzer(filename, inputFolder, outputFolder="./", repeatMaskerFilePath, isRegex=FALSE)

Arguments

filename
An atomic character string. The file name of the wig file (fixed step WIG).
inputFolder
An atomic character string. The path to the wig file (fixed step WIG).
outputFolder
An atomic character string. The path to the folder where analysis results must be stored.
repeatMaskerFilePath
An atomic character string. The path to the file containing the repeat annotations (Repeat Masker file).
isRegex
An atomic logical. If TRUE, the filename parameter is interpreted as a regular expression (LC_SYNTAX) and the script will search for a unique file corresponding to the provided regular expression. If no or several file are found, the scripts ends with error.

Value

Barplot figures and text files of raw data for coverage and weight of repeat classes and families.

Details

The script consider the part of the signal contained in the WIG file that fall into repeat annotations provided by user.

This annotation file must formatted as the Repeat Masker annotations file provided by UCSC. The required information are:

  • Column 6 : Chromosome name
  • Column 7 : Start position
  • Column 8 : End position
  • Column 12 : Repeat Class
  • Column 13 : Repeat Family

The script compute the coverage of each repeat class and family (i.e. the percentage of positions falling into each annotations) and the weight of each class and family (i.e. the percentage of score falling into each annotations). All results are provided as barplots figures and text files.

See Also

processPipeline

Examples

Run this code
# Build temp dir
exampleFolder <- tempdir()

# Generate artificial wig fixed step files with random counts
nbChromosomes <- 1
bin_size <- 200
wigScoresContent <- lapply(as.list(1:nbChromosomes), 
     function(y) {sample(x=1:20,
                         size=floor(4333587/bin_size), 
                         replace=TRUE,
                         prob=NULL)})
names(wigScoresContent) <- 1:nbChromosomes

writeWIG(wigScoresContent,
         "wigFileExample",
         folder=exampleFolder, 
         fixedStep=bin_size)

# Define input file
my_wig_file <- "wigFileExample.wig"

# Define the RepeatMasker file
my_repeat_masker_file <- system.file("extdata",
                                     "mm9_RepeatMasker_2000l.txt",
                                     package="Pasha")

## Not run: 
# # Launch the script
# result <- WigRepeatAnalyzer(filename=my_wig_file, 
#                             inputFolder=exampleFolder,
#                             outputFolder=exampleFolder, 
#                             repeatMaskerFilePath=my_repeat_masker_file)
# ## End(Not run) 

Run the code above in your browser using DataLab