Last data update: 2014.03.03

R: A function for reading data from the YAMA methylation aligner...
readMethsR Documentation

A function for reading data from the YAMA methylation aligner (or similarly parsed data) from which to identify methylation loci and/or differentially methylated regions.

Description

This function takes as input a set of files that describe the number of times a set of cytosines are observed to be methylated or unmethylated in some high-throughput sequencing data. It merges the data from these files into an object of 'alignmentMeth' class which can then be further processed to identify methylation loci.

Usage

readMeths(files, dir = ".", libnames, replicates, nonconversion, chrs)

Arguments

files

A character vector defining the file names of the alignment files to be read in.

dir

The directory in which the files are located.

libnames

A character vector giving the names of the samples to be read in.

replicates

A vector defining the replicate structure of the data. The ‘i’th and ‘j’th libraries are treated as replicates if and only if replicates[i] == replicates[j].

nonconversion

A numeric vector (all members should lie between 0 and 1) defining the non-conversion rate of each library. See alignmentMeth-class for details.

chrs

An (optional) character vector giving the names of the chromosomes to be read from the files. If ommitted, all chromosomes will be read in.

Value

An object of class alignmentMeth.

Author(s)

Thomas J. Hardcastle

See Also

alignmentMeth-class.

Examples

datadir <- system.file("extdata", package = "segmentSeq")
files <- c("short_18B_C24_C24_trim.fastq_CG_methCalls",
"short_Sample_17A_trimmed.fastq_CG_methCalls",
"short_13_C24_col_trim.fastq_CG_methCalls",
"short_Sample_28_trimmed.fastq_CG_methCalls")

mD <- readMeths(files = files, dir = datadir,
libnames = c("A1", "A2", "B1", "B2"), replicates = c("A","A","B","B"),
nonconversion = c(0.004777, 0.005903, 0.016514, 0.006134))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(segmentSeq)
Loading required package: baySeq
Loading required package: GenomicRanges
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

The following objects are masked from 'package:base':

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: GenomeInfoDb
Loading required package: abind
Loading required package: perm
Loading required package: ShortRead
Loading required package: BiocParallel
Loading required package: Biostrings
Loading required package: XVector
Loading required package: Rsamtools
Loading required package: GenomicAlignments
Loading required package: SummarizedExperiment
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/segmentSeq/readMeths.Rd_%03d_medium.png", width=480, height=480)
> ### Name: readMeths
> ### Title: A function for reading data from the YAMA methylation aligner
> ###   (or similarly parsed data) from which to identify methylation loci
> ###   and/or differentially methylated regions.
> ### Aliases: readMeths
> ### Keywords: files ~kwd2
> 
> ### ** Examples
> 
> datadir <- system.file("extdata", package = "segmentSeq")
> files <- c("short_18B_C24_C24_trim.fastq_CG_methCalls",
+ "short_Sample_17A_trimmed.fastq_CG_methCalls",
+ "short_13_C24_col_trim.fastq_CG_methCalls",
+ "short_Sample_28_trimmed.fastq_CG_methCalls")
> 
> mD <- readMeths(files = files, dir = datadir,
+ libnames = c("A1", "A2", "B1", "B2"), replicates = c("A","A","B","B"),
+ nonconversion = c(0.004777, 0.005903, 0.016514, 0.006134))
Reading files.......done!
Finding unique cytosines......done!
Processing samples.......done!
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>