| 1 |
.TH MERYL "1" "May 2015" "meryl 0~20150520+2004" "User Commands" |
| 2 |
.SH NAME |
| 3 |
meryl \- in- and out-of-core kmer counting and utilities |
| 4 |
.SH SYNOPSIS |
| 5 |
.SS Estimating memory requirements |
| 6 |
.PP |
| 7 |
.B meryl \-P |
| 8 |
.BI -m \0kmersize |
| 9 |
.RB [ \-c |
| 10 |
.IR # ] |
| 11 |
.RB [ \-p ] |
| 12 |
.BI \-s \0seq.fasta |
| 13 |
.PP |
| 14 |
.B meryl \-P |
| 15 |
.BI \-m \0kmersize |
| 16 |
.RB [ \-c |
| 17 |
.IR # ] |
| 18 |
.RB [ \-p ] |
| 19 |
.BI \-n \0mercount |
| 20 |
.SS Building a table |
| 21 |
.B meryl \-B |
| 22 |
.BI -m \0kmersize |
| 23 |
.RB [ \-c |
| 24 |
.IR # ] |
| 25 |
.RB [ \-p ] |
| 26 |
.RB [ \-v ] |
| 27 |
.RB [ \-f | \-r | \-C ] |
| 28 |
.RB [ \-L |
| 29 |
.IR minoccurrence ] |
| 30 |
.RB [ \-U |
| 31 |
.IR maxoccurrence ] |
| 32 |
.RB [ \-threads |
| 33 |
.IR n \0| |
| 34 |
.RB { \-segments |
| 35 |
.IR segments \0| |
| 36 |
.BI \-memory \0megabytes \fR} |
| 37 |
.RB [ \-configbatch \0[ \-sge |
| 38 |
.IR jobname ]]] |
| 39 |
.BI \-s \0seq.fasta |
| 40 |
.BI \-o \0tblprefix |
| 41 |
.PP |
| 42 |
.B meryl |
| 43 |
.BI \-countbatch \0number |
| 44 |
.RB [ \-sgebuild |
| 45 |
\fR"\fIqsuboptionstring\fR"] |
| 46 |
.BI \-o \0tblprefix |
| 47 |
.PP |
| 48 |
.B meryl |
| 49 |
.BI \-mergebatch \0number |
| 50 |
.RB [ \-sgemerge |
| 51 |
\fR"\fIqsuboptionstring\fR"] |
| 52 |
.BI \-o \0tblprefix |
| 53 |
.SS Performing operations on a table |
| 54 |
.B meryl |
| 55 |
.BI -M \0operation |
| 56 |
.RB [ \-v ] |
| 57 |
.BI \-s \0tblprefix |
| 58 |
.RB [ \-s |
| 59 |
.IR \0tblprefix2 \0...] |
| 60 |
.BI \-o \0output |
| 61 |
.SS Dumping a table |
| 62 |
.B meryl \-Dh |
| 63 |
.BI \-s \0tblprefix |
| 64 |
.PP |
| 65 |
.B meryl \-Dt |
| 66 |
.BI \-n \0mincount |
| 67 |
.BI \-s \0tblprefix |
| 68 |
.SH DESCRIPTION |
| 69 |
\fBmeryl\fR computes the kmer content of genomic sequences. |
| 70 |
Kmer content is represented as a list of kmers and the number of times each occurs in the input sequences. |
| 71 |
The kmer can be restricted to only the forward kmer, only the reverse kmer, or the canonical kmer (lexicographically smaller of the forward and reverse kmer at each location). |
| 72 |
\fBMeryl\fR 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. |
| 73 |
.PP |
| 74 |
The output of |
| 75 |
.B meryl |
| 76 |
is two binary files, called a meryl database, which can be |
| 77 |
quickly dumped to provide a histogram of counts, or the actual counts. |
| 78 |
A C++ library is supplied for direct access to the files. |
| 79 |
.SH OPTIONS |
| 80 |
.TP |
| 81 |
.B \-P |
| 82 |
Estimate memory requirements. Given a sequence file (\fB\-s\fR) or an upper limit on the number of mers in the file (\fB\-n\fR), compute the table size |
| 83 |
(\fB\-t\fR in build) to minimize the memory usage. This mode recognizes the following options: |
| 84 |
.RS |
| 85 |
.TP |
| 86 |
.BI \-m \0# |
| 87 |
size of a mer (required) |
| 88 |
.TP |
| 89 |
.BI \-c \0# |
| 90 |
homopolymer compression (optional) |
| 91 |
.TP |
| 92 |
.B \-p |
| 93 |
enable positions |
| 94 |
.TP |
| 95 |
.BI \-s \0seq.fasta |
| 96 |
Sequence file to be scanned to determine the number of mers |
| 97 |
.TP |
| 98 |
.BI \-n \0# |
| 99 |
compute params assuming file with this many mers in it |
| 100 |
.PP |
| 101 |
Only one of \fB\-s\fR, \fB\-n\fR need to be specified. |
| 102 |
If both are given, \fB\-s\fR takes priority. |
| 103 |
.RE |
| 104 |
.TP |
| 105 |
.B \-B |
| 106 |
Compute the mer-count tables given a sequence file (\fB\-s\fR) and lots of parameters. |
| 107 |
By default, both strands are processed. |
| 108 |
.RS |
| 109 |
.TP |
| 110 |
.B \-f |
| 111 |
only build for the forward strand |
| 112 |
.TP |
| 113 |
.B \-r |
| 114 |
only build for the reverse strand |
| 115 |
.TP |
| 116 |
.B \-C |
| 117 |
use canonical mers (assumes both strands) |
| 118 |
.TP |
| 119 |
.BI \-L \0# |
| 120 |
DON'T save mers that occur less than # times |
| 121 |
.TP |
| 122 |
.BI \-U \0# |
| 123 |
DON'T save mers that occur more than # times |
| 124 |
.TP |
| 125 |
.BI \-m \0# |
| 126 |
size of a mer (required) |
| 127 |
.TP |
| 128 |
.BI \-c \0# |
| 129 |
homopolymer compression (optional) |
| 130 |
.TP |
| 131 |
.B \-p |
| 132 |
enable positions |
| 133 |
.TP |
| 134 |
.BI \-s \0seq.fasta |
| 135 |
sequence to build the table for |
| 136 |
.TP |
| 137 |
.BI \-o \0tblprefix |
| 138 |
output table prefix |
| 139 |
.TP |
| 140 |
\fB\-v\fR |
| 141 |
entertain the user |
| 142 |
.PP |
| 143 |
The |
| 144 |
.B meryl |
| 145 |
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. |
| 146 |
By default, the computation is done as one large sequential process. |
| 147 |
Multi\-threaded operation is possible, at additional memory expense, as |
| 148 |
is segmented operation, at additional I/O expense. |
| 149 |
.TP |
| 150 |
.B Threaded operation |
| 151 |
Split the counting in to n almost\-equally sized pieces. |
| 152 |
This uses an extra h MB (from \fB\-P\fR) per thread. |
| 153 |
.RS |
| 154 |
.TP |
| 155 |
.BI \-threads \0n |
| 156 |
use |
| 157 |
.I n |
| 158 |
threads to build |
| 159 |
.RE |
| 160 |
.TP |
| 161 |
.B Segmented, sequential operation |
| 162 |
Split the counting into pieces that |
| 163 |
will fit into no more than m MB of memory, or into n equal sized pieces. |
| 164 |
Each piece is computed sequentially, and the results are merged at the end. |
| 165 |
Only one of \fB\-memory\fR and \fB\-segments\fR is needed. |
| 166 |
.RS |
| 167 |
.TP |
| 168 |
.BI \-memory \0m |
| 169 |
use at most \fIm\fR MB of memory per segment |
| 170 |
.TP |
| 171 |
.BI \-segments \0n |
| 172 |
use \fIn\fR segments |
| 173 |
.PP |
| 174 |
.RE |
| 175 |
.TP |
| 176 |
.B Segmented, batched operation |
| 177 |
Same as sequential, except this allows each segment to be manually executed |
| 178 |
in parallel. |
| 179 |
Only one of \fB\-memory\fR and \fB\-segments\fR is needed. |
| 180 |
Also see the |
| 181 |
.I EXAMPLE |
| 182 |
section on this page. |
| 183 |
.RS |
| 184 |
.TP |
| 185 |
.BI \-memory \0m |
| 186 |
use at most \fIm\fR MB of memory per segment |
| 187 |
.TP |
| 188 |
.BI \-segments \0n |
| 189 |
use \fIn\fR segments |
| 190 |
.TP |
| 191 |
.B \-configbatch |
| 192 |
create the batches |
| 193 |
.TP |
| 194 |
.BI \-countbatch \0n |
| 195 |
run batch number \fIn\fR |
| 196 |
.TP |
| 197 |
.B \-mergebatch |
| 198 |
merge the batches |
| 199 |
.PP |
| 200 |
Batched mode can run on the grid. |
| 201 |
.TP |
| 202 |
.BI \-sge \0jobname |
| 203 |
unique job name for this execution. |
| 204 |
\fBMeryl\fR will submit jobs with name mp\fIjobname\fR, nc\fIjobname\fR, nm\fIjobname\fR, for |
| 205 |
phases prepare, count and merge. |
| 206 |
.TP |
| 207 |
.BI \-sgebuild \0"options" |
| 208 |
.TP |
| 209 |
.BI \-sgemerge \0"options" |
| 210 |
any additional options to |
| 211 |
.BR qsub (1) |
| 212 |
(e.g., "\-p \fB\-153\fR \fB\-pe\fR thread 2 \fB\-A\fR merylaccount") |
| 213 |
N.B. \- \fB\-N\fR will be ignored |
| 214 |
N.B. \- be sure to quote the options |
| 215 |
.RE |
| 216 |
.RE |
| 217 |
.TP |
| 218 |
.B \-M |
| 219 |
Given a list of tables, perform a math, logical or threshold operation. |
| 220 |
Unless specified, all operations take any number of databases. |
| 221 |
Math operations are: |
| 222 |
.RS |
| 223 |
.TP |
| 224 |
.B min |
| 225 |
count is the minimum count for all databases. If the mer |
| 226 |
does NOT exist in all databases, the mer has a zero count, and |
| 227 |
is NOT in the output. |
| 228 |
.TP |
| 229 |
.B minexist |
| 230 |
count is the minimum count for all databases that contain the mer |
| 231 |
.TP |
| 232 |
.B max |
| 233 |
count is the maximum count for all databases |
| 234 |
.TP |
| 235 |
.B add |
| 236 |
count is sum of the counts for all databases |
| 237 |
.TP |
| 238 |
.B sub |
| 239 |
count is the first minus the second (binary only) |
| 240 |
.TP |
| 241 |
.B abs |
| 242 |
count is the absolute value of the first minus the second (binary only) |
| 243 |
.PP |
| 244 |
Logical operations are: |
| 245 |
.TP |
| 246 |
.B and |
| 247 |
outputs mer iff it exists in all databases |
| 248 |
.TP |
| 249 |
.B nand |
| 250 |
outputs mer iff it exists in at least one, but not all, databases |
| 251 |
.TP |
| 252 |
.B or |
| 253 |
outputs mer iff it exists in at least one database |
| 254 |
.TP |
| 255 |
.B xor |
| 256 |
outputs mer iff it exists in an odd number of databases |
| 257 |
.PP |
| 258 |
Threshold operations are: |
| 259 |
.TP |
| 260 |
.BI lessthan \0x |
| 261 |
outputs mer iff it has count < x |
| 262 |
.TP |
| 263 |
.BI lessthanorequal \0x |
| 264 |
outputs mer iff it has count <= x |
| 265 |
.TP |
| 266 |
.BI greaterthan \0x |
| 267 |
outputs mer iff it has count > x |
| 268 |
.TP |
| 269 |
.BI greaterthanorequal \0x |
| 270 |
outputs mer iff it has count >= x |
| 271 |
.TP |
| 272 |
.BI equal \0x |
| 273 |
outputs mer iff it has count == x |
| 274 |
.PP |
| 275 |
Threshold operations work on exactly one database. |
| 276 |
.TP |
| 277 |
.BI \-s \0tblprefix |
| 278 |
use \fItblprefix\fR as a database |
| 279 |
.TP |
| 280 |
.BI \-o \0tblprefix |
| 281 |
create this output |
| 282 |
.TP |
| 283 |
\fB\-v\fR |
| 284 |
entertain the user |
| 285 |
.RE |
| 286 |
.TP |
| 287 |
.B \-D |
| 288 |
Dump table (not all of these work) |
| 289 |
.RS |
| 290 |
.TP |
| 291 |
\fB\-Dd\fR |
| 292 |
Dump a histogram of the distance between the same mers. |
| 293 |
.TP |
| 294 |
\fB\-Dt\fR |
| 295 |
Dump mers >= a threshold. Use \fB\-n\fR to specify the threshold. |
| 296 |
.TP |
| 297 |
\fB\-Dc\fR |
| 298 |
Count the number of mers, distinct mers and unique mers. |
| 299 |
.TP |
| 300 |
\fB\-Dh\fR |
| 301 |
Dump (to stdout) a histogram of mer counts. |
| 302 |
.TP |
| 303 |
\fB\-s\fR |
| 304 |
Read the count table from here (leave off the .mcdat or .mcidx). |
| 305 |
.RE |
| 306 |
.SH EXAMPLE |
| 307 |
.SS Batch creation of a table |
| 308 |
Initialize the compute with \fB\-configbatch\fR, which needs all the build options. |
| 309 |
Execute all \fB\-countbatch\fR jobs, then \fB\-mergebatch\fR to complete. |
| 310 |
.PP |
| 311 |
.nf |
| 312 |
.RS |
| 313 |
meryl \fB\-configbatch\fR \fB\-B\fR [options] \fB\-o\fR file |
| 314 |
meryl \fB\-countbatch\fR 0 \fB\-o\fR file |
| 315 |
meryl \fB\-countbatch\fR 1 \fB\-o\fR file |
| 316 |
\&... |
| 317 |
meryl \fB\-countbatch\fR N \fB\-o\fR file |
| 318 |
meryl \fB\-mergebatch\fR N \fB\-o\fR file |
| 319 |
.RE |
| 320 |
.fi |
| 321 |
.SH SEE ALSO |
| 322 |
.BR simple (1), |
| 323 |
.BR mapMers (1), |
| 324 |
.BR mapMers-depth (1), |
| 325 |
.BR kmer-mask (1) |