ChIPseqSpikeInFree: wrapper function - perform ChIP-seq spike-free normalization...

View source: R/ChIPseqSpikeInFree.R

ChIPseqSpikeInFreeR Documentation

wrapper function - perform ChIP-seq spike-free normalization in one step.

Description

This function wraps all steps. If you run ChIPseqSpikeInFree() seperately for two batches, the scaling factors will be not comparable between two batches. The correct way is to combine bamFiles parameter and create a new metadata file to include all bam files. Then re-run ChIPseqSpikeInFree().

Usage

ChIPseqSpikeInFree(
  bamFiles,
  chromFile = "hg19",
  metaFile = "sample_meta.txt",
  prefix = "test",
  binSize = 1000,
  cutoff_QC = 1.2,
  maxLastTurn = 0.99,
  ncores = 2
)

Arguments

bamFiles

a vector of bam filenames.

chromFile

chrom.size file. Given "hg19","mm10","mm9" or "hg38", will load chrom.size file from package folder.

metaFile

a filename of metadata file. the file must have three columns: ID (bam filename without full path), ANTIBODY and GROUP

prefix

prefix of output filename.

binSize

size of bins (bp). Recommend a value bwteen 200 and 10000

cutoff_QC

a numeric value [between 0.95 and 1.20] to identiy sample of QC failure or poor enrichment [1.2 by default]. Slightly smaller cutoff_QC value (like 1) may imporve result when the enrichment is not ideal.

maxLastTurn

a numeric value [between 0.95 and 0.99] to define maximum fraction of reads to be included for identifying last turning point [0.99 by default]. Slightly smaller maxLastTurn value may imporve result when the enrichment is not ideal.

ncores

number of cores for parallel computing.

Value

A data.frame of the updated metaFile with scaling factor

Examples

## 1 first You need to generate a sample_meta.txt (tab-delimited txt file).
# metaFile <- "your/path/sample_meta.txt"
# meta <- ReadMeta(metaFile)
# head(meta)
# ID ANTIBODY GROUP
# ChIPseq1.bam H3K27me3 WT
# ChIPseq2.bam H3K27me3 K27M

## 2. bam files
# bams <- c("ChIPseq1.bam","ChIPseq2.bam")
# prefix <- "test"

## 3. run ChIPseqSpikeInFree pipeline
# ChIPseqSpikeInFree(bamFiles=bams, chromFile="mm9",metaFile=metaFile,prefix="test")

## 4. run ChIPseqSpikeInFree pipeline with custom arguments for H3K9me3 with unideal enrichment
# ChIPseqSpikeInFree(bamFiles=bams, chromFile="mm9",
#    metaFile=metaFile,prefix="test_manual_cutoffs",
#    cutoff_QC = 1, maxLastTurn=0.97)

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