check_sample_names: Functions for simulating RNAseq DE data

Description Usage Arguments Details Value Examples

View source: R/de_analysis.R

Description

Check sample names

Usage

1
check_sample_names(count_df, cols_to_remove, metadata, metadata_var)

Arguments

count_df

cleaned dataframe of counts, rows should be gene IDs, columns should be samples, cells should only contain counts

cols_to_remove

vector of column numbers that do not correspond to a sample, necessary to identify for downstream functions

metadata

cleaned metadata for RNAseq data

metadata_var

column of sample identifier that user expects to match with count_matrix

Details

'check_sample_names()' is a simple quality control step that verifies whether the column names in the count matrix match with a user-defined metadata column. In order for a match to occur, the value levels of the column names and those of the user-defined metadata column need to be identical (e.g. 'setdiff(colnames(my_count_matrix), metadata$my_column)' should be 0), and the order in which the values appear need to be identical (e.g. 'identical(colnames(my_count_matrix), metadata$my_column)' should be TRUE).

The proportion of zeros in the original count data is also printed to the console. For count data that has a medium to high proportion of zeros, voomLmFit is recommended. Otherwise voom followed by lmFit is recommended.

Value

a 'list' with the following components:

old_count

the original count dataframe supplied

mod_count

the pure count dataframe (no other columns)

meta

sorted metadata (if necessary), otherwise the supplied metadata is returned with console message output of the quality control check.

Examples

1
2
3
4
5
counts <- readr::read_delim("data/GSE60450_Lactation-GenewiseCounts.txt", delim = "\t")
meta <- readr::read_delim("data/SampleInfo_Corrected.txt", delim = "\t") %>%
mutate(FileName = stringr::str_replace(FileName, "\\.", "-"))

check_sample_names(counts, c(1,2), meta, FileName)

latlio/tidyde documentation built on Dec. 21, 2021, 9:40 a.m.