sort_counts: Sort columns of a count matrix by rows in sample data

View source: R/sort_counts.R

sort_countsR Documentation

Sort columns of a count matrix by rows in sample data

Description

DESeqDataSetFromMatrix requires count columns sorted by the rows in sample data and only checks if sample row names match count column names (and tibbles do not have row names). This matches column names in a count table to the first column in sample data and reorders columns to match.

Usage

sort_counts(count_tbl, sample_tbl, id = 1)

Arguments

count_tbl

count matrix, data.frame or tibble

sample_tbl

sample tabl with a column containing the columns names in count matrix

id

position of column in sample data that matches column names in the count table, default is the first column

Value

A count matrix with columns re-ordered to match the sample table

Author(s)

Chris Stubben

Examples

## Not run: 
count_tbl <-  sort_counts(counts, samples)

## End(Not run)

HuntsmanCancerInstitute/hciR documentation built on March 26, 2024, 3:09 a.m.