agentsclimarketplace

Fragment length prediction and extension

Skill HolobiomicsLab/asb-skill-collections/collections/epigenomics/v1/skills/fragment-length-prediction-and-extension

Use when after filtering duplicate reads from ChIP-Seq data but before generating pileup coverage tracks.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill fragment-length-prediction-and-extension

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 15 stars15 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 file declares

Copied from the file, not written here

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

5.8 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

fragment-length-prediction-and-extension

Summary

Estimate the DNA fragment length (d) from ChIP-Seq data using cross-correlation analysis, then extend aligned reads to this length to generate accurate ChIP coverage tracks. This step is critical for converting point-wise read alignments into fragment-level signal representation.

When to use

After filtering duplicate reads from ChIP-Seq data but before generating pileup coverage tracks. Apply this skill when you have aligned ChIP reads in BED format and need to construct coverage BEDGRAPH files that reflect the actual DNA fragment distribution rather than single-end read positions.

When NOT to use

  • Input reads are already paired-end (BEDPE format) — use the observed fragment length distribution from BEDPE instead of re-predicting.
  • Fragment length is known a priori from sequencing metadata — skip prediction and use the known value directly with --extsize.
  • Control sample is being processed — predictd should only be applied to ChIP data, not input/control data.

Inputs

  • Filtered ChIP-Seq reads in BED format (e.g., CTCF_ChIP_200K.bed.gz)
  • Genome size specification (e.g., 'hs' for human, or explicit bp count)

Outputs

  • Predicted fragment length scalar d (integer, in base pairs)
  • ChIP coverage BEDGRAPH track (genomic coordinates × extended fragment count)

How to apply

First, run macs3 predictd on the filtered ChIP sample using parameters -g hs (human genome size) and -m 5 50 (search fragment length range 5–50 bp) to estimate the dominant fragment length d from cross-correlation peaks. The tool analyzes the distribution of reads across the genome and returns a single scalar d value. Next, use macs3 pileup with the --extsize parameter set to d to extend each filtered ChIP read bidirectionally (or in a strand-aware manner) to the predicted fragment length. This produces a BEDGRAPH file where each genomic position reflects the number of extended fragments covering it, not raw reads. The predicted fragment length d should typically fall within the sequencing protocol's expected range (e.g., 150–200 bp for typical ChIP-Seq); anomalous values (< 50 bp or > 500 bp) warrant re-examination of sequencing quality and read filtering.

Related tools

Examples

macs3 predictd -i CTCF_ChIP_200K.bed.gz -g hs -m 5 50 && macs3 pileup -i CTCF_ChIP_200K.bed.gz -o CTCF_ChIP_pileup.bdg --extsize 147

Evaluation signals

  • Predicted fragment length d is within the expected range for the sequencing protocol and sample type (typically 100–300 bp for ChIP-Seq).
  • macs3 predictd completes without error and outputs a single numeric d value to stdout or log.
  • Generated BEDGRAPH has non-zero coverage at genomic regions expected to harbor the target protein (e.g., known binding sites for CTCF).
  • BEDGRAPH coverage values are integers ≥ 1 and reflect the number of fragments, not raw reads; coverage should be lower than a raw (non-extended) pileup at the same loci.
  • Fragment length d is consistent across replicate ChIP samples of the same protein/cell type.

Limitations

  • predictd assumes a single dominant fragment length; heterogeneous fragment size distributions (e.g., from degraded chromatin or mixed library sizes) may yield biased or multimodal estimates.
  • Prediction quality depends on sequencing depth and the strength of ChIP enrichment; low-coverage or weak-signal ChIP samples may produce unreliable d estimates.
  • predictd is designed for single-end ChIP-Seq; paired-end data should use empirical fragment length from BEDPE files instead.
  • Extension by a single scalar d does not account for fragment-length heterogeneity or strand-specific biases; more sophisticated approaches (e.g., fragment-length-aware probabilistic models) may be needed for high-resolution analyses.

Evidence

  • [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"
  • [methods] Predict fragment length d from the filtered ChIP sample using macs3 predictd with -g hs and -m 5 50 parameters: "Predict fragment length d from the filtered ChIP sample using macs3 predictd with -g hs and -m 5 50 parameters"
  • [methods] Generate ChIP pileup BEDGRAPH by extending filtered ChIP reads to the predicted fragment length d using macs3 pileup with --extsize parameter: "Generate ChIP pileup BEDGRAPH by extending filtered ChIP reads to the predicted fragment length d using macs3 pileup with --extsize parameter"
  • [methods] This can also be accomplished using the predictd subcommand, which we need to apply only to ChIP data: "This can also be accomplished using the predictd subcommand, which we need to apply only to ChIP data"
  • [methods] generate a pileup track for the ChIP sample using the MACS3 pileup subcommand: "generate a pileup track for the ChIP sample using the MACS3 pileup subcommand"

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.