esl-selectn(1)

πŸ“¦
version 3.3.2 Β· 2 versions
, in fedora 43, fedora 44

✨ esl-selectn β€” bestie edition ✨

okay so you want a random little handful of lines out of a big ol' file and you don't wanna load the whole thing into memory?? say less, this is literally the one. it's part of the Easel miniapplication family, it's giving tiny-but-mighty πŸ’…


🌸 NAME 🌸

esl-selectn β€” select random subset of lines from file


πŸ¦‹ SYNOPSIS πŸ¦‹

esl-selectn [options] nlines filename

πŸ’– DESCRIPTION πŸ’–

okay bestie so esl-selectn picks nlines lines at random out of the file filename and prints them to stdout. that's it. that's the whole job. she's focused, she's efficient, she serves 🫢

and if filename is just - (a single dash, yes literally just a dash), then the input gets read from stdin instead. classic.

now here's the part where she really ATE: she uses an efficient reservoir sampling algorithm that only needs

  • a single pass through filename, and
  • memory storage proportional to nlines

and β€” and this is the important bit, do not skip this β€” NOT proportional to the size of the file filename itself. like, the file can be enormous, doesn't matter, she's unbothered 😌

so that means you can use esl-selectn to create large scale statistical sampling experiments, especially when you team her up with other Easel miniapplications. dream team fr fr ✨


πŸŽ€ OPTIONS πŸŽ€

  • -h β€” prints a brief help message, and yes she includes the version number plus a summary of all the options, expert options included. the whole menu, no secrets πŸ’…
  • --seed <d> β€” sets the random number seed to <d>, and <d> has to be an integer >= 0. the default is 0, which means use a randomly selected seed. but if you set a seed > 0, you get reproducible identical samples from different runs of the same command. iykyk, that's the science-reproducibility slay πŸ”₯

🌈 SEE ALSO 🌈

http://bioeasel.org/


Copyright (C) 2020 Howard Hughes Medical Institute.

Freely distributed under the BSD open source license. periodt.


πŸ’œ AUTHOR πŸ’œ

http://eddylab.org


ngl, go read the Easel docs, she's iconic and she deserves it πŸŽ€

okay that's the whole page!! this is Easel 0.48, dated Nov 2020, mwah πŸ’‹ bye bestie, go sample something πŸ¦‹βœ¨

πŸ“¦ where this page comes from