read2count {metaseqR} | R Documentation

## SAM/BAM/BED file reader helper for the metaseqr pipeline

### Description

This function is a helper for the `metaseqr` pipeline, for reading SAM/BAM or BED files when a read counts file is not available.

### Usage

        read2count(targets, annotation, file.type = targets$type,
            trans.level = "gene", utr.flank = 500,
            has.all.fields = FALSE, multic = FALSE)

### Arguments

`targets` | a named list, the output of `read.targets`.
`annotation` | see the `annotation` argument in the main `metaseqr` function. The `"annotation"` parameter here is the result of the same parameter in the main function. See also `get.annotation`.
`file.type` | the type of raw input files. It can be `"bed"` for BED files or `"sam"`, `"bam"` for SAM/BAM files. See the same argument in the main `metaseqr` function for the case of auto-guessing.
`utr.flank` | the number of base pairs to flank the 3' UTR of transcripts when analyzing Quant-Seq data.
`trans.level` | see the `trans.level` argument in the main `metaseqr` function.
`has.all.fields` | a logical variable indicating if all annotation fields used by `metaseqr` are available (that is apart from the main chromosome, start, end, unique id and strand columns, if also present are the gene name and biotype columns). The default is `FALSE`.
`multic` | a logical value indicating the presence of multiple cores. Defaults to `FALSE`. Do not change it if you are not sure whether package parallel has been loaded or not.

### Value

A data frame with counts for each sample, ready to be passed to the main `metaseqr` pipeline.

### Author(s)

Panagiotis Moulos

### Examples

    ## Not run:
    my.targets <- read.targets("my_mm9_study_bam_files.txt")
    gene.data <- get.annotation("mm9","gene")
    r2c <- read2count(targets=my.targets,
        file.type=my.targets$type,annotation=gene.data)
    gene.counts <- r2c$counts
    libsize.list <- r2s$libsize

    ## End(Not run)

[Package metaseqR version 1.20.0 Index]