bedtools/bedtools_random
Description
Generate random intervals among a genome.
bedtools random generates a specified number of random intervals with a defined length
across a reference genome. This tool is useful for creating random genomic regions for
statistical analysis, generating null datasets for enrichment testing, or creating
control datasets for comparative genomics studies.
This tool is commonly used for:
Creating random control regions for enrichment analysis
Generating null datasets for statistical testing
Producing background intervals for comparative studies
Creating random sampling of genomic space
Building control datasets for machine learning applications
Testing genomic analysis pipelines with known random data
Inputs
Name | Type & Properties | Description |
|---|---|---|
--genome -g | file required | Genome file with chromosome names and sizes. **Format:** Tab-delimited file with chromosome information **Content:** Each line contains: <chromName><TAB><chromSize> **Requirements:** Chromosome names and their corresponding sizes in base pairs **Creation:** Can be generated using `samtools faidx` on FASTA files **Example:** chr1<TAB>249250621 |
Outputs
Name | Type & Properties | Description |
|---|---|---|
--output | file required output | Output file with generated random intervals. **Format:** 6-column format (chrom, start, end, name, score, strand) **Content:** Randomly placed intervals across the specified genome **Coordinates:** 0-based start, 1-based end (standard BED format) **Additional columns:** Sequential name, score (interval length), random strand **Ordering:** Intervals are not necessarily sorted by position |
Options
Name | Type & Properties | Description |
|---|---|---|
--length -l | integer | Length of the intervals to generate in base pairs. **Default:** 100 **Usage:** All generated intervals will have this fixed length **Range:** Positive integer values **Considerations:** Length should be reasonable relative to chromosome sizes |
--number -n | integer | Number of intervals to generate. **Default:** 1,000,000 **Usage:** Total number of random intervals to create **Range:** Positive integer values **Considerations:** Large numbers may take longer to generate and require more memory |
--seed | integer | Integer seed for random number generation. **Default:** Automatically chosen seed (non-deterministic) **Usage:** Provides reproducible results when the same seed is used **Range:** Any integer value **Applications:** Essential for reproducible analyses and testing |
Run this component
Run the following command to execute this component with Nextflow:
cat > params.yaml <<'EOM'
output: "$id.$key.output.bed"
length: [ 100 ]
number: [ 1000000 ]
id: "run"
publish_dir: "output/"
EOM
nextflow run https://packages.viash-hub.com/vsh/biobox.git \
-revision v0.4.1 \
-main-script target/nextflow/bedtools/bedtools_random/main.nf \
-params-file params.yaml Relationships
Used by
No components use this component.
Current component
Uses
No component dependencies found.