BindingSiteFinder
Workflows
Standard Workflow
library(BindingSiteFinder)
library(txdbmaker)
library(rtracklayer)
# 1. Import crosslink sites
csFile <- system.file("extdata", "PureCLIP_crosslink_sites_examples.bed", package="BindingSiteFinder")
cs <- rtracklayer::import(con = csFile, format = "BED")
# 2. Create metadata table and construct BSFDataSet
files <- system.file("extdata", package="BindingSiteFinder")
clipFilesP <- list.files(files, pattern = "plus.bw$", full.names = TRUE)
clipFilesM <- list.files(files, pattern = "minus.bw$", full.names = TRUE)
meta <- data.frame(
id = 1:4,
condition = factor(rep("WT", 4)),
clPlus = clipFilesP,
clMinus = clipFilesM
)
bds <- BSFDataSetFromBigWig(ranges = cs, meta = meta, silent = TRUE)
# 3. Build gene and transcript region annotations
annoDb <- txdbmaker::makeTxDbFromGFF(file = "gencode_v37_annotation.gff3", format = "gff3")
gns <- genes(annoDb)
regions <- GRangesList(
CDS = cds(annoDb),
Intron = unlist(intronsByTranscript(annoDb)),
UTR3 = unlist(threeUTRsByTranscript(annoDb)),
UTR5 = unlist(fiveUTRsByTranscript(annoDb))
)
# 4. Run BSFind wrapper
bdsOut <- BSFind(
object = bds,
anno.genes = gns,
anno.transcriptRegionList = regions,
est.subsetChromosome = "chr22",
veryQuiet = TRUE
)
# 5. Export results
exportToBED(bdsOut, con = "./myBindingSites.bed")
Input/Output Note: Inputs a BSFDataSet and genomic annotations; outputs a refined BSFDataSet with defined binding sites and exports them to a BED file.
Differential Binding Analysis
library(BindingSiteFinder)
library(txdbmaker)
# 1. Load Gene Annotations and Transcript Regions
annoDb <- txdbmaker::makeTxDbFromGFF(file = "gencode_v37_annotation.gff3", format = "gff3")
gns <- genes(annoDb)
regions <- GRangesList(
CDS = cds(annoDb),
Intron = unlist(intronsByTranscript(annoDb)),
UTR3 = unlist(threeUTRsByTranscript(annoDb)),
UTR5 = unlist(fiveUTRsByTranscript(annoDb))
)
# 2. Define binding sites for a condition
bdsOut <- BSFind(
object = bds,
anno.genes = gns,
anno.transcriptRegionList = regions,
est.subsetChromosome = "chr22"
)
Input/Output Note: Inputs a BSFDataSet and genomic annotations; outputs a BSFDataSet with defined binding sites prepared for downstream differential testing.
When to Use
- To define precise, equally sized RBP binding sites from genome-wide iCLIP coverage and peak calling results (e.g., PureCLIP crosslink sites).
- To filter, merge, and check reproducibility of crosslink sites across replicates using
BSFind().
- To annotate binding sites with genomic features such as genes and transcript regions (CDS, Introns, UTRs) using
genes(), cds(), and intronsByTranscript().
When NOT to Use
- For analyzing RNA-seq differential expression or splicing directly without iCLIP/CLIP-seq data (use
DESeq2 or dexseq instead).
- For peak calling directly from BAM files (use peak callers like
PureCLIP first, then import results into BindingSiteFinder).
Data Requirements
- Crosslink sites as a
GRanges object (typically single-nucleotide wide, e.g., imported from PureCLIP BED files).
- Replicate-specific coverage data in strand-specific BigWig files (
clPlus and clMinus).
- Gene annotations as a
GRanges object and transcript regions as a GRangesList (e.g., CDS, Introns, 3' UTR, 5' UTR).
Key Parameters
- object: A
BSFDataSet containing crosslink ranges and metadata.
- anno.genes: A
GRanges object containing gene annotations.
- anno.transcriptRegionList: A
GRangesList containing transcript region annotations.
- est.subsetChromosome ("chr22"): Character vector specifying which chromosome to use for estimating binding site width.
- veryQuiet (FALSE): Logical indicating whether to suppress progress messages.
- est.maxBsWidth (29): Numeric specifying the maximum binding site width to test during estimation.
Best Practices
- Pre-filter crosslink sites with low scores (e.g., removing the lowest 1% of PureCLIP scores) using
pureClipGlobalFilterPlot() to assess the cutoff.
- Use
estimateBsWidthPlot() to evaluate the optimal binding site width based on the signal-to-flank ratio.
- Enforce reproducibility across replicates by setting the
nReps parameter (typically N-1 replicates) and verifying with reproducibilityScatterPlot().
Common Pitfalls
- Pitfall: Crosslink sites overlapping multiple genes causing inflated site counts. Fix: Set
overlaps = "keepSingle" in BSFind() to reduce overlapping loci to a single instance.
- Pitfall: Low reproducibility across replicates due to library size differences. Fix: Use
reproducibilityFilterPlot() to inspect and adjust the replicate-specific crosslink threshold.
Alternatives
csaw for window-based differential binding analysis of ChIP-seq/ATAC-seq.
macsr for peak calling on enrichment data.
CLIPreg for integrating CLIP-seq with RNA-seq.
Citations
- Busch A, Brüggemann M, Ebersberger S, Zarnack K (2020). "iCLIP data analysis: A complete pipeline from sequencing reads to RBP binding sites." Methods, 178, 49-62. doi:10.1016/j.ymeth.2019.11.008.
References
1---2name: bindingsitefinder3description: BindingSiteFinder4---56# BindingSiteFinder78## Workflows910### Standard Workflow1112```r13library(BindingSiteFinder)14library(txdbmaker)15library(rtracklayer)1617# 1. Import crosslink sites18csFile <- system.file("extdata", "PureCLIP_crosslink_sites_examples.bed", package="BindingSiteFinder")19cs <- rtracklayer::import(con = csFile, format = "BED")2021# 2. Create metadata table and construct BSFDataSet22files <- system.file("extdata", package="BindingSiteFinder")23clipFilesP <- list.files(files, pattern = "plus.bw$", full.names = TRUE)24clipFilesM <- list.files(files, pattern = "minus.bw$", full.names = TRUE)25meta <- data.frame(26 id = 1:4,27 condition = factor(rep("WT", 4)),28 clPlus = clipFilesP,29 clMinus = clipFilesM30)31bds <- BSFDataSetFromBigWig(ranges = cs, meta = meta, silent = TRUE)3233# 3. Build gene and transcript region annotations34annoDb <- txdbmaker::makeTxDbFromGFF(file = "gencode_v37_annotation.gff3", format = "gff3")35gns <- genes(annoDb)36regions <- GRangesList(37 CDS = cds(annoDb),38 Intron = unlist(intronsByTranscript(annoDb)),39 UTR3 = unlist(threeUTRsByTranscript(annoDb)),40 UTR5 = unlist(fiveUTRsByTranscript(annoDb))41)4243# 4. Run BSFind wrapper44bdsOut <- BSFind(45 object = bds,46 anno.genes = gns,47 anno.transcriptRegionList = regions,48 est.subsetChromosome = "chr22",49 veryQuiet = TRUE50)5152# 5. Export results53exportToBED(bdsOut, con = "./myBindingSites.bed")54```55**Input/Output Note:** Inputs a `BSFDataSet` and genomic annotations; outputs a refined `BSFDataSet` with defined binding sites and exports them to a BED file.5657### Differential Binding Analysis5859```r60library(BindingSiteFinder)61library(txdbmaker)6263# 1. Load Gene Annotations and Transcript Regions64annoDb <- txdbmaker::makeTxDbFromGFF(file = "gencode_v37_annotation.gff3", format = "gff3")65gns <- genes(annoDb)66regions <- GRangesList(67 CDS = cds(annoDb),68 Intron = unlist(intronsByTranscript(annoDb)),69 UTR3 = unlist(threeUTRsByTranscript(annoDb)),70 UTR5 = unlist(fiveUTRsByTranscript(annoDb))71)7273# 2. Define binding sites for a condition74bdsOut <- BSFind(75 object = bds, 76 anno.genes = gns, 77 anno.transcriptRegionList = regions, 78 est.subsetChromosome = "chr22"79)80```81**Input/Output Note:** Inputs a `BSFDataSet` and genomic annotations; outputs a `BSFDataSet` with defined binding sites prepared for downstream differential testing.8283## When to Use84- To define precise, equally sized RBP binding sites from genome-wide iCLIP coverage and peak calling results (e.g., PureCLIP crosslink sites).85- To filter, merge, and check reproducibility of crosslink sites across replicates using `BSFind()`.86- To annotate binding sites with genomic features such as genes and transcript regions (CDS, Introns, UTRs) using `genes()`, `cds()`, and `intronsByTranscript()`.8788## When NOT to Use89- For analyzing RNA-seq differential expression or splicing directly without iCLIP/CLIP-seq data (use `DESeq2` or `dexseq` instead).90- For peak calling directly from BAM files (use peak callers like `PureCLIP` first, then import results into `BindingSiteFinder`).9192## Data Requirements93- Crosslink sites as a `GRanges` object (typically single-nucleotide wide, e.g., imported from PureCLIP BED files).94- Replicate-specific coverage data in strand-specific BigWig files (`clPlus` and `clMinus`).95- Gene annotations as a `GRanges` object and transcript regions as a `GRangesList` (e.g., CDS, Introns, 3' UTR, 5' UTR).9697## Key Parameters98- **object**: A `BSFDataSet` containing crosslink ranges and metadata.99- **anno.genes**: A `GRanges` object containing gene annotations.100- **anno.transcriptRegionList**: A `GRangesList` containing transcript region annotations.101- **est.subsetChromosome** ("chr22"): Character vector specifying which chromosome to use for estimating binding site width.102- **veryQuiet** (FALSE): Logical indicating whether to suppress progress messages.103- **est.maxBsWidth** (29): Numeric specifying the maximum binding site width to test during estimation.104105## Best Practices106- Pre-filter crosslink sites with low scores (e.g., removing the lowest 1% of PureCLIP scores) using `pureClipGlobalFilterPlot()` to assess the cutoff.107- Use `estimateBsWidthPlot()` to evaluate the optimal binding site width based on the signal-to-flank ratio.108- Enforce reproducibility across replicates by setting the `nReps` parameter (typically N-1 replicates) and verifying with `reproducibilityScatterPlot()`.109110## Common Pitfalls111- *Pitfall*: Crosslink sites overlapping multiple genes causing inflated site counts. *Fix*: Set `overlaps = "keepSingle"` in `BSFind()` to reduce overlapping loci to a single instance.112- *Pitfall*: Low reproducibility across replicates due to library size differences. *Fix*: Use `reproducibilityFilterPlot()` to inspect and adjust the replicate-specific crosslink threshold.113114## Alternatives115- `csaw` for window-based differential binding analysis of ChIP-seq/ATAC-seq.116- `macsr` for peak calling on enrichment data.117- `CLIPreg` for integrating CLIP-seq with RNA-seq.118119## Citations120- Busch A, Brüggemann M, Ebersberger S, Zarnack K (2020). "iCLIP data analysis: A complete pipeline from sequencing reads to RBP binding sites." *Methods*, 178, 49-62. doi:10.1016/j.ymeth.2019.11.008.121122## References123- Homepage: https://bioconductor.org/packages/bindingsitefinder124- Vignette: https://bioconductor.org/packages/release/bioc/vignettes/bindingsitefinder/inst/doc/Definition_of_binding_sites_from_iCLIP_signal.html