read_Ct_long {RQdeltaCT}R Documentation

read_Ct_long

Description

Imports a long-format table with Ct values.

Usage

read_Ct_long(
  path,
  sep,
  dec,
  skip = 0,
  column.Sample,
  column.Gene,
  column.Ct,
  column.Group,
  add.column.Flag = FALSE,
  column.Flag
)

Arguments

path

Path to a .txt or csv. file with long-type table with Ct values. This table must contain at least 4 columns, separately for sample names, gene names, Ct values and group names (these columns will be imported by this function). Imported table could also contain a column with a flag information, which could be optionally imported (see add.col.Flag and col.Flag parameters).

sep

Character of a field separator in imported file.

dec

Character used for decimal points in Ct values.

skip

Integer: number of lines of the data file to skip before beginning to read data. Default to 0.

column.Sample

Integer: number of column with sample names.

column.Gene

Integer: number of column with gene names.

column.Ct

Integer: number of column with Ct values.

column.Group

Integer: number of column with group names.

add.column.Flag

Logical: if data contains a column with flag information which should also be imported, this parameter should be set to TRUE. Default to FALSE.

column.Flag

Integer: number of column with flag information. Should be specified if add.col.Flag = TRUE. This column should contain a character-type values (e.g. "Undetermined" and "OK"), however, other types of values are allowed (e.g. numeric), but must be converted to character or factor after importing data (see examples).

Value

Data.frame in long format ready for analysis.

Examples

path <- system.file("extdata",
                    "data_Ct_long.txt",
                    package = "RQdeltaCT")

library(tidyverse)
data.Ct <- read_Ct_long(path = path,
                        sep = "\t",
                        dec = ".",
                        skip = 0,
                        add.column.Flag = TRUE,
                        column.Sample = 1,
                        column.Gene = 2,
                        column.Ct = 5,
                        column.Group = 9,
                        column.Flag = 4)
str(data.Ct)

data.Ct <- mutate(data.Ct,
                  Flag = ifelse(Flag < 1, "Undetermined", "OK"))
str(data.Ct)


[Package RQdeltaCT version 1.3.0 Index]