Skip to content

Commit

Permalink
ver 1.2.4. Allow access to parameters maxLastTurn, cutoff_QC, autmati…
Browse files Browse the repository at this point in the history
…cally detected xlimMaxCPMW, sepetated PlotDistr() from CalculateSF(). Added DESeq example and custom settings for ChIPseqSpikeInFree to README.
  • Loading branch information
hongjianjin committed Aug 31, 2020
1 parent c3baf3e commit 0465382
Show file tree
Hide file tree
Showing 14 changed files with 421 additions and 275 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ChIPseqSpikeInFree
Title: A Spike-in Free ChIP-Seq Normalization Approach for Detecting Global Changes in Histone Modifications
Version: 1.2.3
Date: 2019-06-05
Version: 1.2.4
Date: 2020-08-31
Authors@R:
person(given = "Hongjian",
family = "Jin",
Expand All @@ -12,7 +12,7 @@ Depends:
GenomicAlignments,
GenomicRanges,
IRanges,
R (>= 3.3.0),
R (>= 3.5.0),
Rsamtools
License: GPL-3
Encoding: UTF-8
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

export(BoxplotSF)
export(CalculateSF)
export(PlotDistr)
export(ChIPseqSpikeInFree)
export(CountRawReads)
export(GenerateBins)
Expand Down
454 changes: 267 additions & 187 deletions R/ChIPseqSpikeInFree.R

Large diffs are not rendered by default.

52 changes: 34 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,20 @@ A Spike-in Free ChIP-Seq Normalization Approach for Detecting Global Changes in

Traditional reads per million (RPM) normalization method is inappropriate for the evaluation of ChIP-seq data when the treatment or mutation has the global effect. Changes in global levels of histone modifications can be detected by using exogenous reference spike-in controls. However, most of the ChIP-seq studies have overlooked the normalization problem that have to be corrected with spike-in. A method that retrospectively renormalize data sets without spike-in is lacking.

We develop `ChIPseqSpikeInFree`, a novel ChIP-seq normalization method to effectively determine scaling factors for samples across various conditions and treatments, which does not rely on exogenous spike-in chromatin or peak detection to reveal global changes in histone modification occupancy. This method is capable of revealing the similar magnitude of global changes as the spike-in method.
We observed that some highly enriched regions were retained despite global changes by oncogenic mutations or drug treatment and that the proportion of reads within these regions was inversely associated with total histone mark levels. Therefore, we developped `ChIPseqSpikeInFree`, a novel ChIP-seq normalization method to effectively determine scaling factors for samples across various conditions and treatments, which does not rely on exogenous spike-in chromatin or peak detection to reveal global changes in histone modification occupancy. This method is capable of revealing the similar magnitude of global changes as the spike-in method.

In summary, `ChIPseqSpikeInFree` can estimate scaling factors for ChIP-seq samples without exogenous spike-in or without input. When ChIP-seq is done with spike-in protocol but high variation of Spike-In reads between samples are observed, ChIPseqSpikeInFree can help you determine a more reliable scaling factor than ChIP-Rx method.
In summary, `ChIPseqSpikeInFree` can estimate scaling factors for ChIP-seq samples without exogenous spike-in or without input. When ChIP-seq is done with spike-in protocol but high variation of Spike-In reads between samples are observed, ChIPseqSpikeInFree can help you determine a more reliable scaling factor than ChIP-Rx method. It's not recommended to run ChIPseqSpikeInFree blindly without any biological evidences like Western Blotting to prove the global change at protein level between your control and treatment samples.


## App on DNAnexus Cloud platform - No installation, click and run.
To use the tool, you will need to create a DNAnexus account at https://platform.dnanexus.com/register?client_id=sjcloudplatform. After logging in DNAnexus, you can create a project , upload your data to your project folder and choose the ChIPseqSpikeInFree app (Tools --> library --> search ChIPseqSpikeInFree) to run. Or you can run ChIPseqSpikeInFree at https://platform.dnanexus.com/app/ChIPseqSpikeInFree and get results in an hour.
To use the tool, you will need to create a DNAnexus account at https://platform.dnanexus.com/register?client_id=sjcloudplatform. After logging in DNAnexus, you can create a project , upload your data to your project folder and choose the ChIPseqSpikeInFree app (Tools --> library --> search ChIPseqSpikeInFree) to run. Or you can run ChIPseqSpikeInFree [v1.2.3] at https://platform.dnanexus.com/app/ChIPseqSpikeInFree and get results in an hour.


## Prerequisites

`ChIPseqSpikeInFree` depends on `Rsamtools`, `GenomicRanges`, and `GenomicAlignments` to count reads from bam files.

To install these packages, start `R` (version "3.4") and enter:
```R
> source("https://bioconductor.org/biocLite.R")
> biocLite("Rsamtools")
> biocLite("GenomicRanges")
> biocLite("GenomicAlignments")
```

If you use `R` (version "3.5"), enter:
To install these packages, start `R` (version "3.5")or above, enter:
```R
> if (!requireNamespace("BiocManager", quietly = TRUE))
> install.packages("BiocManager")
Expand All @@ -45,15 +37,16 @@ Using `R`, enter:
> install.packages("devtools")
> library(devtools)
> install_github("stjude/ChIPseqSpikeInFree")

> packageVersion('ChIPseqSpikeInFree')
#[1] '1.2.4'
```

Or using command lines

```bash
$ git clone https://github.com/stjude/ChIPseqSpikeInFree.git
$ R CMD build ChIPseqSpikeInFree
$ R CMD INSTALL ChIPseqSpikeInFree_1.2.3.tar.gz
$ R CMD INSTALL ChIPseqSpikeInFree_1.2.4.tar.gz

```

Expand Down Expand Up @@ -96,6 +89,12 @@ Save as `/your/path/sample_meta.txt` ([Example](docs/sample_meta.txt))
> ChIPseqSpikeInFree(bamFiles = bams, chromFile = "hg19", metaFile = metaFile, prefix = "test")
```

##### 4. Run `ChIPseqSpikeInFree` pipeline with custom settings for ChIP-seq with unideal enrichment or many very broad enriched regions like H3K9me3

```R
> ChIPseqSpikeInFree(bamFiles = bams, chromFile = "hg19", metaFile = metaFile, prefix = "test", cutoff_QC = 1, maxLastTurn=0.95)
```

### Input

In the simple usage scenario, the user should have ChIP-seq bam files ready. Sample information can be specified in a metadata file (`metaFile`) and the user should choose a correct reference genome corresponding to the bams.
Expand Down Expand Up @@ -182,15 +181,32 @@ Output will include: (in case that you set `prefix ="test"`)

We can use SF to adjust original library size for differential analysis and generating bigwig files.

1. for differential analysis
1. for differential analysis with EdgeR
```R
...
dat <- read.table("sample_SF.txt", sep="\t",header=TRUE,fill=TRUE,stringsAsFactors = FALSE, quote="",check.names=F)
SF <- dat$SF
dge <- DGEList(counts = counts, group = GROUP, norm.factors = SF)
...
```
2. pseudo-code for generation of bigwig files from a bed file
2. for differential analysis with DESeq2
```R
...
dat <- read.table("sample_SF.txt", sep="\t",header=TRUE,fill=TRUE,stringsAsFactors = FALSE, quote="",check.names=F)
SF <- dat$SF
countData <- matrix(1:100,ncol=4)
condition <- factor(c("A","A","B","B"))
dds <- DESeqDataSetFromMatrix(countData, DataFrame(condition), ~ condition)
dds <- estimateSizeFactors(dds)
coldata<- colData(dds)
coldata$sizeFactor <- coldata$sizeFactor *SF
colData(dds) <- coldata
dds <- estimateDispersions(dds)
dds <- nbinomWaldTest(dds)
...
```

3. pseudo-code for generation of bigwig files from a bed file
```bash
libSize=`cat sample1.bed|wc -l`
scale=15000000/($libSize*$SF)
Expand All @@ -214,7 +230,7 @@ write.table(dat, "sample_SF_completeLoss.txt", sep="\t",quote=F,row.names=F, col
This repository contains the following:
- source code
- documentation [[PDF file](docs/ChIPseqSpikeInFree_1.2.2.pdf)]
- documentation [[PDF file](docs/ChIPseqSpikeInFree_1.2.4.pdf)]
- chromFile of human and mouse reference genome (`hg19`, `mm9`, `mm10`, and `hg38`)
- an example of `sample_meta.txt`
Expand Down Expand Up @@ -254,7 +270,7 @@ attached base packages:
[8] methods base
other attached packages:
[1] ChIPseqSpikeInFree_1.2.3 GenomicAlignments_1.20.1
[1] ChIPseqSpikeInFree_1.2.4 GenomicAlignments_1.20.1
[3] Rsamtools_2.0.3 Biostrings_2.52.0
[5] XVector_0.24.0 SummarizedExperiment_1.14.1
[7] DelayedArray_0.10.0 BiocParallel_1.18.1
Expand Down
Binary file removed docs/ChIPseqSpikeInFree_1.2.2.pdf
Binary file not shown.
Binary file added docs/ChIPseqSpikeInFree_1.2.4.pdf
Binary file not shown.
27 changes: 18 additions & 9 deletions man/CalculateSF.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 0 additions & 43 deletions man/ChIPseqSpikeFree.Rd

This file was deleted.

25 changes: 23 additions & 2 deletions man/ChIPseqSpikeInFree.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions man/CountRawReads.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/GenerateBins.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions man/ParseReadCounts.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0465382

Please sign in to comment.