Fragment length estimation cross correlation
Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder
npx -y skills add HolobiomicsLab/asb-skill-collections --skill fragment-length-estimation-cross-correlationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use when when beginning ChIP-Seq analysis with single-end BED/SAM input and no prior knowledge of the library's fragment length.
The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
7.0 KB, as published. Nobody here has run it
fragment-length-estimation-cross-correlation
Summary
Estimate the DNA fragment length d in ChIP-Seq experiments by cross-correlation analysis of read pileups, a critical parameter that determines downstream peak calling accuracy and local background normalization. This skill uses MACS3's predictd subcommand to infer the typical distance between forward and reverse strand reads.
When to use
When beginning ChIP-Seq analysis with single-end BED/SAM input and no prior knowledge of the library's fragment length. The fragment length is essential before generating coverage tracks and building local bias backgrounds, as it directly controls peak calling resolution (minimum peak length) and background normalization scales. Apply this skill immediately after duplicate filtering but before pileup track generation.
When NOT to use
- Input is paired-end BED (BEDPE format) — use fragment length from BEDPE read pairs directly instead.
- Fragment length is already known from prior QC (e.g., Bioanalyzer, library prep documentation) — skip prediction and use known value to save compute time.
- Control-only or Input-only samples — predictd requires ChIP sample; cannot infer fragment length from background alone.
Inputs
- Deduplicated ChIP-Seq BED file (single-end, post-filterdup)
- Genome size (integer, e.g., 'hs' for human haploid ~2.7 billion bp)
- mfold range (integers, default 5 50; defines fold-enrichment window for cross-correlation peak detection)
Outputs
- Predicted fragment length d (integer, in base pairs)
- Cross-correlation plot (diagnostic, optional PDF output)
- Shift distance metrics (diagnostic output from predictd analysis)
How to apply
Run macs3 predictd on deduplicated ChIP sample using default parameters: macs3 predictd -i <filtered_chip.bed> -g <genome_size> -m 5 50 (mfold range). The tool performs cross-correlation analysis by shifting reads across strands and identifying the lag distance with maximum correlation, yielding fragment length d (e.g., 254 bp for CTCF data). The predicted d is then used as --extsize parameter in macs3 pileup (ChIP coverage extension), as the extension size in control background tracks (d/2 for d-background, typically 127 bp), and as minimum peak length constraint in macs3 bdgpeakcall. Validate by checking that d is biologically plausible for your protocol (typically 100–500 bp for sonication-based ChIP).
Related tools
- macs3 predictd (Cross-correlation-based fragment length inference from deduplicated ChIP reads; directly outputs d parameter for downstream pileup and peak calling) — https://github.com/macs3-project/MACS
- macs3 filterdup (Prerequisite: removes duplicate reads before predictd input to ensure fair cross-correlation signal) — https://github.com/macs3-project/MACS
- macs3 pileup (Consumes predicted d as --extsize parameter to generate strand-extended ChIP coverage track) — https://github.com/macs3-project/MACS
- macs3 bdgpeakcall (Uses d as minimum peak length constraint during final peak calling from q-value bedgraph) — https://github.com/macs3-project/MACS
Examples
macs3 predictd -i CTCF_ChIP_200K.bed -g hs -m 5 50
Evaluation signals
- Predicted d should be within expected range for the experimental protocol (sonication-based ChIP typically 100–500 bp; verify against Bioanalyzer/Agilent QC if available)
- Cross-correlation peak should be visually distinct and unambiguous in the shift distance plot (diagnostic output); bimodal or flat correlation suggests poor quality or over-sonication
- Downstream peak calls should be reproducible and consistent with biological expectations (e.g., CTCF peaks at known binding sites, comparable peak counts to published datasets)
- Local background scaling factors (0.254 and 0.0254 for slocal/llocal in default MACS3) should produce reasonable signal-to-noise ratios; extreme background values indicate problematic d estimation
- Peak minimum length (set to d in bdgpeakcall) should filter out spurious single-read peaks while retaining true ChIP-enriched regions
Limitations
- Assumes mononucleosome library (~147 bp plus linker) or monoclonal antibody-driven fragment size distribution; fails or becomes unreliable for oligomeric protein complexes with heterogeneous footprints (e.g., multi-protein arrays).
- Sensitive to duplicate filtering settings (--keep-dup parameter); over-aggressive duplicate removal removes valid PCR replicates, reducing cross-correlation signal; under-filtering inflates d artificially.
- Genome size parameter (−g) must be accurate; miscalibration propagates to local lambda scaling and may distort q-value thresholds.
- Does not account for strand-specific biases or adapter contamination in single-end libraries; low-quality or contaminated reads may yield misleading d estimates.
- Cross-correlation method assumes ChIP reads follow expected positive strand/negative strand distribution; heavily degraded or fragmented samples may produce noisy or ambiguous predictions.
Evidence
- [other] Predict fragment length d from filtered ChIP data using macs3 predictd with default mfold parameters -m 5 50 and genome size -g hs, yielding d=254 bp: "Predict fragment length d from filtered ChIP data using macs3 predictd with default mfold parameters -m 5 50 and genome size -g hs, yielding d=254 bp"
- [methods] This is a crucial step for analyzing ChIP-Seq with MACS3, as well as other types of data: "This is a crucial step for analyzing ChIP-Seq with MACS3, as well as other types of data"
- [methods] This can also be accomplished using the
predictdsubcommand, which we need to apply only to ChIP data: "This can also be accomplished using thepredictdsubcommand, which we need to apply only to ChIP data" - [methods] Now that you've estimated the fragment length, we can proceed to generate a pileup track for the ChIP sample using the MACS3
pileupsubcommand: "Now that you've estimated the fragment length, we can proceed to generate a pileup track for the ChIP sample using the MACS3pileupsubcommand" - [methods] The final step in peak calling is to identify regions that surpass a specific score cutoff using the
bdgpeakcallfunction for narrow peak calling: "identify regions that surpass a specific score cutoff using thebdgpeakcallfunction for narrow peak calling"