addFragments {FourCSeq} | R Documentation

## Add the restriction fragment information

### Description

`addFragments` adds the genomic position and information of the restriction fragments as `GRanges` object to `rowRanges` of the `FourC` object.

### Usage

    addFragments(object, minSize = 20, filter = TRUE, save = FALSE)

### Arguments

`object` | A `FourC` object.
`minSize` | Minimum size of a restriction fragment end to be valid. Default is `20` bases.
`filter` | Defines whether fragments that do not contain a cutting site of the second restriction enzyme or are smaller than `minSize` should be filtered out.
`save` | Defines if the fragment information should be saved as txt and bed files in the fragmentDir folder of the projectPath.

### Value

Updated `FourC` object that contains the information about the restriction fragments in `rowRanges`.

### Author(s)

Felix A. Klein, felix.klein@embl.de

### See Also

`FourC`, `findViewpointFragments`

### Examples

    metadata <- list(projectPath=tempdir(),
                     fragmentDir="re_fragments",
                     referenceGenomeFile=system.file("extdata/dm3_chr2L_1-6900.fa",
                                                     package="FourCSeq"),
                     reSequence1="GATC",
                     reSequence2="CATG",
                     primerFile=system.file("extdata/primer.fa",
                                            package="FourCSeq"),
                     bamFilePath=system.file("extdata/bam", package="FourCSeq"))

    colData <- DataFrame(viewpoint = "testdata",
                         condition = factor(rep(c("WE_68h", "MESO_68h", "WE_34h"),
                                                each=2),
                                            levels = c("WE_68h", "MESO_68h", "WE_34h")),
                         replicate = rep(c(1, 2),
                                         3),
                         bamFile = c("CRM_ap_ApME680_WE_6-8h_1_testdata.bam",
                                     "CRM_ap_ApME680_WE_6-8h_2_testdata.bam",
                                     "CRM_ap_ApME680_MESO_6-8h_1_testdata.bam",
                                     "CRM_ap_ApME680_MESO_6-8h_2_testdata.bam",
                                     "CRM_ap_ApME680_WE_3-4h_1_testdata.bam",
                                     "CRM_ap_ApME680_WE_3-4h_2_testdata.bam"),
                         sequencingPrimer="first")

    fc <- FourC(colData, metadata)
    fc

    fc <- addFragments(fc)
    fc

[Package FourCSeq version 1.18.0 Index]