pairReads {GOTHiC} | R Documentation

## Function pairs aligned paired NGS reads

### Description

This function takes bowtie output files, pairs the reads, only keeps those where both ends mapped, filters for perfect duplicates to avoid PCR bias, and saves and returns a GenomicRangesList object that contains the paired_reads_1 and paired_reads_2 GenomicRanges with the paired reads

### Usage

    pairReads(fileName1, fileName2, sampleName, DUPLICATETHRESHOLD = 1,
    fileType='BAM')

### Arguments

`fileName1` | File containing the mapped reads of the first fragment ends (BAM or Bowtie format)
`fileName2` | File containing the mapped reads of the second fragment ends (BAM or Bowtie format)
`sampleName` | A character string that will be used to name the exported BedGraph file containing the coverage, and the R object file with paired reads. They will be saved in the current directory.
`DUPLICATETHRESHOLD` | An integer specifying the maximum amount of duplicated paired-end reads allowed, over that value it is expected to be PCR bias. The default is 1.
`fileType` | A character string specifying the format of the aligned reads. The default is 'BAM'. Other accepted format is 'Bowtie'.

### Value

A GenomicRangesList called filtered

`paired_reads_1` | GenomicRanges with the coordinates of where one end of the read mapped
`paired_reads_2` | GenomicRanges with the coordinates of where the other end of the read mapped

### Author(s)

Borbala Mifsud and Robert Sugar

### See Also

`mapReadsToRestrictionSites`, `GOTHiC`

### Examples

    library(GOTHiC)
    dirPath <- system.file("extdata", package="HiCDataLymphoblast")
    fileName1 <- list.files(dirPath, full.names=TRUE)[1]
    fileName2 <- list.files(dirPath, full.names=TRUE)[2]
    paired <- pairReads(fileName1, fileName2, sampleName='lymphoid_chr20',
    DUPLICATETHRESHOLD = 1, fileType='Table')

[Package GOTHiC version 1.24.0 Index]