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

Description Usage Arguments Value Author(s) Examples

View source: R/sort_counts.R

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

1
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

1
2
3
4
## Not run: 
count_tbl <-  sort_counts(counts, samples)

## End(Not run)

HuntsmanCancerInstitute/hciR documentation built on March 6, 2020, 12:40 p.m.