gemini_create_input {gemini} | R Documentation

## gemini_create_input

### Description

Creates a gemini.input object from a counts matrix with given annotations.

### Usage

    gemini_create_input(
      counts.matrix,
      sample.replicate.annotation = NULL,
      guide.annotation = NULL,
      samplesAreColumns = TRUE,
      sample.column.name = "samplename",
      gene.column.names = NULL,
      ETP.column = 1,
      LTP.column = NULL,
      verbose = FALSE
    )

### Arguments

`counts.matrix` | a matrix of counts with rownames corresponding to features (e.g. guides) and colnames corresponding to samples.
`sample.replicate.annotation` | a data.frame of annotations for each sample/replicate pair. Note that at least one column in `sample.replicate.annotation` must correspond to the colnames of `counts.matrix` (see Details) (default = NULL)
`guide.annotation` | a data.frame of annotations for each guide. Note that at least one column in `guide.annotation` must correspond to the rownames of counts.matrix (default = NULL)
`samplesAreColumns` | a logical indicating if samples are on the columns or rows of counts.matrix. (default = TRUE)
`sample.column.name` | a character or integer indicating which column of `sample.replicate.annotation` describes the samples.
`gene.column.names` | a character or integer vector of length(2) indicating which columns of `guide.annotation` describe the genes being targeted.
`ETP.column` | a character or integer vector indicating which column(s) of `counts.matrix` contain the early time-point(s) of the screen (i.e. pDNA, early sequencing, etc.). Defaults to the first column.
`LTP.column` | a character or integer vector indicating which column(s) is the later time-point of the screen (i.e. day21, post-treatment, etc.). Defaults to `(1:ncol(counts.matrix))[-ETP.column]`, or all other columns except for those specified by `ETP.column`.
`verbose` | Verbosity (default FALSE)

### Details

This function initializes a gemini.input object from a counts matrix. There are a few key assumptions made in the input format.

- The counts matrix is regular.

- The counts matrix structure is in accordance with the `samplesAreColumns` parameter.

- The first column of `sample.replicate.annotation` matches with the existing dimension names of the counts matrix.

- The first column of `guide.annotations` matches with the existing dimension names of the counts matrix.

- `sample.column.name` must specify a column in `sample.replicate.annotation` (either by name or index) that describes unique samples.

- `gene.column.names` must specify two columns in `sample.replicate.annotation` (either by name or index) that describe genes.

### Value

a gemini.input object

### Examples

    data("counts", package = "gemini")
    data("sample.replicate.annotation", package = "gemini")
    data("guide.annotation", package = "gemini")
    Input <- gemini_create_input(
        counts.matrix = counts,
        sample.replicate.annotation = sample.replicate.annotation,
        guide.annotation = guide.annotation,
        sample.column.name = "samplename",
        gene.column.names = c("U6.gene", "H1.gene")
    )

[Package gemini version 1.8.0 Index]