esl-selectn
Quick Start
- Command:
esl-selectn [-options] <n> <file> - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/esl-selectn - Extended help: See
references/help.md
When To Use This Tool
- Use
esl-selectnwhen the thing you want to sample is one physical line per record. - It is useful for downsampling huge ID lists, score tables, one-record-per-line exports, or stdin streams in a single pass.
- Reach for
--seedwhen you need the same sampled subset on repeated runs.
Common Patterns
# Sample 100 random lines from a text file
esl-selectn 100 all-records.txt > sample.txt
# Reproducible sampling with a fixed seed
esl-selectn --seed 42 500 ids.txt > ids.sample.txt
# Sample directly from a stream
cat metrics.tsv | esl-selectn 1000 - > metrics.sample.tsv
Recommended Workflow
- Make sure each logical record you care about is represented by exactly one line.
- Choose the sample size
nand whether you need reproducibility. - Run
esl-selectnon the file or stream, redirecting stdout to the sampled output. - Validate the sampled line count and spot-check that the input format survived intact.
Guardrails
- This tool samples lines, not FASTA, FASTQ, or Stockholm records. Multi-line biological records must be flattened or sampled by another method first.
- The implementation is single-pass reservoir sampling, so memory scales with
n, not with full file size. -hworks;--helpand--versionare rejected by the local executable.filemay be-to read from stdin.