cmpSites: cmpSites() This function compares (potential) methylation...

Description Usage Arguments Value Examples

View source: R/cmpSites.R

Description

cmpSites() This function compares (potential) methylation sites between two samples.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
cmpSites(
  sample1hsm,
  sample1scd,
  sample1label,
  sample2hsm,
  sample2scd,
  sample2label,
  nbrpms,
  plotfile,
  covlist,
  hheight,
  nbrpnts = 5000
)

Arguments

sample1hsm

A methylRaw object for hsm sites of sample 1.

sample1scd

A methylRaw object for scd sites of sample 1.

sample1label

A string serving as a label for sample 1.

sample2hsm

A methylRaw object for hsm sites of sample 2.

sample2scd

A methylRaw object for scd sites of stample 2.

sample2label

A string serving as a label for sample 2.

nbrpms

Integer representing the number of potential methylation sites in the genome; typically derived from the input *.par file.

plotfile

If specified other than the default "", then plots are saved in PDF file "plotfile".pdf; otherwise no plots are generated.

covlist

A vector listing the coverage (number of reads) values to be explored; e.g., c(6,8,10) would compare sites with minimum coverage 6, 8, and 10, successively

hheight

Histogram height for methylation level plot; default: 0.10

nbrpnts

Number of common sites to be sampled for the methylation levels scatter plot; default: 5000

Value

A list of data frames containing data on unique and common sites comparing the two samples.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
  mydatf <- system.file("extdata","Am.dat",package="BWASPR")
  myparf <- system.file("extdata","Am.par",package="BWASPR")
  myfiles <- setup_BWASPR(datafile=mydatf,parfile=myparf)
  nbrpms  <- as.numeric(myfiles$parameters[
    myfiles$parameters$Variable == "TOTALNBRPMSITES",2])
  AmHEhsm <- mcalls2mkobj(myfiles$datafiles,species="Am",study="HE",
                          type="CpGhsm", mincov=1,assembly="Amel-4.5")
  AmHEscd <- mcalls2mkobj(myfiles$datafiles,species="Am",study="HE",
                          type="CpGscd", mincov=1,assembly="Amel-4.5")
  s1hsm <- methylKit::getData(AmHEhsm[[1]])
  s1scd <- methylKit::getData(AmHEscd[[1]])
  s2hsm <- methylKit::getData(AmHEhsm[[2]])
  s2scd <- methylKit::getData(AmHEscd[[2]])
  mydflist <- cmpSites(s1hsm,s1scd,"Am_HE_fr",s2hsm,s2scd,"Am_HE_rn",nbrpms,
                       plotfile="pwc.pdf",covlist=c(6,10,20),hheight=0.10,
                       nbrpnts=5000)

BrendelGroup/BWASPR documentation built on Feb. 6, 2022, 9:09 a.m.