ReadMeta: read in sample metadata file

View source: R/ChIPseqSpikeInFree.R

ReadMetaR Documentation

read in sample metadata file

Description

This function allows you to load metadat to a R data.frame and return the object. In addtion, it validates meta_info format and adds a COLOR column if it's undefined.

Usage

ReadMeta(metaFile = "sample_meta.txt")

Arguments

metaFile

a metadata file name; the file must have three columns: ID (bam filename without full path), ANTIBODY and GROUP. the COLOR column is optional and will be used for plotting purpose.

Value

A data.frame of metaFile

Examples

## 1. load an example of metadata file

metaFile <- system.file("extdata", "sample_meta.txt", package = "ChIPseqSpikeInFree")
meta <- ReadMeta(metaFile)
head(meta, n = 1)
meta
#                                             ID ANTIBODY GROUP COLOR
#  H3K27me3-NSH.K27M.A.bam H3K27me3-NSH.K27M.A.bam H3K27me3  K27M   green
#  H3K27me3-NSH.K27M.B.bam H3K27me3-NSH.K27M.B.bam H3K27me3  K27M   green
#  H3K27me3-NSH.K27M.C.bam H3K27me3-NSH.K27M.C.bam H3K27me3  K27M   green
#  H3K27me3-NSH.WT.D.bam     H3K27me3-NSH.WT.D.bam H3K27me3    WT  grey
#  H3K27me3-NSH.WT.E.bam     H3K27me3-NSH.WT.E.bam H3K27me3    WT  grey
#  H3K27me3-NSH.WT.F.bam     H3K27me3-NSH.WT.F.bam H3K27me3    WT  grey

stjude/ChIPseqSpikeInFree documentation built on March 28, 2022, 5:36 a.m.