repair {Rsubread} | R Documentation

## Re-Order Paired-End Reads to Place Reads

### Description

Fast re-ordering of paired-end reads using read names and mapping locations.

### Usage

    repair(

        inFiles,
        inFormat = "BAM",
        outFiles = paste(inFiles,"repair",sep="."),
        addDummy = TRUE,
        fullData = TRUE,
        compress = FALSE,
        nthreads = 8)

### Arguments

`inFiles` | a character vector giving names of input files. These files are typically location-sorted BAM files.
`inFormat` | a character string specifying format of input files. Supported formats include `BAM` and `SAM`.
`outFiles` | a character string giving names of output files. Re-ordered reads are saved to BAM-format files.
`addDummy` | logical indicating if a dummy read will be added to each singleton read which has a missing pair in the input. `TRUE` by default.
`fullData` | logical indicating if sequences and base-calling quality scores of reads will be included in the output. `TRUE` by default.
`compress` | logical indicating if compression should be turned on when generating BAM output. `FALSE` by default.
`nthreads` | a numeric value giving number of CPU threads. 8 by default.

### Details

This function takes as input paired-end BAM or SAM files, re-orders reads to make reads from the same pair be adjacent to each other and outputs the re-ordered reads into new BAM files.

The function makes use of both read names and mapping information of reads (eg. mapping coordinates) to identify reads belonging to the same pair. This makes sure that all paired-end reads are correctly re-ordered, especially those multi-mapping read pairs that include more than one reported alignment in the input.

The BAM files produced by this function are compatible with `featureCounts`, meaning that no further re-ordering needs to be performed by `featureCounts`.

### Value

No value is produced but BAM files with re-ordered reads are written to the current working directory.

### Author(s)

Wei Shi and Yang Liao

[Package Rsubread version 2.2.6 Index]