importData_soGGi {DChIPRep} | R Documentation

## Import the data from bam files directly

### Description

This function imports the data from .bam files directly. It will return a matrix with one column per .bam file and the respective counts per postion in the rows. It uses the function `regionPlot` from the package `soGGi`.

### Usage

    importData_soGGi(bam_paths, TSS, fragment_lengths, sample_ids,
      distanceUp = 1000, distanceDown = 1500, ...)

### Arguments

`bam_paths` | a character vector of paths to the bam file(s) to be imported.
`TSS` | a GRanges (GenomicRanges-class) (or a class that inherets from it) object containing the TSS of interest.
`fragment_lengths` | an integer vector of fragment lengths,
`sample_ids` | a character vector of sample ids for the .bam files. This can also be a factor.
`distanceUp` | Distance upstream from centre of the TSS provided.
`distanceDown` | Distance downstream from centre of the TSS provided.
`...` | additional arguments passed to regionPlot.

### Details

In the example below, we use a subsampled .bam file (0.1 % of the reads) from the Galonska et. al. WCE (whole cell extract) H3Kme3 data and associated TSS near identified peaks. For additional details on the data, see input_galonska and TSS_galonska.

### Value

a matrix that contains the postion-wise profiles per .bam file in the colmuns.

### See Also

`regionPlot` input_galonska TSS_galonska sample_table_galonska

### Examples

    ## Not run:
    data(sample_table_galonska)
    data(TSS_galonska)
    bam_dir <- file.path(system.file("extdata", package="DChIPRep"))
    wce_bam <- "subsampled_0001_pc_SRR2144628_WCE_bowtie2_mapped-only_XS-filt_no-dups.bam"
    mat_wce <- importData_soGGi(bam_paths = file.path(bam_dir, wce_bam),
                               TSS = TSS_galonska,
                               fragment_lengths = sample_table_galonska$input_fragment_length[1],
                               sample_ids =  sample_table_galonska$input[1],
                               paired = FALSE,
                               removeDup=FALSE
    )
    head(mat_wce)

    ## End(Not run)

[Package DChIPRep version 1.18.0 Index]