BedUtils: process bed file with limit memory

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function is used to merge interleave paired end reads in bed, downsample bed reads, shift bed reads, filter bed reads according to chromosome, filter bed reads according to fragment size, sort bed, remove duplicates reads in bed.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
atacBedUtils(
  atacProc,
  bedInput = NULL,
  bedOutput = NULL,
  mergePair = FALSE,
  downSample = NULL,
  posOffset = 0L,
  negOffset = 0L,
  chrFilterList = c("chrM"),
  select = FALSE,
  sortBed = FALSE,
  uniqueBed = FALSE,
  minFragLen = 0,
  maxFragLen = 2e+09,
  newStepType = "BedUtils",
  ...
)

## S4 method for signature 'ATACProc'
atacBedUtils(
  atacProc,
  bedInput = NULL,
  bedOutput = NULL,
  mergePair = FALSE,
  downSample = NULL,
  posOffset = 0L,
  negOffset = 0L,
  chrFilterList = c("chrM"),
  select = FALSE,
  sortBed = FALSE,
  uniqueBed = FALSE,
  minFragLen = 0,
  maxFragLen = 2e+09,
  newStepType = "BedUtils",
  ...
)

bedUtils(
  bedInput,
  bedOutput = NULL,
  mergePair = FALSE,
  downSample = NULL,
  reportOutput = NULL,
  posOffset = 0L,
  negOffset = 0L,
  chrFilterList = c("chrM"),
  select = FALSE,
  sortBed = FALSE,
  uniqueBed = FALSE,
  minFragLen = 0,
  maxFragLen = 2e+09,
  newStepType = "BedUtils",
  ...
)

Arguments

atacProc

ATACProc-class object scalar. It has to be the return value of upstream process: atacBam2Bed bam2bed atacSamToBed samToBed

bedInput

Character scalar. Bed file input path.

bedOutput

Character scalar. Bed file output path.

mergePair

Logical scalar Merge paired end interleave reads.

downSample

Integer scalar Down sample reads if the number is less than total number

posOffset

Integer scalar The offset that positive strand reads will shift.

negOffset

Integer scalar The offset that negative strand reads will shift.

chrFilterList

Character vector The chromatin(or regex of chromatin) will be retain/discard if select is TRUE/FALSE

select

Logical scalar The chromatin in chrFilterList will be retain if TRUE. default: FALSE

sortBed

Logical scalar Sort bed file in the order of chromatin, start, end

uniqueBed

Logical scalar Remove duplicates reads in bed if TRUE. default: FALSE

minFragLen

Integer scalar The minimum fragment size will be retained.

maxFragLen

Integer scalar The maximum fragment size will be retained.

newStepType

Character scalar. New step type name for different default parameters.

...

Additional arguments, currently unused.

reportOutput

Character scalar. Report output file path.

Details

The parameter related to input and output file path will be automatically obtained from ATACProc-class object(atacProc) or generated based on known parameters if their values are default(e.g. NULL). Otherwise, the generated values will be overwrited. If you want to use this function independently, you can use bedUtils instead.

Value

An invisible ATACProc-class object scalar for downstream analysis.

Author(s)

Zheng Wei

See Also

atacBam2Bed bam2bed atacSamToBed samToBed atacFragLenDistr atacExtractCutSite atacPeakCalling atacTSSQC atacBedToBigWig

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(R.utils)
library(magrittr)
td <- tempdir()
setTmpDir(td)

sambzfile <- system.file(package="esATAC", "extdata", "Example.sam.bz2")
samfile <- file.path(td,"Example.sam")
bunzip2(sambzfile,destname=samfile,overwrite=TRUE,remove=FALSE)
atacproc<-samToBed(samInput = samfile) %>%
atacBedUtils(maxFragLen = 100, chrFilterList = NULL)

esATAC documentation built on Nov. 8, 2020, 6:58 p.m.