aggregate_duplicates: Aggregates multiple counts from the same samples (e.g., from...

aggregate_duplicatesR Documentation

Aggregates multiple counts from the same samples (e.g., from isoforms), concatenates other character columns, and averages other numeric columns

Description

aggregate_duplicates() takes as imput a 'tbl' formatted as | <SAMPLE> | <TRANSCRIPT> | <COUNT> | <...> | and returns a 'tbl' with aggregated transcripts that were duplicated.

Usage

aggregate_duplicates(
  .data,
  aggregation_function = sum,
  .sample = NULL,
  .cell = NULL,
  .transcript = NULL,
  .abundance = NULL,
  shape = "long",
  keep_integer = T
)

Arguments

.data

A 'tbl' formatted as | <SAMPLE> | <TRANSCRIPT> | <COUNT> | <...> |

aggregation_function

A function for counts aggregation (e.g., sum, median, or mean)

.sample

The name of the sample column

.cell

The name of the cell column

.transcript

The name of the transcript/gene column

.abundance

The name of the transcript/gene abundance column

keep_integer

A boolean. Whether to force the aggregated counts to integer

Details

\lifecycle

experimental

This function aggregates duplicated transcripts (e.g., isoforms, ensembl). For example, we often have to convert ensembl symbols to gene/transcript symbol, but in doing so we have to deal with duplicates. 'aggregate_duplicates' takes a tibble and column names (as symbols; for 'sample', 'transcript' and 'count') as arguments and returns a tibble with aggregate transcript with the same name. All the rest of the column are appended, and factors and boolean are appended as characters.

Value

A 'tbl' object with aggregated transcript abundance and annotation

Examples





counts %>%
    aggregate_duplicates(
    sample,
    cell,
    transcript,
    `count`,
    aggregation_function = sum
    )




stemangiola/ttSc documentation built on Dec. 8, 2022, 2:37 a.m.