RemoveAdapter {esATAC} | R Documentation

## Use AdapterRemoval to remove adapters

### Description

Use AdapterRemoval to remove adapters

### Usage

    atacRemoveAdapter(atacProc, adapter1 = NULL, adapter2 = NULL,
      fastqOutput1 = NULL, reportPrefix = NULL, fastqOutput2 = NULL,
      fastqInput1 = NULL, fastqInput2 = NULL, interleave = FALSE,
      paramList = NULL, findParamList = NULL, ...)

    ## S4 method for signature 'ATACProc'
    atacRemoveAdapter(atacProc, adapter1 = NULL,
      adapter2 = NULL, fastqOutput1 = NULL, reportPrefix = NULL,
      fastqOutput2 = NULL, fastqInput1 = NULL, fastqInput2 = NULL,
      interleave = FALSE, paramList = NULL, findParamList = NULL, ...)

    removeAdapter(fastqInput1, fastqInput2 = NULL, adapter1 = NULL,
      adapter2 = NULL, fastqOutput1 = NULL, reportPrefix = NULL,
      fastqOutput2 = NULL, interleave = FALSE, paramList = NULL,
      findParamList = NULL, ...)

### Arguments

`atacProc` | `ATACProc-class` object scalar. It has to be the return value of upstream process: `atacRenamer` `renamer` `atacUnzipAndMerge` `unzipAndMerge`
`adapter1` | `Character`. It is an adapter sequence for file1. For single end data, it is requied.
`adapter2` | `Character`. It is an adapter sequence for file2.
`fastqOutput1` | `Character`. The trimmed mate1 reads output file path for fastqInput2. Defualt: basename.pair1.truncated (paired-end), basename.truncated (single-end), or basename.paired.truncated (interleaved)
`reportPrefix` | `Character`. The prefix of report files path. Default: generate from known parameters
`fastqOutput2` | `Character`. The trimmed mate2 reads output file path for fastqInput2. Default: BASENAME.pair2.truncated (only used in PE mode, but not if –interleaved-output is enabled)
`fastqInput1` | `Character` vector. For single-end sequencing, it contains sequence file paths. For paired-end sequencing, it can be file paths with #1 mates paired with file paths in fastqInput2 And it can also be interleaved file paths when argument interleaved=`TRUE`
`fastqInput2` | `Character` vector. It contains file paths with #2 mates paired with file paths in fastqInput1 For single-end sequencing files and interleaved paired-end sequencing files(argument interleaved=`TRUE`), it must be `NULL`.
`interleave` | `Logical`. Set `TRUE` when files are interleaved paired-end sequencing data.
`paramList` | Additional arguments to be passed on to the binaries for removing adapter. See below for details.
`findParamList` | Additional arguments to be passed on to the binaries for identifying adapter. See below for details.
`...` | Additional arguments, currently unused.

### Details

The parameter related to input and output file path will be automatically obtained from `ATACProc-class` object 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 `removeAdapter` instead. You can put all aditional arguments in one `Character`(e.g. "–threads 8") with white space splited just like command line, or put them in `Character` vector(e.g. c("–threads","8")). Note that some arguments( "–file1","–file2","–adapter1","–adapter2","–output1","–output2", "–basename","–interleaved","thread") to the paramList and findParamList are invalid if they are already handled as explicit function arguments. See the output of `adapterremoval_usage()` for details about available parameters.

### Value

An invisible `ATACProc-class` object scalar for downstream analysis.

### Author(s)

Zheng Wei

### See Also

`atacRenamer` `renamer` `atacUnzipAndMerge` `unzipAndMerge` `atacBowtie2Mapping`

### Examples

    library(magrittr)
    td <- tempdir()
    options(atacConf=setConfigure("tmpdir",td))

    # Identify adapters
    prefix<-system.file(package="esATAC", "extdata", "uzmg")
    (reads_1 <-file.path(prefix,"m1",dir(file.path(prefix,"m1"))))
    (reads_2 <-file.path(prefix,"m2",dir(file.path(prefix,"m2"))))

    reads_merged_1 <- file.path(td,"reads1.fastq")
    reads_merged_2 <- file.path(td,"reads2.fastq")
    atacproc <-
    atacUnzipAndMerge(fastqInput1 = reads_1,fastqInput2 = reads_2) %>%
    atacRenamer %>% atacRemoveAdapter

    dir(td)

[Package esATAC version 1.6.1 Index]