countTable_regions {ORFik} | R Documentation

## Make a list of count matrices from experiment

### Description

By default will make count tables over mRNA, leaders, cds and trailers for all libraries in experiment. region

### Usage

    countTable_regions(
      df,
      out.dir = dirname(df$filepath[1]),
      longestPerGene = FALSE,
      geneOrTxNames = "tx",
      regions = c("mrna", "leaders", "cds", "trailers"),
      type = "count",
      lib.type = "ofst",
      weight = "score",
      rel.dir = "QC_STATS",
      forceRemake = FALSE,
      BPPARAM = bpparam()
    )

### Arguments

`df` | an ORFik `experiment`
`out.dir` | optional output directory, default: `dirname(df$filepath[1])`. Will make a folder called "QC_STATS" with all results in this directory. Warning: If you assign not default path, you will have a hazzle to load files later. Much easier to load count tables, statistics, ++ later with default.
`longestPerGene` | a logical (default FALSE), if FALSE all transcript isoforms per gene. Ignored if "region" is not a character of either: "mRNA","tx", "cds", "leaders" or "trailers".
`geneOrTxNames` | a character vector (default "tx"), should row names keep trancript names ("tx") or change to gene names ("gene")
`regions` | a character vector, default: c("mrna", "leaders", "cds", "trailers"), make raw count matrices of whole regions specified. Can also be a custom GRangesList of for example uORFs or a subset of cds etc.
`type` | default: "count" (raw counts matrix), alternative is "fpkm", "log2fpkm" or "log10fpkm"
`lib.type` | a character(default: "default"), load files in experiment or some precomputed variant, either "ofst", "bedo", "bedoc" or "pshifted". These are made with ORFik:::convertLibs() or shiftFootprintsByExperiment(). Can also be custom user made folders inside the experiments bam folder.
`weight` | numeric or character, a column to score overlaps by. Default "score", will check for a metacolumn called "score" in libraries. If not found, will not use weights.
`rel.dir` | relative output directory for out.dir, default: "QC_STATS". For pshifted, write "pshifted".
`forceRemake` | logical, default FALSE. If TRUE, will not look for existing file.
`BPPARAM` | how many cores/threads to use? default: bpparam()

### Value

a list of data.table, 1 data.table per region. The regions will be the names the list elements.

### See Also

Other countTable: `countTable()`

### Examples

    ##Make experiment
    df <- ORFik.template.experiment()
    ## Create count tables for all default regions
    # countTable_regions(df)
    ## Pshifted reads (first create pshiftead libs)
    # countTable_regions(df, lib.type = "pshifted", rel.dir = "pshifted")

[Package ORFik version 1.14.7 Index]