bedtools/bedtools_sample

genomics
sampling
subset
reservoir
random
quality-control

Description

Take a random sample of records from BED/GFF/VCF/BAM files using reservoir sampling algorithm.

bedtools sample uses the reservoir sampling algorithm to randomly select a specified number
of records from genomic interval files. This is particularly useful for creating representative
subsets of large datasets for testing, quality control, or downstream analysis.

This tool is commonly used for:

  • Creating representative subsets of large genomic datasets

  • Quality control and validation with smaller sample sizes

  • Testing pipelines with manageable data volumes

  • Generating training datasets for machine learning applications

  • Reducing file sizes while maintaining statistical properties

Type

bash_script

License

MIT

Keywords

genomics
sampling
subset
reservoir
random
quality-control

Contributors

Run this component

Run the following command to execute this component with Nextflow:

cat > params.yaml <<'EOM'  
output: "$id.$key.output.bed"  
id: "run"  
publish_dir: "output/"  
EOM

nextflow run https://packages.viash-hub.com/vsh/biobox.git \  
  -revision v0.4.0 \  
  -main-script target/nextflow/bedtools/bedtools_sample/main.nf \  
  -params-file params.yaml  

Inputs

Name
Type & Properties
--input
-i
file
required

Outputs

Name
Type & Properties
--output
file
required
output

Sampling Options

Name
Type & Properties
--number
-n
integer
--seed
integer

Strand Options

Name
Type & Properties
--strand_requirement
-s
string

Output Format Options

Name
Type & Properties
--output_bed
-bed
boolean_true
--uncompressed_bam
-ubam
boolean_true
--include_header
-header
boolean_true

Performance Options

Name
Type & Properties
--no_buffer
-nobuf
boolean_true
--input_buffer
-iobuf
string

Collaborate Accelerate Succeed

Empower your organization with secure, scalable workflow solutions that simplify development, ensure compliance, and drive innovation.

Viash Hub is a platform developed by Data Intuitive, a Belgian-based bioinformatics company specializing in data workflow development and deployment.