MERYL(1)
okay so bestie ๐ you pulled up meryl(1) from User Commands and honestly?? it's giving kmer factory, main character energy, no cap. let's get you fluent in it. ๐
๐ธ NAME ๐ธ
meryl โ in- and out-of-core kmer counting and utilities โจ
๐ SYNOPSIS ๐
๐งฎ Estimating memory requirements
meryl -P -m kmersize [-c #] [-p] -s seq.fasta
meryl -P -m kmersize [-c #] [-p] -n mercount
๐๏ธ Building a table
meryl -B -m kmersize [-c #] [-p] [-v] [-f|-r|-C] [-L minoccurrence] [-U maxoccurrence] [-threads n | {-segments segments | -memory megabytes} [-configbatch [-sge jobname]]] -s seq.fasta -o tblprefix
meryl -countbatch number [-sgebuild "qsuboptionstring"] -o tblprefix
meryl -mergebatch number [-sgemerge "qsuboptionstring"] -o tblprefix
๐๏ธ Performing operations on a table
meryl -M operation [-v] -s tblprefix [-s tblprefix2 ...] -o output
๐ Dumping a table
meryl -Dh -s tblprefix
meryl -Dt -n mincount -s tblprefix
๐ DESCRIPTION ๐
so what does meryl actually do? it computes the kmer content of genomic sequences. Kmer content is represented as a list of kmers and the number of times each occurs in the input sequences. and here's the glow-up: the kmer can be restricted to only the forward kmer, only the reverse kmer, or the canonical kmer โ that's the lexicographically smaller of the forward and reverse kmer at each location, iykyk. ๐ฆ
and then Meryl can report the histogram of counts, the list of kmers and their counts, or can perform mathematical and set operations on the processed data files. versatile queen ๐
the output of meryl is two binary files, called a meryl database, which can be quickly dumped to provide a histogram of counts, or the actual counts. and โ bestie, this is the best part โ a C++ library is supplied for direct access to the files. periodt. ๐
โจ OPTIONS โจ
-Pโ Estimate memory requirements. Given a sequence file (-s) or an upper limit on the number of mers in the file (-n), compute the table size (-tin build) to minimize the memory usage. This mode recognizes the following options:-m #โ size of a mer (required)-c #โ homopolymer compression (optional)-pโ enable positions-s seq.fastaโ Sequence file to be scanned to determine the number of mers-n #โ compute params assuming file with this many mers in it
Only one of -s, -n need to be specified. If both are given, -s takes priority. ๐
-Bโ Compute the mer-count tables given a sequence file (-s) and lots of parameters. By default, both strands are processed.-fโ only build for the forward strand-rโ only build for the reverse strand-Cโ use canonical mers (assumes both strands)-L #โ DON'T save mers that occur less than#times ๐-U #โ DON'T save mers that occur more than#times ๐-m #โ size of a mer (required)-c #โ homopolymer compression (optional)-pโ enable positions-s seq.fastaโ sequence to build the table for-o tblprefixโ output table prefix-vโ entertain the user ๐ฟ
The meryl process can run in one large memory batch, in many small memory batches, or under SGE control, all with or without using multiple CPU cores. By default, the computation is done as one large sequential process. Multi-threaded operation is possible, at additional memory expense, as is segmented operation, at additional I/O expense. ๐
๐งต Threaded operation
Split the counting in to n almost-equally sized pieces. This uses an extra h MB (from -P) per thread.
-threads nโ usenthreads to build
๐ช Segmented, sequential operation
Split the counting into pieces that will fit into no more than m MB of memory, or into n equal sized pieces. Each piece is computed sequentially, and the results are merged at the end. Only one of -memory and -segments is needed.
-memory mโ use at mostmMB of memory per segment-segments nโ usensegments
๐ฆ Segmented, batched operation
Same as sequential, except this allows each segment to be manually executed in parallel. Only one of -memory and -segments is needed. Also see the EXAMPLE section on this page. ๐ซถ
-memory mโ use at mostmMB of memory per segment-segments nโ usensegments-configbatchโ create the batches-countbatch nโ run batch numbern-mergebatchโ merge the batches
Batched mode can run on the grid. ๐
-sge jobnameโ unique job name for this execution. Meryl will submit jobs with namempjobname,ncjobname,nmjobname, for phases prepare, count and merge.-sgebuild "options"-sgemerge "options"โ any additional options toqsub(1)(e.g.,"-p -153 -pe thread 2 -A merylaccount") N.B. --Nwill be ignored N.B. - be sure to quote the options
bestie the quoting thing is NOT optional, fr fr. and yeah, -N is getting ignored, that's just how it is. ๐ญ
-Mโ Given a list of tables, perform a math, logical or threshold operation. Unless specified, all operations take any number of databases. Math operations are:minโ count is the minimum count for all databases. If the mer does NOT exist in all databases, the mer has a zero count, and is NOT in the output. ๐minexistโ count is the minimum count for all databases that contain the mermaxโ count is the maximum count for all databasesaddโ count is sum of the counts for all databasessubโ count is the first minus the second (binary only)absโ count is the absolute value of the first minus the second (binary only)
Logical operations are:
andโ outputs mer iff it exists in all databasesnandโ outputs mer iff it exists in at least one, but not all, databasesorโ outputs mer iff it exists in at least one databasexorโ outputs mer iff it exists in an odd number of databases
Threshold operations are:
lessthan xโ outputs mer iff it has count< xlessthanorequal xโ outputs mer iff it has count<= xgreaterthan xโ outputs mer iff it has count> xgreaterthanorequal xโ outputs mer iff it has count>= xequal xโ outputs mer iff it has count== x
Threshold operations work on exactly one database.
-s tblprefixโ usetblprefixas a database-o tblprefixโ create this output-vโ entertain the user ๐ฟ
-Dโ Dump table (not all of these work) ๐-Ddโ Dump a histogram of the distance between the same mers.-Dtโ Dump mers>=a threshold. Use-nto specify the threshold.-Dcโ Count the number of mers, distinct mers and unique mers.-Dhโ Dump (to stdout) a histogram of mer counts.-sโ Read the count table from here (leave off the.mcdator.mcidx).
๐งช EXAMPLE ๐งช
๐ญ Batch creation of a table
Initialize the compute with -configbatch, which needs all the build options. Execute all -countbatch jobs, then -mergebatch to complete. โจ
meryl -configbatch -B [options] -o file
meryl -countbatch 0 -o file
meryl -countbatch 1 -o file
...
meryl -countbatch N -o file
meryl -mergebatch N -o file
๐ SEE ALSO ๐
simple(1), mapMers(1), mapMers-depth(1), kmer-mask(1)
and that's the whole vibe bestie ๐ซถ this page is from meryl 0~20150520+2004, dated May 2015 โ yes, a 2015 icon, we stan a vintage queen ๐๐ go count some kmers, you've got this. ๐ฆ๐ธ
๐ฆ where this page comes from
- debian bookworm: meryl 0~20150903+r2013-8+b3 ยท GPL-2.0-or-later
- debian trixie: meryl 0~20150903+r2013-9+b1 ยท GPL-2.0-or-later
- ubuntu jammy: meryl 0~20150903+r2013-8build2 ยท GPL-2.0-or-later
- ubuntu noble: meryl 0~20150903+r2013-8build4 ยท GPL-2.0-or-later
- ubuntu questing: meryl 0~20150903+r2013-9build1
- ubuntu resolute: meryl 0~20150903+r2013-10build1 ยท GPL-2.0-or-later
- ubuntu stonking: meryl 0~20150903+r2013-10build1 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms