annotate_chromatogram: Annotate chromatograms

Description Usage Arguments Details Note See Also Examples

Description

Merge additional information about the sample conditions into a chromatogram.

Usage

1
2
3
4
5
annotate_chromatogram(chr_data, sample_info)

list_IDs(chr_data)

create_annotation(chr_data, Sample = NULL, ...)

Arguments

chr_data

Chromatogram data imported via read_unicorn

sample_info

Sample information data frame.

Sample

Obligatory Sample column for the sample information data frame.

...

Additional columns for the sample information data frame.

Details

UNICORN sometimes codes sample information into file names using a funny naming scheme. In such cases, adding sample information during import via read_unicorn is not straightforward. An easier approach is to parse the data without sample names, list sample IDs, build a data frame accordingly, and finally merge it with the chromatogram.

The information is supplied in a data frame called sample_info. This data frame must have at least two columns: ID and Sample (case sensitive). Merging is done based on the ID column. Sample and all other columns are added accordingly. Missing IDs in sample_info get an NA as a sample name but this is reported as as warning.

Note

This function may overwrite some of the annotation from chromatogram data if sample_names was already used during import via read_unicorn. All other columns are be added accordingly.

See Also

read_unicorn

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
chr_data <- read_unicorn("Chromatogram.xls")

list_IDs(chr_data)
#                ID
# 1 Manual run 10:1
# 2 Manual run 10:5
# 3 Manual run 10:3

sample_info <- create_annotation(
    chr_data,
    Sample = c("Negative control", "Positive control", "Test"),
    Run = c(1, 2, 3))
  
annotate_chromatogram(chr_data, sample_info)

## End(Not run)

cihanerkut/unicoRn documentation built on May 13, 2019, 7:29 p.m.