coverageScorings {ORFik} | R Documentation

## Add a coverage scoring scheme

### Description

Different scorings and groupings of a coverage representation.

### Usage

    coverageScorings(coverage, scoring = "zscore")

### Arguments

`coverage` | a data.table containing at least columns (count, position), it is possible to have additionals: (genes, fraction, feature)
`scoring` | a character, one of (zscore, transcriptNormalized, mean, median, sum, sumLength, meanPos and frameSum, periodic, NULL)

### Details

Usually output of metaWindow or scaledWindowCoverage is input in this function.

Content of coverage data.table: It must contain the count and position columns.

genes column: If you have multiple windows, the genes column must define which gene/transcript grouping the different counts belong to. If there is only a meta window or only 1 gene/transcript, then this column is not needed.

fraction column: If you have coverage of i.e RNA-seq and Ribo-seq, or TCP -seq of large and small subunite, divide into fractions. Like factor(RNA, RFP)

feature column: If gene group is subdivided into parts, like gene is transcripts, and feature column can be c(leader, cds, trailer) etc.

Given a data.table coverage of counts, add a scoring scheme. per: the grouping given, if genes is defined, group by per gene in scoring. Scorings: 1. zscore (count-windowMean)/windowSD per) 2. transcriptNormalized (sum(count / sum of counts per)) 3. mean (mean(count per)) 4. median (median(count per)) 5. sum (count per) 6. sumLength (count per) / number of windows 7. meanPos (mean per position per gene) used in scaledWindowPositions 8. sumPos (sum per position per gene) used in scaledWindowPositions 9. frameSum (sum per frame per gene) used in ORFScore 10. fracPos (fraction of counts per position per gene) 11. periodic (Fourier transform periodicity of meta coverage per fraction) 12. NULL (return input directly)

### Value

a data.table with new scores

### See Also

Other coverage: `metaWindow`, `scaledWindowPositions`, `windowPerReadLength`

### Examples

    dt <- data.table::data.table(count = c(4, 1, 1, 4, 2, 3),
                                 position = c(1, 2, 3, 4, 5, 6))
    coverageScorings(dt, scoring = "zscore")

    # with grouping gene
    dt$genes <- c(rep("tx1", 3), rep("tx2", 3))
    coverageScorings(dt, scoring = "zscore")

[Package ORFik version 1.4.1 Index]