impute_abundance {tidybulk} | R Documentation

## Impute transcript abundance if missing from sample-transcript pairs

### Description

impute_abundance() takes as imput a 'tbl' formatted as | <SAMPLE> | <TRANSCRIPT> | <COUNT> | <...> | and returns a 'tbl' with an edditional adjusted abundance column. This method uses scaled counts if present.

### Usage

    impute_abundance(
      .data,
      .formula,
      .sample = NULL,
      .transcript = NULL,
      .abundance = NULL
    )

### Arguments

`.data` | A 'tbl' formatted as | <SAMPLE> | <TRANSCRIPT> | <COUNT> | <...> |
`.formula` | A formula with no response variable, representing the desired linear model where the first covariate is the factor of interest and the second covariate is the unwanted variation (of the kind ~ factor_of_intrest + batch)
`.sample` | The name of the sample column
`.transcript` | The name of the transcript/gene column
`.abundance` | The name of the transcript/gene abundance column

### Details

This function imputes the abundance of missing sample-transcript pair using the median of the sample group defined by the formula

### Value

A 'tbl' non-sparse abundance

### Examples

    res =
    	impute_abundance(
    		tidybulk::counts_mini,
    	~ condition,
    	.sample = sample,
    	.transcript = transcript,
    	.abundance = count
    )

[Package tidybulk version 0.99.23 Index]