readMethtuple: Read '.tsv' output files from 'methtuple' software.

Description Usage Arguments Value Parallelisation See Also Examples

Description

Read the .tsv output files from methtuple and construct a single MethPat object. methtuple (www.github.com/PeteHaitch/methtuple) is Python software to extract methylation patterns at methylation loci from BAM files. All files should contain the same size m-tuples, e.g., all 2-tuples. All files should be mapped against the same reference genome, which is supplied as the seqinfo argument.

Usage

1
2
3
readMethtuple(files, sample_names = paste0("sample_", seq_along(files)),
  methinfo = MethInfo(), seqinfo = NULL, verbose = getOption("verbose"),
  bpparam = bpparam())

Arguments

files

The .tsv files created by comethylation. These files may be compressed with gzip or bzip2 (not yet implemented). All files must contain the same sized m-tuples. Files will be decompressed to a temporary directory via a call to tempdir.

sample_names

The sample names of each file. Must be unique.

methinfo

A MethInfo object containing information about the the methylation loci in the files. This should be the minimal MethInfo object necessary to describe all methylation loci in all files. For example, if reading in two files, one with CG and one with CHG methylation, then the methinfo should be MethInfo(c('CG', 'CHG')). NB: It is generally recommended that you only store samples with the same methinfo in each MethPat object.

seqinfo

A Seqinfo object containing information about the reference genome of the samples. If none is supplied (NULL) then a bare-bones Seqinfo object will be created containing only the seqnames inferred from the files.

verbose

A logical(1) indicating whether messages about the reading of the data (via data.table::fread) and about data coercion during construction of the MethPat object should be printed. Regardless of whether verbose is TRUE or FALSE, readMethtuple reports its progress via calls to message; these can be suppressed by wrapped the call to readMethtuple in suppressMesssages.

bpparam

A bpparam object specifying the parallelisation strategy, if any. See below for a discussion of parallelisation options available with readMethtuple.

Value

A MethPat object

Parallelisation

Parallelisation of readMethtuple is partially supported. Files may be decompressed in parallel but not read-in in parallel. Parallelisation uses the BiocParallel package. By default this uses a MulticoreParam() instance or the user's preferred back-end if they have used register. Please consult the BiocParallel documentation for details on registering a parallel backend and parallelisation support available on different operating systems.

See Also

MethPat

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Using example data supplied with the MethylationTuples package
# Each file contains data on 20,000 tuples from a whole-genome
# bisulfite-sequencing experiment on a human frontal cortex sample
# (http://www.ncbi.nlm.nih.gov/sra/?term=SRR949193).

# 1-tuples
x <- readMethtuple(system.file("extdata", "SRR949193_20k.rmdup.CG.1.tsv.gz",
package = "MethylationTuples"), sample_names = "SRR949193_20k",
methinfo = MethInfo('CG'), seqinfo = Seqinfo(seqnames = 'chr1',
seqlengths = 249250621, isCircular = FALSE, genome = 'hg19'))

# 3-tuples
y <- readMethtuple(system.file("extdata", "SRR949193_20k.rmdup.CG.3.tsv.gz",
package = "MethylationTuples"), sample_names = "SRR949193_20k",
methinfo = MethInfo('CG'), seqinfo = Seqinfo(seqnames = 'chr1',
seqlengths = 249250621, isCircular = FALSE, genome = 'hg19'))

# Can't mix 1-tuples and 3-tuples
## Not run: 
readMethtuple(c(system.file("extdata", "SRR949193_20k.rmdup.CG.1.tsv.gz",
package = "MethylationTuples"), system.file("extdata",
"SRR949193_20k.rmdup.CG.3.tsv.gz", package = "MethylationTuples")))

## End(Not run)

PeteHaitch/MethylationTuples documentation built on May 8, 2019, 1:30 a.m.